loginov-rocks / UbxGps

Arduino library for the fastest and simplest communication with u-blox GPS modules
https://registry.platformio.org/libraries/loginov-rocks/UbxGps
MIT License
140 stars 44 forks source link

Empty data in console #30

Open brightproject opened 9 months ago

brightproject commented 9 months ago

Good afternoon @loginov-rocks I'm trying to run the library with an example for the neo-6m module. But nothing is output to the serial port. Please tell me, have you tried running the library with such an ancient and godforsaken module as NEO-6M? Perhaps the problem is related to the NEO-6M module itself, but perhaps also to the version of the UBX protocol in it ... perhaps the version is outdated, the module shows through the u-center software 7.03 (45969). First, I configure the module through the u-center at 5 Hz (tried it at 10 Hz). RATE_10HZ

Although according to the datasheet for NEO-6M NEO-6M

up to 1 Hz is possible and the y-center highlights the field in red, in the binary console there is a noticeable change in the output speed, but on the module itself the red LED always blinks with the same frequency - 1 Hz. I also disabled all NMEA and UBX messages and enabled only three: VEDNED, POSLLH, SOL. NAV_message_ON

Code, upload to stm32f411

#include <UbxGpsNavPvt.h>

#define BAUDRATE 115200
#define GPS_BAUDRATE 115200

HardwareSerial Serial2(USART2); // PA2(TX2), PA3(RX2)

UbxGpsNavPvt<HardwareSerial> gps(Serial2);

void setup()
{
    Serial.begin(BAUDRATE);
    gps.begin(GPS_BAUDRATE);
}

void loop()
{
    if (gps.ready())
    {
        Serial.print(datetime);
        Serial.print(',');
        Serial.print(gps.lon / 10000000.0, 7);
        Serial.print(',');
        Serial.print(gps.lat / 10000000.0, 7);
        Serial.print(',');
        Serial.print(gps.height / 1000.0, 3);
        Serial.print(',');
        Serial.print(gps.gSpeed * 0.0036, 5);
        Serial.print(',');
        Serial.print(gps.heading / 100000.0, 5);
        Serial.print(',');
        Serial.print(gps.fixType);
        Serial.print(',');
        Serial.println(gps.numSV);
    }
}

Compile OK compile There is peace and quiet in the port ... None of the existing libraries want to work with this module. I can only read data from the module using a self-written parser, but the parser has a drawback - it does not work if a delay is added to the parser code, even 10 ms, and the messages are no longer parsed. Therefore, I want to make the module work with normal UBX parsing libraries.