Skip to content

[Feature Request] Enhanced support for UBX-CFG-GNSS (to allow Galileo configuration on M8) #237

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

Open
jan5650 opened this issue May 7, 2025 · 10 comments

Comments

@jan5650
Copy link

jan5650 commented May 7, 2025

Hi!

I'm using Neo M8N GPS module with the code below, but unfortunately I can only see 25-26 satellites max.
Am I doing something wrong?
I want to use GPS+GLONASS+GALILEO at the same time.

at startup in setup block I check what baud number it is operating on (factory 9600 or already modified) and then I turn on the necessary satellite monitoring and change it so that no NMEA message comes but UBX

#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
SFE_UBLOX_GNSS myGNSS;
#define mySerial Serial1


void setup() {
do {
    mySerial.begin(38400);
    if (myGNSS.begin(mySerial) == true) break;
    delay(100);
    mySerial.begin(9600);
    if (myGNSS.begin(mySerial) == true) {
      myGNSS.setSerialRate(38400);
      delay(100);
    } else {
      delay(100);
    }
  } while (1);

  myGNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GPS);
  myGNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GALILEO);
  myGNSS.enableGNSS(true, SFE_UBLOX_GNSS_ID_GLONASS);
  myGNSS.enableGNSS(false, SFE_UBLOX_GNSS_ID_BEIDOU);

  myGNSS.setUART1Output(COM_TYPE_UBX);
  myGNSS.setI2COutput(COM_TYPE_UBX);

  myGNSS.setMeasurementRate(200);
  myGNSS.setNavigationRate(1);
  myGNSS.setAutoPVTrate(1);
  myGNSS.saveConfiguration();
@PaulZC
Copy link
Collaborator

PaulZC commented May 7, 2025

Hi @jan5650 ,

The M8 only supports 3 GNSS concurrently. My advice would be to try disabling BeiDou first, then enable Galileo.

Please be aware that - in this library - enableGNSS is a little primitive. It only allows you to set the enable bit for each constellation. It doesn't allow you to change resTrkCh, maxTrkCh, or the sigCfgMask flags. For best results, you may need to use u-center to configure UBX-CFG-GNSS, and then use UBX-CFG-CFG to save the configuration to BBR+Flash. Be careful that your Arduino code doesn't then overwrite the configuration when it restarts.

I hope this helps,
Paul

@PaulZC
Copy link
Collaborator

PaulZC commented May 7, 2025

Also, just for reference, here are the notes from the Interface Description for UBX-CFG-GNSS:

Configuration requirements:
• It is necessary for at least one major GNSS to be enabled, after applying the new configuration to the current one.
• It is also required that at least 4 tracking channels are available to each enabled major GNSS, i.e. maxTrkCh must have a minimum value of 4 for each enabled major GNSS.
• The number of tracking channels in use must not exceed the number of tracking channels available in hardware, and the sum of all reserved tracking channels needs to be less than or equal to the number of tracking channels in use.

Notes:
• To avoid cross-correlation issues, it is recommended that GPS and QZSS are always both enabled or both disabled.
• Polling this message returns the configuration of all supported GNSS, whether enabled or not; it may also include GNSS unsupported by the particular product, but in such cases the enable flag will always be unset.
• See section GNSS Configuration for a discussion of the use of this message.
• See section Satellite Numbering for a description of the GNSS IDs available.
• Applying the GNSS system configuration takes some time. After issuing UBX-CFG-GNSS, wait first for the acknowledgement from the receiver and then 0.5 seconds before sending the next command.
• If Galileo is enabled, UBX-CFG-GNSS must be followed by UBX-CFG-CFG to save current configuration to BBR and then by UBX-CFG-RST with resetMode set to Hardware reset.
• Configuration specific to the GNSS system can be done via other messages (e.g. UBX-CFG-SBAS).

@jan5650
Copy link
Author

jan5650 commented May 8, 2025

Thank you very much for your quick and detailed reply.
Unfortunately I don't understand most of it, I don't know exactly which commands I should use and with which parameters.

