Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NMEA0183 XDR sentences for temperature and battery level #21

Open
amotl opened this issue Feb 24, 2023 · 18 comments
Open

NMEA0183 XDR sentences for temperature and battery level #21

amotl opened this issue Feb 24, 2023 · 18 comments

Comments

@amotl
Copy link
Contributor

amotl commented Feb 24, 2023

Introduction

At #12 (comment), @UserMacUseface shared a pointer to NMEA0183 XDR sentences 1, which can be used to transmit pitch and roll values.

XDR more

Other than those, XDR sentences can apparently be used to transmit temperature data, and battery level, see both 1 and 2.

mandag 15. februar 2016 15.30.56 UTC+1 skrev Mike følgende:

Here are temperature sentences from two different masthead anemometers I have:

$WIXDR,C,022.0,C,,*52
$YXXDR,C,20,C*61

OpenCPN Manual displays those examples:

$IIXDR,C,19.52,C,TempAir*19
$IIXDR,P,1.02481,B,Barometer*29

Status

Measured Value Transducer Type Measured Data Unit of measure Transducer Name
air temperature "C" temperature 2 decimals "C" celsius "TempAir" or "ENV_OUTAIR_T"

Footnotes

  1. NMEA 0183 Sentences » XDR 2

  2. Nmea XDR conventions?

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

At OpenCPN Manual » Engine Dashboard and the Engine Dashboard plug-in for OpenCPN README, I found those example sentences for battery-related values. However, those are meant to be "Battery Voltage" and "Battery Current".

$IIXDR,U,27.5,V,BATTERY#0,U,26.0,V,BATTERY#1*4B
$IIXDR,U,12.50,V,BATTERY#0,I,4.5,A,BATTERY#0*42

@UserMacUseface
Copy link

I suppose these would usually be used to show the house / starter battery values.
However XDR seems to be agnostic regarding these values as they can be defined by the developer.
In this case probably calypso_batt or similar?

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

Other references

None of them tell us about the concept of a "Battery Level", however XDR sentences look very versatile. Can we just make up a custom XDR sentence for that?

Footnotes

  1. Airmar EchoRange™ / EchoRange+™ Technical Manual, p. 11 2

  2. USB100 NMEA 2000® / NMEA 0183 Gateway, p. 26

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

@amotl: Can we just make up a custom XDR sentence for "Battery Level"?

@UserMacUseface: XDR seems to be agnostic regarding these values as they can be defined by the developer.

I see. Thanks.

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

So far, within this conversation, we discovered five types of XDR sentence identifiers already. Does each of them serve a specific purpose? As seen, they have been used for:

  • IIXDR: Air temperature and pressure; Battery
  • OPXDR: Engine temperature and pressure
  • SDXDR: Depth in meters and Sea Water Temperature
  • WIXDR: Air temperature
  • YXXDR: Air temperature

See also SignalK/nmea0183-signalk#54 (comment).

@UserMacUseface
Copy link

The first two letters are the "talker identifier" in our case it can be AN ( for Anemometer ) or CA ( For Calypso ) or ML ( for maritime labs :) )
see also: http://www.nuovamarea.net/blog/general-sentence-format-of-nmea-0183
The rest is designed to be open to send whatever measurement.

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

Thanks for sharing this link, and for explaining the talker identifier. Currently, we are using IIVWR for transmitting the wind measurements.

First, I intended to use WIXDR or YXXDR for temperature values, as others have observed them to be coming from masthead anemometers as well. On the other hand, using ML also sounds nice. Should we adjust IIVWR to MLVWR then as well?

@UserMacUseface
Copy link

ML FTW!

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

On the other hand, would that be any kind of standard?

image

-- Airmar GH2183 GPS/Gyro Compass User Manual » Table 3: NMEA 0183 Transmitted Sentences, p. 72

@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

Proposal

Would those example sentences be feasible?

# Air temperature
$MLXDR,C,42.42,C,AIRTEMP#CAL

# Battery level
$MLXDR,L,0.9,R,BATT#CAL

Note: As I've not been able to find any example which implements the concept of a "battery level in percent", I've made up the L type and the R unit on the "battery" sentence. L means "level" here, and R means "ratio". Do you think this is acceptable?

P.S.: As we can see, there is apparently no way to tell XDR sentences apart, other than looking at the name field, here TEMP vs. BATT. Does this make sense?

@amotl amotl changed the title NMEA0183 sentences for temperature and battery level NMEA0183 XDR sentences for temperature and battery level Feb 24, 2023
@amotl
Copy link
Contributor Author

amotl commented Feb 24, 2023

GH-25 implements the most recent suggestions. Thank you so much for the support!

@amotl
Copy link
Contributor Author

amotl commented Feb 25, 2023

Dear @UserMacUseface,

we just released calypso-anemometer 0.6.0, including the corresponding improvements, and will be happy to hear back from you about its outcome on this matter.

The program will now also emit temperature and battery level on the NMEA-0183 telemetry variant.

With kind regards,
Andreas.

@tvr256
Copy link

tvr256 commented Mar 21, 2023

I'm surprised to see Calypso inventing a completely incorrect and non-standard NMEA sentence.

The XDR format is formally documented in the NMEA 0183 specification. Calypso is registered with the NMEA so you should be following the spec.

The anemometer is marketed as NMEA certified, will you be removing the certification since it doesn't comply?

@amotl
Copy link
Contributor Author

amotl commented Mar 21, 2023

Dear @tvr256,

this software is completely community-based, and not affiliated with Calypso at all. We will happily consider your suggestions on this matter if you think something implemented by this library violates any standard, or if you think the NMEA sentences outlined within this discussion will cause any specific problems when receiving or decoding them.

With kind regards,
Andreas.

@tvr256
Copy link

tvr256 commented Mar 21, 2023

Apologies @amotl , the main page gave me the impression the software was provided by Calypso.

The official NMEA spec can be found fairly easily on Google, I'll post the relevant parts here for your reference.

@tvr256
Copy link

tvr256 commented Mar 21, 2023

Talker ID for an anemometer should be WI (wind instrument) or possibly YX (transducer)

image

@tvr256
Copy link

tvr256 commented Mar 21, 2023

Air temperature should be in the format $WIXDR,C,42.4,C,AIRTEMP#CAL*77 (where *77 is the checksum). The spec mentions one decimal place but I don't know if that's important.

Battery level isn't defined in the spec, so you should use the "generic" type field with null units. So the format should be $WIXDR,G,95.4,,BATT%#CAL*4A or $WIXDR,G,0.95,,BATTLEVEL#CAL*3D.

Also, more than one transducer measurement can be included in a single sentence. So you could send both air temperature and battery level in a single sentence $WIXDR,C,42.4,C,AIRTEMP#CAL,WIXDR,G,95.4,,BATT%#CAL*11.

image

@UserMacUseface
Copy link

Hello,
nice to see that there are more participants in the wind measurement party.
Air temperature will have to be dropped as the official statement from Calypso is that the "secondary" sensors are not supported any more.
So only wind direction, wind speed and battery level can be transferred.
Suggested:
$WIMWV,320,R,15.0,M,A0B
$WIXDR,G,95.4,,BATT%#CAL
11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants