Reading Speed & Sats from NEO-M9N, SMA (Qwiic) stalls 500ms

I’ve recently purchased the SparkFun GPS Breakout - NEO-M9N, SMA (Qwiic) SparkFun_u-blox_GNSS_Arduino_Library.

I’m using a Mega 2560. I’m only calling begin() in setup() then in loop() I call getGroundSpeed() and getSIV() and loop will stall 500ms. I only need the current ground speed and number of sats but I need it to return within 20ms if possible. Is there a setting or a different library I can use to strip down the delay?

Thanks!

Hi @fordfanboi,

Unfortunately the GNSS modules do not work that way. They calculate position once per second (unless you change the navigation rate). The stall could be up to one second depending on when you request the position.

You can use the “auto” feature in the u-blox library. This will return data immediately, but it might be ‘stale’ by up to one second. Please see:

https://github.com/sparkfun/SparkFun_u- … utoPVT.ino

Paul

Thanks so much! The call returns much faster now and I’m able to get 10 different speed samples per second with just the following.

GPS.setI2COutput(COM_TYPE_UBX);

GPS.setNavigationFrequency(10);

GPS.setAutoPVT(true);

Glad that’s working for you. You might find this code useful too:

https://github.com/sparkfun/SparkFun_u- … #L147-L156

PaulZC:
Glad that’s working for you. You might find this code useful too:

https://github.com/sparkfun/SparkFun_u- … #L147-L156

Awesome - thanks again!