Closed lesamouraipourpre closed 3 years ago
I've switched this from Draft as I have a list of further improvements that I intend to work on for GPS.
What device did you test this code on? Was it running Blinka or CircuitPython? I see the example has f-strings and I want to makes sure this was tested on CircuitPython.
It as developed on a Raspberry Pi 3, but tested on a PyPortal Pynt and an Unexpected Maker FeatherS2 both running CP 6.2 beta.
Ok, great! Thank you!
This PR aims to get GSA and GSV message parsing operational. This will hopefully close #51 and #52.
For the talkers #52: In the update() method the
data_type
is now split into:talker
(first two characters) andsentence_type
(remaining three characters) Thetalker
is the source of the message. For now, I've only listed the GNSS sources, eg. GA (Galileo), GB (BeiDou) etc. NB: GN as a talker means the information is from more than one source. Thesentence_type
is the sentence type of the message. Eg. GLL (Geographic Position - Lat/Long), GSV (Satellites in View) etc. Separating these out makes it easier to add extratalker
s andsentence_type
s later if needed.For GSA and GSV #51: This has been reworked with the aim of handling messages from multiple sources, for example I receive sentences from GPS and GLONASS. Unlike some
sentence_type
s, I've never received GN (multi-source information) messages for GSA and GSV, they are always from a single satellite network. The satellite information that is stored in theself.sats
dictionary has been modified to have a key based on the source of the information, eg. GP17 for GPS satellite 17, GL78 for GLONNASS satellite etc. The value stored is now a 5-value tuple: (Key/Satellite ID, Elevation, Azimuth, SNR, Timestamp) The timestamp is thetime.monotonic()
that the information was received. This will be used to delete any entries which are older than 30 seconds.Hardware tested: I have the Adafruit Mini GPS PA1010D - UART and I2C - STEMMA QT
Example Code: There is an example in
examples/gps_satellitefix.py
This is listed as draft because it needs more testing, preferably with different GPS chips. I would appreciate if others are able to run this and see what breaks. Also, any feedback on whether the changes made are appropriate or need further work are greatly appreciated.