sparkfun / sparkfun/SparkFun_LG290P_GNSS_Arduino_Library
Unexpected behaviour of ensureEnabled within update
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 4
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
I'm writing a new example to test RTCM generation in Rover mode - specifically to test 1230 generation with v2.02 firmware
My loop() is simply:
void loop()
{
myGNSS.update(); // Process bytes as they arrive from LG290P. Call rtcmCallback as needed
}
I have called myGNSS.rtcmSubscribeAll(rtcmCallback) to set up the callback for RTCM
update processes incoming RTCM and calls rtcmCallback as needed
update sets lg290PLibrarySemaphoreBlock true
In code below rtcmCallback, I want to use the GNSS time, which I get using myGNSS.getHour() etc.
getHour() ensures the PQTMPVT message is enabled by calling ensurePvtEnabled()
ensurePvtEnabled() calls ensureMsgEnabled to enable "PQTMPVT" if needed
ensureMsgEnabled calls setMessageRate
setMessageRate calls sendOkCommand to enable the PVT message
sendOkCommand calls sendCommand
sendCommand exits early because lg290PLibrarySemaphoreBlock is true because we are still inside update()
Long story short, PVT is never enabled and getHour etc. return zero
I'm still thinking about possible solutions...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/SparkFun_LG290P_GNSS.cpp at the linked sendCommand lines, then trace update(), rtcmCallback, ensurePvtEnabled(), ensureMsgEnabled(), setMessageRate(), and sendOkCommand(). Reproduce the Rover-mode RTCM 1230 example with v2.02 firmware and verify that getHour() and related time accessors return GNSS time while the callback runs during update().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100