C030-R412m: Ublox GNSS lib don't work!

Hi!

I’m trying this Ublox GNSS library example but it does not work!

if (gnss.init()) on line 46 still return false. But if I use a simple program that reads the raw serial from the GNSS I get real data.

Any idea? @fahimalavi @RobMeades

Mbed OS: 5.15.7

Hi there. I’m not directly involved in this anymore but my understanding is that you are using very old version in gnss.lib. Can you make it later version and try ?
From : gnss - This class provides an API to communicate with a … | Mbed
To : gnss - This class provides an API to communicate with a … | Mbed d6a65d4c902a

I have copied the example code in a fresh Mbed Studio program and also imported the latest GNSS library. So, the gnss.init() fails with latest library.

From my point of view, it is an issue related to the serial pipe of the GNSS library. The GNSS module is only powered on if I power it on manually with:

DigitalInOut gnssen(GNSSEN, PIN_OUTPUT, PushPullNoPull, 0);
gnssen.write(1);
thread_sleep_for(500);

GnssSerial gnss;
if (gnss.init()) { ... } // but init fails...

Here my output. After this three lines no more prints to serial monitor:

Waiting for GNSS to receive something...
NMEA: $GNTXT,01,01,02,u-blox AG - www.u-blox.com*4E
NMEA: $GNTXT

Another thing what I don’t understand is, why in the lib baudrate is set baud(115200); on line 661 of file gnss.cppgnss | Mbed

Sorry if I mark the Ublox members. But I need really help and a working Ublox GNSS library.

I use Mbed OS 5.15.7 for my program. I develop my program with Mbed Studio under a Linux OS. The latest GNSS library is installed and the example GNSS program is used to test the GNSS lib.

@MarceloSalazar @fahimalavi @andreaslarsson @bqam

Any help is very appreciated!

If I comment line enable_ubx(); in gnss.cpp library I get the following output:

Waiting for GNSS to receive something...
NMEA: $GNTXT,01,01,02,u-blox AG - www.u-blox.com*4E
NMEA: $GNTXT,01,01,02,HW UBX-M8030 00080000*60
NMEA: $GNTXT,01,01,02,ROM CORE 3.51 (19dc23)*2E
NMEA: $GNTXT,01,01,02,FWVER=SPG 3.51*43
NMEA: $GNTXT,01,01,02,PROTVER=23.01*18
NMEA: $GNTXT,01,01,02,GPS;GLO;GAL;BDS*77
NMEA: $GNTXT,01,01,02,SBAS;IMES;QZSS*49
NMEA: $GNTXT,01,01,02,GNSS OTP=GPS;GLO*37
NMEA: $GNTXT,01,01,02,LLC=FFFFFFFF-FFFFFFEB-FFFFFFFF-FFFFFFFF-FFFFFF7D*59
NMEA: $GNTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*3E
NMEA: $GNTXT,01,01,02,ANTSTATUS=DONTKNOW*2D
NMEA: $GNTXT,01,01,02,PF=3FF*4B
NMEA: $GNRMC,115946.40,V,,,,,
NMEA: 
NMEA: 
NMEA: 
NMEA: 
NMEA: 
NMEA: 
NMEA: 
... endless empty NMEA lines.

What does enable_ubx function? I see this UBX config but what does this config?

unsigned char ubx_cfg_prt[]= {0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,0x00, 0x00};

sendUbx(0x06, 0x00, ubx_cfg_prt, sizeof(ubx_cfg_prt))

You can see all the types of binary messages here: https://www.u-blox.com/en/ubx-viewer/view/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221?url=https%3A%2F%2Fwww.u-blox.com%2Fsites%2Fdefault%2Ffiles%2Fproducts%2Fdocuments%2Fu-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf

Look at Section 32.10.25, UBX-CFG-PRT, which describes the message being sent. You can use that table to decode the binary message in the function. If I had to guess, based on that name, the function is disabling NMEA and enabling the binary UBX protocol.

1 Like

Thank you so much! It is a step forward. I understand the Header, Class and ID. But what about the config payload? It has 20 hex values. How should I map this values with the tables in the documentation?

unsigned char ubx_cfg_prt[]= {
    0x01,                   // Port 1
    0x00,                   // Reserved 0
    0x00, 0x00,             // txReady, no idea how this is made.
    0xD0, 0x08, 0x00, 0x00, // mode, no idea how this is made.
    0x00, 0xC2, 0x01, 0x00, // baud 115200
    0x01, 0x00,             // inProtoMask, no idea how this is made.
    0x01, 0x00,             // outProtoMask , no idea how this is made.
    0x00, 0x00,             // flags
    0x00, 0x00              // reserved
};

What I found out for the moment is the following:

In GNSS lib file gnss.cpp around line 657 I have removed enable_ubx(); and baud(115200);. After that all works perfectly.

What does this code?

So, enable_ubx() sends a config to the ZOE-M8B to set baud rate 115200. After that baud(115200) upgrades the baud rate of the actual serial connection to 115200.

What is the problem?

After change the baud rate on the Ublox ZOE-M8B chip and upgrade the baud rate on the actual serial connection, no more data comes from the chip.

The init routine in the example code finishes (I have removed the if around, so that the code can continue).

Waiting for GNSS to receive something...
NMEA: $GNTXT,01,01,02,u-blox AG - www.u-blox.com*4E
NMEA: $GNTXT,01,01,02,HW UBX-M8030 00080000*60
NMEA: $GNTXT,01,01,02,ROM CORE 3.51 (19dc23)*2E
NMEA: $GNTXT,01,01,02,FWVER=SPG 3.51*43
NMEA: $GNTXT,01,01,02,PROTVER=23.01*18
NMEA: $GNTXT,01,01,02,GPS;GLO;GAL;BDS*77
NMEA: $GNTXT,01,01,02,SBAS;IMES;QZSS*49
NMEA: $GNTXT,01,01,02,GNSS OTP=GPS;GLO*37
NMEA: $GNTXT,01,01,02,LLC=FFFFFFFF-FFFFFFEB-FFFFFFFF-FFFFFFFF-FFFFFF7D*59
NMEA: $GNTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*3E
NMEA: $GNTXT,01,01,02,ANTSTATUS=DONTKNOW*2D
NMEA: $GNTXT,01,01,02,PF=3FF*4B
// NO MORE OUTPUT HERE!

Any idea what can be the problem? Can someone help me to decode the ubx_cfg_prt[] config to understand if it is right?

Bug resolved!

The UBX configuration is not correct. Here the working one:

unsigned char ubx_cfg_prt[]= {
        0x01,                   // Port - 1
        0x00,                   // Reserved - 0
        0x00, 0x00,             // txReady - thres 0, pin 0, pol 0, en 0
        0xC0, 0x08, 0x00, 0x00, // mode - 1 stop bit, no parity, 8 bit
        0x00, 0xC2, 0x01, 0x00, // baud - 115200
        0x23, 0x00,             // inProtoMask - Ubx, Nmea, Rtcm3
        0x03, 0x00,             // outProtoMask - Ubx, Nmea
        0x00, 0x00,             // flags
        0x00, 0x00              // reserved
};

This code is a rework and adapted for the Ublox C030-R412m board: GitHub - phlegx/gnss: GNSS library for Ublox C030-412m board with ZOE-M8B chip.

1 Like

if you would like to use UBX protocol over I2C i wrote an async lib GitHub - pilotak/UbxGpsI2C: Ublox GPS I2C async library for mbed

1 Like