Skip to content

Missing callbacks for NMEA messages #38

@Benik3

Description

@Benik3

Subject of the issue

Callbacks (which can be set for e.g. NMEA GGA messages) are called only once, even that buffer on serial line contained more messages.

Your workbench

Wemos D1 mini ESP32 (ESP-WROOM-32)
GPS Beitian BK-280 (Ublox M9)
Connected using ESP Serial2 port. Now powered by USB.

Steps to reproduce

uint32_t tstcounter = 0;

void callbackGPGGA(NMEA_GGA_data_t *nmeaData)
{
    tstcounter++;
}

void setup()
{
    Serial.begin(115200);
    delay(1000);

    Serial2.setRxBufferSize(4096);
    Serial2.begin(115200); // GPIO Rx 16, Tx 17

    while (myGNSS.begin(Serial2) == false) // Connect to the u-blox module
    {
        Serial.println(F("u-blox GNSS not detected"));

        Serial.println(F("Retrying..."));
        delay(1000);
    }

    myGNSS.setNMEAGPGGAcallbackPtr(&callbackGPGGA); // register callback for GGA NMEA message
}

void loop()
{
    if (Serial2.available() > 2000) 
    {
        tstcounter = 0;
        myGNSS.checkUblox();
        myGNSS.checkCallbacks();
        Serial.printf("Callback was called: %d times\n", tstcounter);
    }
}

Expected behavior

Callback should be called for each received NMEA message. Also I would expect that check for callback is made inside the library (when doing reading and parsing during e.g. checkUblox or getPVT)

Actual behavior

The code above will always report 1 time of callback call, even that Serial buffer contain around 20 GGA messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions