Closed askpatrickw closed 4 years ago
Sleep and many print statements can do wondrous things... lengthy exploration and explanation follows:
This is what _mixhash
sees for an RMC mesage:
keywords: ['NMEA', 'UTCTime', 'dataValid', 'Latitude', 'NS', 'Longitude',
'EW', 'Speed', 'COG', 'Date', '', '', 'PositioningMode']
len(keywords): 13
sentence: ['RMC', '181820.000', 'A', '4737.1629', 'N', '12221.2071', 'W', '0.00',
'118.29', '190320', '', '', 'A', 'V']
len(sentence): 14
In _mixhash()
the sentence is padded (+= ['',] ) if it is shorter than the keywords, but the case where the sentence is longer is not handled and so keywords and sentence are never the same length and RMC messages fall through to the final else which returns None.
What appears to be the issue is that the keywords for _RMC()
is missing NavigationalStatus
. Which is listed on page 9 of Quectel_L76_Series_GNSS_Protocol_Specification_V3.3.pdf. and it also notes this message attribute is "Only supported for NMEA V4.10".
Also in the specification it says:
"Please note that L76NR03A01S version of L76 and L76LNR02A01S version of L76-L use NMEA V4.10. It will change the format of RMC, GSA and GSV sentences."
My Quectel Chip does not have the full model number stamped on it, but I see NMEA 4.10 data so therefore I'm assuming that's the case. It is worth following up with Pycom to see if ALL the Quectel chips on their boards. I cannot post to their forum. I pinged them on Twitter and will update if\when I get a response.
NavigationalStatus
to _RMC() keywords list as per page 9 in spec.GNSSSystemId
to _GSA() keywords list as per page 13 in spec.SignalId
to _GSV() keywords list as per page page 15 in spec.PR to come...
Attaching the Quectel L76-L GNS Protocol Spec v3.3. This should probably go in the repo or wiki?
Hi Patrick. The gps chip I have on my board is L76LNR01A01SC, way older than yours. The spec I found back then was even v1.5. There was no NavigationalStatus back then. I try to find some time to add wiki with links to the original pdf's. If you have a fix, I will gladly look at it.. Andre
Hi Patrick I've changed your fix a bit to make it work on older versions to. Can you test it? it's in the fixfor4.10 branch. best regard André
I’ll look at this and let you know.
I'm learning the library and I may be making mistakes so please to point me in the right direction if I'm wrong. It seems as though no RMC based functionality is working, but I see RMC messages in the debug output.
See in this log stream that I ask for an RMC message and none is found, but there is one in the log.
I spent a good hour looking at
_RMC()
in the library and couldn't see anything wrong. When I take the message from the logs:msg = ['RMC', '070803.000', 'A', '4737.0000', 'N', '12220.0000', 'W', '0.00', '87.63', '190320', '', '', 'A', 'V']
and the keywords in the function and rundict(zip(keywords, msg))
as in_mixhash()
, I get a perfectly formatted DICT so I'm stumped.This seems to be breaking the following functionality all of which simply run indefinitely:
L76.gps_message('RMC')
L76.getUTCDateTime()
L76.getUTCDateTimeTuple()
If you can point the way, I'm happy to do a PR and test the fix. tx!