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

[Feature Request]: Reading altitude from NMEA messages not only from the GPS system #1473

Closed
2 of 7 tasks
MariuszTurek-W3media opened this issue Mar 26, 2024 · 1 comment · Fixed by #1490
Closed
2 of 7 tasks
Labels
P2 Important issues not at the top of the work list. platform: android Issue is related to the Android platform. refactor Issues marked with refactor should be considered when refactoring the plugin.

Comments

@MariuszTurek-W3media
Copy link

MariuszTurek-W3media commented Mar 26, 2024

Is there already an issue requesting this feature?

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Use case

In Android we can use useMSLAltitude flag to read altitude from NMEA messages:
https://pub.dev/documentation/geolocator_android/latest/geolocator_android/AndroidSettings/useMSLAltitude.html

The problem is that Geolocator only reads the altitude from the GPS system. In my case, my two Android devices receive messages with ID $GNGGA (instead of $GPGGA), example:
$GNGGA,113733.000,0000.4351,N,00000.7576,E,1,20,0.60,277.7,M,42.0,M,,*7F
and Geolocator does not read altitude from NMEA

Traditionally, the NMEA messages start with $GP, for example the GPS NMEA message GGA starts
with the text: $GPGGA. But because various GNSS tracking systems use different systems instead
of GPS, some NMEA messages change the second text byte. A GLONASS sometimes uses N
instead of P, so a GLONASS GGA message may come out starting with $GNGGA.

https://www.raveon.com/ApplicationNotes/AN246(NMEA_GNSS).pdf
https://openrtk.readthedocs.io/en/latest/communication_port/nmea.html

Here is an example of other Talker ID prefixes (but for a GNS message):
GA: Galileo
GB: BeiDou
GP: GPS
GL: GLONASS. When more than one constellation is used.
GN: Combined GNSS position, for example, GPS and GLONASS.
GQ: QZSS

https://receiverhelp.trimble.com/alloy-gnss/en-us/NMEA-0183messages_GNS.html

Proposal

To solve this problem, just modify the code in two places:

if (message.trim().matches("^\\$..GGA.*$")) {

if (type.matches("^\\$..GGA$") && tokens.length > 9) {

Specific requirements or considerations

No response

Additional information or context

No response

@mvanbeusekom mvanbeusekom added platform: android Issue is related to the Android platform. refactor Issues marked with refactor should be considered when refactoring the plugin. P2 Important issues not at the top of the work list. labels Apr 8, 2024
@Wackymax
Copy link
Contributor

The proposal looks good to me. I think as part of this change we should also let Android handle MSL with the latest version. The new version of Android has MSL built-in as a property on location data meaning we don't need to start a separate NMEA listener

@Wackymax Wackymax mentioned this issue Apr 25, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issues not at the top of the work list. platform: android Issue is related to the Android platform. refactor Issues marked with refactor should be considered when refactoring the plugin.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants