Closed
Description
Trying to read data from NAV-ORB
I´m using the M9N breakout board and want to know if enough ephemeris data is downloaded for a fast startup after a power down. UBX-NAV-ORB is described in the M9N Interface description in 3.15.7.
My workbench
- Sparkfun 15712 M9N
- I2C connection to Arduino MKR1310
- External Battery on 5V pin
Expected behavior
At the end, I want to be able to evaluate whether enough data has been downloaded to achieve a quick fix (after a power cut). To do this, I need to read the data from UBX-NAV-ORB. Or is there a better way?
Actual behavior
At the moment it is not possible to read out whether enough data has been downloaded for a hot/warm start or not.
Metadata
Metadata
Assignees
Labels
No labels
Activity
PaulZC commentedon Jul 13, 2021
Hi @JMyrng ,
I haven't tried this, but using UBX-NAV-ORB sounds like a sensible approach. The library does not currently support UBX-NAV-ORB directly and there is no data struct defined for it. However, you will be able to read the UBX-NAV-ORB data using a custom packet.
Please see Example21. Example21 uses a custom packet to read the version information from the module. You will need to create a custom packet with a payload size of at least 8 + (the maximum numSv's being tracked * 6) bytes. Set customCfg.cls = UBX_CLASS_NAV; . Set customCfg.id = UBX_NAV_ORB; .
You will need to manually parse the data yourself and - I guess - look at how many sv's have 'good' ephUsability?
Best wishes,
Paul
JMyrng commentedon Jul 14, 2021
Hi @PaulZC ,
thanks for your great hint! I´ve followed that path and used this code:
Running this leads me to this error with debugging enabled:
The payload size is correct:
How can I increase the maximum buffer size?
JMyrng commentedon Jul 14, 2021
Hope nobody has read my wall of text.
Inserting
myGNSS.setPacketCfgPayloadSize(768);
has solved my issue. But shouldn't that then also be in example 21?
And a big +1 for such a great debugging tool!!
PaulZC commentedon Jul 14, 2021
Hi @JMyrng ,
Glad that's working for you!
There is a 'weakness' in the code which I know about but haven't yet got around to fixing:
SparkFun_u-blox_GNSS_Arduino_Library/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
Lines 1607 to 1609 in 46c1855
The work-around is indeed to increase the packetCfg payload size to the same size as your custom packet. But this is wasteful in terms of RAM use because packetCfg is not actually being used, the incoming data is being written directly into the custom packet as it arrives.
Please leave this issue open - it is a good reminder for me to fix the weakness!
Very best wishes,
Paul
PaulZC commentedon Jul 14, 2021
Indeed, yes, Example21 will throw the same error if the module returns more than 256 bytes of version information.
Thanks!
Paul
PaulZC commentedon Aug 7, 2021
Corrected in v2.0.10 - #55