I don't want to use U-centers, I want the arduino to load the config I have invented every time it starts. If you could kindly add the following to my code:

  • 5 Mhz sampling
  • GPS, GLONASS, Galielo activate and use.
  • SBAS enable and use (do I need QZSS too?)
  • Use master for Galileo
  • Insert the necessary pauses between the configuration commands and wait for the confirmation message
  • The device supports 32 channels, distribute them in a reasonable way
  • Save the settings and restart the device, and wait for the rest of the program to start

If some of this is not possible with the libraries, leave it out, but I'd like to know how to solve most of it.

Thank you very much!

@PaulZC
Copy link
Collaborator

PaulZC commented May 8, 2025

Hi @jan5650 ,

OK. I understand. Please be aware that this will involve writing a lot of new code: a method to read and return the full UBX-CFG-GNSS message; a method to read and/or modify the settings for each GNSS; a method to write the modified settings to the module. This is possible, but it will take time.

Best wishes,
Paul

@PaulZC PaulZC changed the title GPS count [Feature Request] Enhanced support for UBX-CFG-GNSS (to allow Galileo configuration on M8) May 8, 2025
@jan5650
Copy link
Author

jan5650 commented May 8, 2025

of course I'll wait if you're so kind as to write an example.

Thank you very much!

@PaulZC
Copy link
Collaborator

PaulZC commented May 8, 2025

Hi @jan5650 ,

OK. Thank you.

Going back to your original question: "I can only see 25-26 satellites max.". Please tell me what you mean by "see". Is this the "#SVs Used" in the NAV-PVT message? "#SVs Used" is the number of satellite signals used to calculate the position solution. It is not the same as the number of "Satellites In View". That number will be much higher.

Just for information, here is what I see with u-center and the NEO-M8U (not -M8N). The Galileo satellites are shown as "E".

Image

Image

Image

Image

Image

Image

Setting the NMEA Version 4.10 is important. This allows the Galileo signals to be reported in GNGSA NMEA sentences.

Best,
Paul

@jan5650
Copy link
Author

jan5650 commented May 8, 2025

I used this method to see, how many satelites are in view...

satelites = myGNSS.getSIV();

The Sateliltes variable shown max 25-26 satellites.

I know that NMEA 4.10 need for Galileo, but i dont use NMEA messages, only uses UBX. In this way i need to set NMEA 4.10 too ? If needed, then i want to do it from arduino too... I cannot use U-center

@PaulZC
Copy link
Collaborator

PaulZC commented May 8, 2025

Ah. OK. Thank you.

getSIV does report the numSV from the UBX-NAV-PVT message. numSV ("#SVs Used") is the number of satellites used to calculate the position solution. It is not the same as the traditional "Satellites In View" from old GNSS receivers. Strictly, getSIV should be renamed getSVsInSolution, but we named it getSIV for backward compatibility. If getSIV is returning 25-26, all is well.

This library does not currently support changing the NMEA protocol version (UBX-CFG-NMEA). I will add that when I add improved support for UBX-CFG-GNSS.

I will leave this request open. But it sounds like everything is working for you.

Best,
Paul

@jan5650
Copy link
Author

jan5650 commented May 8, 2025

Okey

But with the code linked above, do I using Galileo or not? Because unfortunately I don't see what I can see with this Arduino module, only that there are 25-26 of them

@PaulZC
Copy link
Collaborator

PaulZC commented May 8, 2025

You need to use UBX-NAV-SAT. The svUsed flag will tell you which SVs are used in the solution. In u-center, svUsed is labelled Nav:

Image

This library supports UBX-NAV-SAT. Please see this example. You will need to add extra code to print svUsed for each SV. Please try:

    Serial.print(ubxDataStruct->blocks[block].svId); // Print the SV ID
    
    if (ubxDataStruct->blocks[block].svId < 10) Serial.print(F("   "));
    else if (ubxDataStruct->blocks[block].svId < 100) Serial.print(F("  "));
    else Serial.print(F(" "));

    // Print svUsed (SV used for navigation solution)
    if (ubxDataStruct->blocks[block].flags.bits.svUsed)
      Serial.print(F("Y "));
    else
      Serial.print(F("N "));

    // Print the signal strength as a bar chart
    for (uint8_t cno = 0; cno < ubxDataStruct->blocks[block].cno; cno++)
      Serial.print(F("="));

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

No branches or pull requests

2 participants