Need help with understanding a configuration option NAV-TIMEGPS in UBX

0 votes

Hello, I'm trying to fix some software that is used in a LoRa application.  It appears that it is trying to enable some UBX messages, but they apparently aren't geing generated by the ublox 7 receiver, over a serial connection.  Trying to wrap my head around this, it appears that the code is sending a CFG-MSG command with an embedded (0x01, 0x20) command string.  I've looked through the protocol docs, Google and even the archive here before resorting to bothering the experts here.  Is this command correctly formatted?  I do not know if the GPS receiver is generating an ACK, because the code currently doesn't bother checking.  I intend to fix that, along with some other things such as generating the checksum instead of it being hard-coded into the string.  It's also currently generating NMEA messages that should be disabled since they are being ignored and the serial port is only at 9600 baud.  

The ublox documentation seems to imply that UBX messages should be coming by default, but none are being detected by the software currently.  The GPS receiver is embedded onto a piece of factory fresh hardware, so should be in it's default configuration.  This is the only message being sent to the GPS module.  I'm thinking that I should modify the code to reset the module, turn off the NMEA messages I don't need and then enable the UBX messages that I do need, all the while checking for ACK/NACK responses.  I may also increase the baud rate.  I didn't write this code, but because of a warning message in the system logs, it's become an obsession to fix it correctly.  Thanks for reading this far.  ;)

    uint8_t ubx_cmd_timegps[UBX_MSG_NAVTIMEGPS_LEN] = {
                    0xB5, 0x62, /* UBX Sync Chars */
                    0x06, 0x01, /* CFG-MSG Class/ID */
                    0x08, 0x00, /* Payload length */
                    0x01, 0x20, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, /* Enable NAV-TIMEGPS output on serial */
                    0x32, 0x94 }; /* Checksum */


Here is the command being sent to the GPS module:


    /* Send UBX CFG NAV-TIMEGPS message to tell GPS module to output native GPS time */
    /* This is a binary message, serial port has to be properly configured to handle this */
    num_written = write (gps_tty_dev, ubx_cmd_timegps, UBX_MSG_NAVTIMEGPS_LEN);
    if (num_written != UBX_MSG_NAVTIMEGPS_LEN) {
        DEBUG_MSG("ERROR: Failed to write on serial port (written=%d)\n", (int) num_written);
    }

 

by afremont asked Jan 10
31 views
0 votes
No UBX are output by default, you have to explicitly enable them, you can use UBX-CFG-CFG to save settings to Battery RAM.

If the checksum is wrong the packets will be ignored, you'll get the NAK if one of the parameters is wrong.

I would probably use the following form for the payload as the part doesn't have a second UART

0x01, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,

The older manual is probably less cluttered  https://www.u-blox.com/sites/default/files/products/documents/u-blox7-V14_ReceiverDescriptionProtocolSpec_%28GPS.G7-SW-12001%29_Public.pdf
by clive1 answered Jan 10
website banner