Commit graph

116 commits

Author SHA1 Message Date
foamyguy
dd02ced33b change to ruff 2025-05-14 16:16:14 +00:00
snkYmkrct
dffaebcc23 Add NMEA VTG sentence parse for the km/h speed value 2024-10-07 18:13:16 +02:00
Dan Halbert
41f15963f7
Fix typo in _parse_gil() 2024-03-22 11:54:01 -04:00
Jonas Kittner
35f4904de3 replace partition with split
partition is not available on all boards
2024-01-19 17:27:52 +01:00
Jonas Kittner
500559b0d8 fix typo 2024-01-18 17:01:45 +01:00
Jonas Kittner
42dd755047 fix minute parsing 2024-01-18 16:58:33 +01:00
Emily Charles
6971e892fb include key as well as value when iterating over satellite dictionary 2023-05-18 20:29:07 -04:00
Emily Charles
a310747c2b use values for satellite dict access instead of items 2023-05-18 19:53:44 -04:00
Emily Charles
a9d9a1160e use pylint rule name instead of code 2023-04-25 20:39:58 -04:00
Emily Charles
a46021a761 fixing pylint errors 2023-04-24 19:38:07 -04:00
Emily Charles
224bf57cff remove unused vars 2023-04-24 19:28:05 -04:00
Emily Charles
5282286ea3 linter fixes 2023-04-24 19:27:45 -04:00
Emily Charles
df8c75e21e add docstrings to GPS class attrs 2023-04-24 17:59:54 -04:00
Alec Delaney
4e2c583e2a
Fix annotation for _read_int_degrees() 2022-09-16 14:56:09 -04:00
Alec Delaney
6542aa5dc1
Change timeout default value to float 2022-09-16 14:54:08 -04:00
Alec Delaney
ceb92a6121
Remove comment regarding string type 2022-09-16 14:51:24 -04:00
Alec Delaney
f98cd66f5a Add type annotations 2022-08-30 11:52:13 -04:00
Alec Delaney
ad5b067e92 Update version string 2022-08-16 18:09:13 -04:00
gamblor21
872ce6e4d5 Spelling mistake, comment 2022-06-16 18:19:09 -05:00
gamblor21
9f90c48e17 Refactor for mpy-cross 2022-06-13 22:47:12 -05:00
gamblor21
d22cc67f5c Fix to handle other nmea data string lengths 2022-06-13 22:30:35 -05:00
gamblor21
28b2d2543f Add handling with extra precision in lat/long 2022-06-13 16:36:16 -05:00
caternuson
c4d9dd1660 black says double quotes please 2022-05-25 12:45:42 -07:00
caternuson
d25f2ec187 switch decode to str 2022-05-25 12:36:07 -07:00
root
41a4adff44 Enhanced parsing of timestamp_utc 2021-12-08 21:41:28 +01:00
Scott Shawcroft
64d5699910
Merge pull request #70 from theendlessriver13/fix-byte-indexing
fix bug where byte str comparision was done incorrectly
2021-10-25 14:36:30 -07:00
Jonas Kittner
845d4388fc fix bug where byte str comparision was done incorrectly 2021-10-21 19:15:44 +02:00
Jonas Kittner
ff798a1511 update pre-commit conifiguration to avoid using the local escape hatch 2021-10-20 21:39:54 +02:00
Jonas Kittner
5e442be906 fix bug where has_fix remained True even though the fix was lost 2021-09-23 18:58:39 +02:00
James Carr
e75769882b
Update RMC parsing to handle the extra parameter in NMEA 4.1 (Closes #65) 2021-09-06 10:25:58 +01:00
James Carr
2b98d77f63
Change the minimum sentence length to 11 (Closes #56) 2021-04-25 21:36:09 +01:00
Scott Shawcroft
cc4c9dffc7
Merge pull request #60 from lesamouraipourpre/length-data-type-check
Add a check on the length of the datatype
2021-03-15 14:15:58 -07:00
James Carr
7d2a3a0556 Update documentation 2021-03-15 11:06:41 +00:00
James Carr
e98fd750b1 Add a check on the length of the datatype 2021-03-13 15:37:13 +00:00
James Carr
6da1add986 Move the args.split() call up a level to reduce memory usage. 2021-03-01 08:43:48 +00:00
James Carr
e0d9f3d3f7 Replace _SENTENCE_PARAMS dictionary with a tuple of compacted strings to reduce memory usage. 2021-03-01 08:36:50 +00:00
James Carr
037be6ebf3 Black/PyLint pass 2021-02-24 23:34:15 +00:00
James Carr
92efe69f54 Missing return statement. Thank you, PyLint. 2021-02-24 23:18:22 +00:00
James Carr
2f79c44ef6 Typo. Thank you, PyLint 2021-02-24 23:13:17 +00:00
James Carr
2cc44731e4 Pass the debug value into _parse_data 2021-02-24 23:10:46 +00:00
James Carr
91f584689a Correct some of the RMC parameter types. 2021-02-23 23:01:02 +00:00
James Carr
632dc4a1b1 Use longitude for longitude, not latitude. D'Oh! 2021-02-23 22:48:32 +00:00
James Carr
7a59234e2e Refactor the sentence parsing (Fixes #55)
Refactor the date and time parsing into a method
Add an instance variable self.mode_indicator
Add an instance variable self.magnetic_variation

Sentence Parsing:
1) Read the sentence from I2C/UART (No change)
2) Validate the CRC, else fail (No change)
3) Call _parse_[SENTENCE_TYPE](), if the sentence was from a GNSS, else return True
4) The data length is compared against it's expected length, else fail
5) These then call _parse_data(PSEUDO_SENTENCE_TYPE,DATA)
6) The data is converted into the expected parameter types, else fail

PSEUDO_SENTENCE_TYPE is usually SENTENCE_TYPE, but can be modified for
a SENTENCE_TYPE with variable data length.

The update() method returns True if:
  The sentence passes CRC AND
    Not from A GNSS (No parsing happens) OR
    From a GNSS, with a handled sentence type which passes parsing OR
    From a GNSS, with an unhandled sentence type (No parsing happens)
Else False
2021-02-23 21:49:35 +00:00
James Carr
6dcfca0a25 Rename the _parse_[sentence] methods so that they don't have gp as part of their name.
eg. _parse_gpgll -> _parse_gll
2021-02-22 22:57:15 +00:00
James Carr
6bf1132fd7 Reformat with pylint and black. 2021-02-18 18:21:01 +00:00
James Carr
93a8430a09 Reformat with black. 2021-02-18 13:30:00 +00:00
James Carr
84480ede5b Update the processing of GSV messages, to include a time reference
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
2021-02-18 12:43:31 +00:00
James Carr
8786f1fc97 Enable GSA (DOP and active satellites) parsing
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 .
2021-02-12 20:10:47 +00:00
James Carr
8629b4fe3e Add support for a wider range of talkers.
Reference: https://www.nmea.org/Assets/20190303%20nmea%200183%20talker%20identifier%20mnemonics.pdf
2021-02-11 23:19:49 +00:00
dherrada
376892e64c Ran pre-commit, added licenses 2021-01-14 13:35:19 -05:00