Skip to content

Added support for multi-constellation satellite stats. Fixed SNR reporting bug.#44

Merged
MaJerle merged 9 commits into
MaJerle:developfrom
VaTTeRGeR:develop
Apr 17, 2026
Merged

Added support for multi-constellation satellite stats. Fixed SNR reporting bug.#44
MaJerle merged 9 commits into
MaJerle:developfrom
VaTTeRGeR:develop

Conversation

@VaTTeRGeR

Copy link
Copy Markdown
Contributor

Hello,

i'm currently using your library to parse NMEA from a ublox M10 receiver, which is running at default settings.

I noticed that the number of satellites-in-view vs used-for-positioning satellites is inplausible, when going from an GNSS-denied indoor environment to outdoors: The number of used satellites is intermittently shown to be higher than the number of satellites in view!

I tracked this down to the library not parsing all constellation variants of the G*GSV messages. This clashes with the satellites-in-view value reported by GNGGA, which is for all constellations.

Another issue was the SNR always being reported as 0, even when outdoors with good position and HDoP.
This had to do with GPS multi-band reporting. The multi-band data overwrites the values reported for standard L1 band. The sats_in_view_desc is now cleared only once per NMEA cycle and multi-band/multi-constellation data now handled correctly.

This proposal supports GPS, Galileo, BeiDou and GLONASS and has configurable satellite stats size, with the config option "LWGPS_CFG_SATS_IN_VIEW_SIZE", so the user can track as many satellites as needed.

Regards, Florian.

Adds multi-constallation satellite stats parsing.
Config option "LWGPS_CFG_SATS_IN_VIEW_SIZE" for number of stored satellites in view stats slots.
Comment thread README.md Outdated
* ``GPGSA`` or ``GNGSA``: GPS active satellites and dillusion of position
* ``GPGSV`` or ``GNGSV``: List of satellites in view zone
* ``GPRMC`` or ``GNRMC``: Recommended minimum specific GPS/Transit data
* Built-in support for all-constellation GPS statements

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I prefer we keep the original names. It can be as simpleas GPGGA, G*GGA or GNGGA.

@MaJerle

MaJerle commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Do you have a test to confirm it work properly?

@VaTTeRGeR

VaTTeRGeR commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

Do you have a test to confirm it work properly?

Nope, i just use it currently. It seems to work just fine with simultaneous GPS, Galileo, and GLONASS, but that doesn't prove anything of course.

I have now captured a bit of multi-constellation NMEA output from my M10 receiver, plus stats printout:
m10-nmea-output.txt
(position is redacted, only sats with SNR>0 are printed)

I currently don't use lwgps with the original build system, and thus can't just run the tests without first setting it up just for this purpose, which i don't have the time and nerve for right now.

I offer you these fixes as a reference, you may use them without crediting me if it's worth integrating it. I don't mind.

Have a nice sunday!

@MaJerle

MaJerle commented Apr 12, 2026

Copy link
Copy Markdown
Owner

you don't need to build anything on your side in fact. If you enlarge the test suite with the data that show what you wanted to achieve, the Github will run it for us, and we'll see the outcome quickly.

I'll sure merge, please make the change as I requested in the review.

Changed NMEA message list style
Forgot to upload the changed header. Ooops.
@VaTTeRGeR

Copy link
Copy Markdown
Contributor Author

Hey, i tried out the github actions as you suggested.

My forked repo passes the unmodified test suite now. I'll try and add a test case with the multi-constellation NMEA when i come around to it :-)

@MaJerle MaJerle left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for last minute feedback, I just noticed.

Comment thread lwgps/src/include/lwgps/lwgps.h Outdated
typedef struct {
uint8_t num; /*!< Satellite number */
uint8_t elevation; /*!< Elevation value */
uint16_t num; /*!< Satellite number */

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the satellite number go beyond 255?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. This also gives better struct packing.

Comment thread lwgps/src/include/lwgps/lwgps.h Outdated
#include <stddef.h>
#include <stdint.h>
#include "lwgps/lwgps_opt.h"
#include "lwgps_opt.h"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The normal library rule, the way instructions and cmake build is configured is that the include path is set to /src/include folder, forcing the compiler and developer to use the /lwgps/lwgps_xxxxx.h during use.

The same shall remain for the library. The previous way was the correct one. Please return back and then I think we are ready to merge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@MaJerle

MaJerle commented Apr 13, 2026

Copy link
Copy Markdown
Owner

My forked repo passes the unmodified test suite now. I'll try and add a test case with the multi-constellation NMEA when i come around to it :-)

There is no test cases for multi constellation NMEA available publicly that can be used to test against?

Reverted to correct include path.
Reverted back to uint8_t satellite prn.
Reverted back to uint8_t satellite prn.
@MaJerle MaJerle merged commit f1ed493 into MaJerle:develop Apr 17, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants