1
1
# 1. as_GPS
2
2
3
3
This repository offers a suite of asynchronous device drivers for GPS devices
4
- which communicate with the host via a UART. GPS NMEA sentence parsing is based
5
- on this excellent library [ micropyGPS] .
4
+ which communicate with the host via a UART. GPS [ NMEA-0183 ] sentence parsing is
5
+ based on this excellent library [ micropyGPS] .
6
6
7
7
## 1.1 Driver characteristics
8
8
9
9
* Asynchronous: UART messaging is handled as a background task allowing the
10
10
application to perform other tasks such as handling user interaction.
11
11
* The read-only driver is suitable for resource constrained devices and will
12
12
work with most GPS devices using a UART for communication.
13
+ * Can write ` .kml ` files for displaying journeys on Google Earth.
13
14
* The read-write driver enables altering the configuration of GPS devices
14
15
based on the popular MTK3329/MTK3339 chips.
15
16
* The above drivers are portable between [ MicroPython] and Python 3.5 or above.
16
17
* Timing drivers for [ MicroPython] only extend the capabilities of the
17
18
read-only and read-write drivers to provide accurate sub-ms GPS timing. On
18
19
STM-based hosts (e.g. the Pyboard) the RTC may be set from GPS and calibrated
19
20
to achieve timepiece-level accuracy.
20
- * Can write ` .kml ` files for displaying journeys on Google Earth.
21
21
* Drivers may be extended via subclassing, for example to support additional
22
22
sentence types.
23
23
24
24
Testing was performed using a [ Pyboard] with the Adafruit
25
25
[ Ultimate GPS Breakout] board. Most GPS devices will work with the read-only
26
- driver as they emit NMEA sentences on startup.
26
+ driver as they emit [ NMEA-0183 ] sentences on startup.
27
27
28
28
## 1.2 Comparison with [ micropyGPS]
29
29
30
- NMEA sentence parsing is based on [ micropyGPS] but with significant changes.
30
+ [ NMEA-0183] sentence parsing is based on [ micropyGPS] but with significant
31
+ changes.
31
32
32
33
* As asynchronous drivers they require ` uasyncio ` on [ MicroPython] or
33
34
` asyncio ` under Python 3.5+.
@@ -47,8 +48,8 @@ NMEA sentence parsing is based on [micropyGPS] but with significant changes.
47
48
48
49
## 1.1 Overview
49
50
50
- The ` AS_GPS ` object runs a coroutine which receives GPS NMEA sentences from the
51
- UART and parses them as they arrive. Valid sentences cause local bound
51
+ The ` AS_GPS ` object runs a coroutine which receives [ NMEA-0183 ] sentences from
52
+ the UART and parses them as they arrive. Valid sentences cause local bound
52
53
variables to be updated. These can be accessed at any time with minimal latency
53
54
to access data such as position, altitude, course, speed, time and date.
54
55
@@ -68,8 +69,8 @@ the Pyboard is run from a voltage >5V the Pyboard 3V3 pin should be used.
68
69
69
70
This is based on UART 4 as used in the test programs; any UART may be used. The
70
71
UART Tx-GPS Rx connection is only necessary if using the read/write driver. The
71
- PPS connection is required only if using the device for precise timing
72
- ( ` as_tGPS.py ` ). Any pin may be used.
72
+ PPS connection is required only if using the timing driver ` as_tGPS.py ` . Any
73
+ pin may be used.
73
74
74
75
## 1.2 Basic Usage
75
76
@@ -170,8 +171,7 @@ or later.
170
171
Method calls and access to bound variables are nonblocking and return the most
171
172
current data. This is updated transparently by a coroutine. In situations where
172
173
updates cannot be achieved, for example in buildings or tunnels, values will be
173
- out of date. Whether this matters and any action to take is application
174
- dependent.
174
+ out of date. The action to take (if any) is application dependent.
175
175
176
176
Three mechanisms exist for responding to outages.
177
177
* Check the ` time_since_fix ` method [ section 2.2.3] ( ./README.md#223-time-and-date ) .
@@ -193,8 +193,7 @@ Optional positional args:
193
193
* ` fix_cb_args ` A tuple of args for the callback (default ` () ` ).
194
194
195
195
Notes:
196
- ` local_offset ` correctly alters the date where time passes the 00.00.00
197
- boundary.
196
+ ` local_offset ` will alter the date when time passes the 00.00.00 boundary.
198
197
If ` sreader ` is ` None ` a special test mode is engaged (see ` astests.py ` ).
199
198
200
199
### 2.1.1 The fix callback
@@ -401,8 +400,8 @@ was received `reparse` would see
401
400
## 2.6 Public class variable
402
401
403
402
* ` FULL_CHECK ` Default ` True ` . If set ` False ` disables CRC checking and other
404
- basic checks on received sentences. This is intended for use at high baudrates
405
- where the time consumed by these checks can be excessive .
403
+ basic checks on received sentences. If GPS is linked directly to the target
404
+ (rather than via long cables) these checks are arguably not neccessary .
406
405
407
406
# 3. The GPS class read-write driver
408
407
@@ -875,7 +874,7 @@ Sources of fixed lag:
875
874
876
875
Sources of variable error:
877
876
* Variations in interrupt latency (small on Pyboard).
878
- * Inaccuracy in the ` ticks_us ` timer (significant over 1 second).
877
+ * Inaccuracy in the ` ticks_us ` timer (significant over a 1 second interval ).
879
878
880
879
With correct usage when the PPS interrupt occurs the UART will not be receiving
881
880
data (this can substantially affect ISR latency variability). Consequently, on
0 commit comments