Skip to content

Commit 975fdd8

Browse files
authored
Merge pull request #4 from dherrada/master
Merging
2 parents e52d879 + 91e1ddf commit 975fdd8

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

README.rst

+68-4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Feather boards and many other circuitpython boards will round to two decimal pla
4141
>>> float('1234.5678')
4242
1234.57
4343
44-
This isn't ideal for gps data as this lowers the accuracy from 0.1m to 11m.
44+
This isn't ideal for GPS data as this lowers the accuracy from 0.1m to 11m.
4545

46-
This can be fixed by using string formatting when the gps data is outputted.
46+
This can be fixed by using string formatting when the GPS data is output.
4747

4848
An implementation of this can be found in examples/gps_simpletest.py
4949

@@ -88,7 +88,71 @@ These two lines are the lines that actually solve the issue:
8888
8989
print('Latitude: {0:.6f} degrees'.format(gps.latitude))
9090
print('Longitude: {0:.6f} degrees'.format(gps.longitude))
91-
91+
92+
About NMEA Data
93+
===============
94+
This GPS module uses the NMEA 0183 protocol.
95+
96+
This data is formatted by the GPS in one of two ways.
97+
98+
The first of these is GGA. GGA has more or less everything you need.
99+
100+
Here's an explanation of GGA:
101+
::
102+
103+
11
104+
1 2 3 4 5 6 7 8 9 10 | 12 13 14 15
105+
| | | | | | | | | | | | | | |
106+
$--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh
107+
108+
109+
1. Time (UTC)
110+
2. Latitude
111+
3. N or S (North or South)
112+
4. Longitude
113+
5. E or W (East or West)
114+
6. GPS Quality Indicator,
115+
116+
* 0 - fix not available,
117+
* 1 - GPS fix,
118+
* 2 - Differential GPS fix
119+
120+
7. Number of satellites in view, 00 - 12
121+
8. Horizontal Dilution of precision
122+
9. Antenna Altitude above/below mean-sea-level (geoid)
123+
10. Units of antenna altitude, meters
124+
11. Geoidal separation, the difference between the WGS-84 earth ellipsoid and mean-sea-level (geoid), "-" means mean-sea-level below ellipsoid
125+
12. Units of geoidal separation, meters
126+
13. Age of differential GPS data, time in seconds since last SC104 type 1 or 9 update, null field when DGPS is not used
127+
14. Differential reference station ID, 0000-1023
128+
15. Checksum
129+
130+
The second of these is RMC. RMC is Recommended Minimum Navigation Information.
131+
132+
Here's an explanation of RMC:
133+
::
134+
135+
12
136+
1 2 3 4 5 6 7 8 9 10 11|
137+
| | | | | | | | | | | |
138+
$--RMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,xxxx,x.x,a*hh
139+
140+
1. Time (UTC)
141+
2. Status, V = Navigation receiver warning
142+
3. Latitude
143+
4. N or S
144+
5. Longitude
145+
6. E or W
146+
7. Speed over ground, knots
147+
8. Track made good, degrees true
148+
9. Date, ddmmyy
149+
10. Magnetic Variation, degrees
150+
11. E or W
151+
12. Checksum
152+
153+
154+
`Info about NMEA taken from here
155+
<https://www.tronico.fi/OH6NT/docs/NMEA0183.pdf>`_.
92156

93157
Contributing
94158
============
@@ -100,7 +164,7 @@ before contributing to help this project stay welcoming.
100164
Building locally
101165
================
102166

103-
To build this library locally you'll need to install the
167+
To build this library locally, you'll need to install the
104168
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
105169

106170
.. code-block:: shell

adafruit_gps.py

+5
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ def _parse_sentence(self):
171171
# Parse any NMEA sentence that is available.
172172
# pylint: disable=len-as-condition
173173
# This needs to be refactored when it can be tested.
174+
175+
# Only continue if we have at least 64 bytes in the input buffer
176+
if self._uart.in_waiting < 64:
177+
return None
178+
174179
sentence = self._uart.readline()
175180
if sentence is None or sentence == b'' or len(sentence) < 1:
176181
return None

0 commit comments

Comments
 (0)