OpenMarine

Full Version: Built new NMEA sentence with Barometric pressure inhg and millibars
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Am trying to rebuilt a a existing NMEA sentence into a new sentence which contains Inches of Mercury and Millibars, however i am litle stuck on this.
I have a sensor which is putting out a fixed number without decimal point so need to get that into a number with 2 numbers.
1 mBar seems to be 0.029529983071445 inhg according to NOAA.

The following NMEA sentence needs to be build:
$WIMMB,29.83,I,1010.3,B*64
Where, 29.82 = value in inhg (inches per Mercury)
I = indicator for Inches
1010.3 = pressure in mBars
B= indicator for Bar

When i use the following code in Node-Red as seen in attachment it shows me only the first half of the sentence (with mBar at the wrong place but that´s only to show if the string is working, needs conversion there).
Is anyone able to assist me to get this string complete with correct indication of inhg and Mbar with 2 decimals behind the digit??.

By the way, during another conversion i figured out that the checksum is calculated with a small alphabetical letter instead of a capital letter according to NMEA standards, OpenCPN is accepting this sentence but obviously the sentence is not 100% according NMEA protocol, is there any way to change small letters into capital regarding checksum??

Hope somebody can help me.
(2023-03-28, 07:33 AM)Arnie419 Wrote: [ -> ]Am trying to rebuilt a a existing NMEA sentence into a new sentence which contains Inches of Mercury and Millibars, however i am litle stuck on this.
I have a sensor which is putting out a fixed number without decimal point so need to get that into a number with 2 numbers.
1 mBar seems to be 0.029529983071445 inhg according to NOAA.

The following NMEA sentence needs to be build:
$WIMMB,29.83,I,1010.3,B*64
Where, 29.82 = value in inhg (inches per Mercury)
I = indicator for Inches
1010.3 = pressure in mBars
B= indicator for Bar

When i use the following code in Node-Red as seen in attachment it shows me only the first half of the sentence (with mBar at the wrong place but that´s only to show if the string is working, needs conversion there).
Is anyone able to assist me to get this string complete with correct indication of inhg and Mbar with 2 decimals behind the digit??.

By the way, during another conversion i figured out that the checksum is calculated with a small alphabetical letter instead of a capital letter according to NMEA standards, OpenCPN is accepting this sentence but obviously the sentence is not 100% according NMEA protocol, is there any way to change small letters into capital regarding checksum??

Hope somebody can help me.
You have an extra comma there.

[attachment=2115]

Punctuation is the difference between letting your uncle Jack, off a horse and letting your uncle, jack off a horse!  Big Grin
Ahh, yes that was the error, was late already so mistakes happens quickly.
Thanks for the hint.
Btw. shouldn´t jack off a horse...... :-)