This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Built new NMEA sentence with Barometric pressure inhg and millibars
#1
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.


Attached Files Image(s)
   
Reply
#2
(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.

   

Punctuation is the difference between letting your uncle Jack, off a horse and letting your uncle, jack off a horse!  Big Grin
--
Sailor and techie or techie and sailor?
Whichever way I am in the right place
Reply
#3
Ahh, yes that was the error, was late already so mistakes happens quickly.
Thanks for the hint.
Btw. shouldn´t jack off a horse...... :-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)