Implement GSV and GSA parsing#54
Merged
tannewt merged 6 commits intoadafruit:masterfrom Feb 23, 2021
lesamouraipourpre:parse-gsa-and-gsv
Merged
Implement GSV and GSA parsing#54tannewt merged 6 commits intoadafruit:masterfrom lesamouraipourpre:parse-gsa-and-gsv
tannewt merged 6 commits intoadafruit:masterfrom
lesamouraipourpre:parse-gsa-and-gsv
Conversation
Enable GSV (satellites in view) parsing. Rewrote the GSA and GSV parsing to handle each satellite system (talker) separately. - self.sats now uses keys based upon the talker and satellite number, eg. GL67 for GLONASS #67, GP7 for GPS #7 - When the end message of a GSV sequence is received, eg. 3 of 3, all previous records in self.sats matching that talker are removed before adding the updated ones. - self.sat_prns stores the last satellite IDs that were used for a fix and returned in the most recent GSA sentence. They will be from only one Satellite system and should have a record in self.sats .
to when it was received.
The data stored in self.sats dictionary is:
key is TTNN where
TT = the talker name, eg. GL for GLONASS
NN = the number of the satellite, currently a 1 or 2 digit number
value is a 5 entry list (V0, V1, V2, V3, V4)
V0 = satellite number TTNN as used for the key
V1 = satellite elevation in degrees
V2 = satellite azimuth in degrees
V3 = satellite signal to noise ratio in dB, or None
V4 = timestamp, time.monotonic(), of last GSV message
tannewt
approved these changes
Feb 18, 2021
Member
tannewt
left a comment
There was a problem hiding this comment.
I didn't test but the code looks good! I like that you split the talker out. I didn't know that was the format. :-) Thanks!
Contributor
Author
|
I've switched this from Draft as I have a list of further improvements that I intend to work on for GPS. |
Member
|
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. |
Contributor
Author
|
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. |
Member
|
Ok, great! Thank you! |
adafruit-adabot
added a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Feb 26, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS18X20 to 1.3.4 from 1.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_DS18X20#21 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.8.0 from 2.7.2: > Merge pull request adafruit/Adafruit_CircuitPython_EPD#45 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.7.0 from 3.6.8: > Merge pull request adafruit/Adafruit_CircuitPython_GPS#54 from lesamouraipourpre/parse-gsa-and-gsv Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.10.6 from 3.10.5: > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#90 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.11.0 from 2.10.2: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#57 from adamcandy/add-page-addressing-mode Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.5.2 from 1.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#27 from FoamyGuy/resizeable_button Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.15.0 from 2.14.0: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#111 from FoamyGuy/wrap_by_pixels Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.5.3 from 2.5.2: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#75 from adafruit/REUSE > Hardcoded Black and REUSE versions > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.0.3 from 5.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#65 from brentru/update-cpython-example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_typeis now split into:talker(first two characters) andsentence_type(remaining three characters)The
talkeris 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.
The
sentence_typeis 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 extra
talkers andsentence_types 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_types, 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 the
self.satsdictionary 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 the
time.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.pyThis 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.