1
- # 1 as_GPS
1
+ # An asynchronous GPS receiver
2
2
3
3
This repository offers a suite of asynchronous device drivers for GPS devices
4
4
which communicate with the host via a UART. GPS [ NMEA-0183] sentence parsing is
@@ -7,11 +7,71 @@ based on this excellent library [micropyGPS].
7
7
The code requires uasyncio V3. Some modules can run under CPython: doing so
8
8
will require Python V3.8 or later.
9
9
10
- The main modules have been tested on Pyboards and RP2 (Pico and Pico W).
10
+ The main modules have been tested on Pyboards and RP2 (Pico and Pico W). Since
11
+ the interface is a standard UART it is expected that the modules will work on
12
+ other hosts. Some modules use GPS for precision timing: the accuracy of these
13
+ may be reduced on some platforms.
11
14
12
15
###### [ Tutorial] ( ./TUTORIAL.md#contents )
13
16
###### [ Main V3 README] ( ../README.md )
14
17
18
+ # 1. Contents
19
+
20
+ 1 . [ Contents] ( ./GPS.md#1-contents )
21
+ 1.1 [ Driver characteristics] ( ./GPS.md#11-driver-characteristics )
22
+ 1.2 [ Comparison with micropyGPS] ( ./GPS.md#12-comparison-with-micropygps )
23
+ 1.3 [ Overview] ( ./GPS.md#13-overview )
24
+ 2 . [ Installation] ( ./GPS.md#2-installation )
25
+ 2.1 [ Wiring] )(./GPS.md#21-wiring)
26
+ 2.2 [ Library installation] ( GPS.md#22-library-installation )
27
+ 2.3 [ Dependency] ( ./GPS.md#23-dependency )
28
+ 3 . [ Basic Usage] ( ./GPS.md-basic-usage )
29
+ 3.1 [ Demo programs] ( ./GPS.md#31-demo-programs )
30
+ 4 . [ The AS_GPS Class read-only driver] ( ./GPS.md#4-the-AS_GPS-class-read-only-driver ) Base class: a general purpose driver.
31
+ 4.1 [ Constructor] ( ./GPS.md#41-constructor )
32
+   ;  ;  ;  ;  ; 4.1.1 [ The fix callback] ( ./GPS.md#411-the-fix-callback ) Optional callback-based interface.
33
+ 4.2 [ Public Methods] ( ./GPS.md#42-public-methods )
34
+   ;  ;  ;  ;  ; 4.2.1 [ Location] ( ./GPS.md#412-location )
35
+   ;  ;  ;  ;  ; 4.2.2 [ Course] ( ./GPS.md#422-course )
36
+   ;  ;  ;  ;  ; 4.2.3 [ Time and date] ( ./GPS.md#423-time-and-date )
37
+ 4.3 [ Public coroutines] ( ./GPS.md#43-public-coroutines )
38
+   ;  ;  ;  ;  ; 4.3.1 [ Data validity] ( ./GPS.md#431-data-validity )
39
+   ;  ;  ;  ;  ; 4.3.2 [ Satellite data] ( ./GPS.md#432-satellite-data )
40
+ 4.4 [ Public bound variables and properties] (./GPS.md#44-public-bound-variables and properties)
41
+   ;  ;  ;  ;  ; 4.4.1 [ Position and course] ( ./GPS.md#441-position-and-course )
42
+   ;  ;  ;  ;  ; 4.4.2 [ Statistics and status] ( ./GPS.md#442-statistics-and-status )
43
+   ;  ;  ;  ;  ; 4.4.3 [ Date and time] ( ./GPS.md#443-date-and-time )
44
+   ;  ;  ;  ;  ; 4.4.4 [ Satellite data] ( ./GPS.md#444-satellite-data )
45
+ 4.5 [ Subclass hooks] ( ./GPS.md#45-subclass-hooks )
46
+ 4.6 [ Public class variable] ( ./GPS.md#46-public-class-variable )
47
+ 5 . [ The GPS class read-write driver] ( ./GPS.md#5-the-gps-class-read-write-driver ) Subclass supports changing GPS hardware modes.
48
+ 5.1 [ Test script] ( ./GPS.md#51-test-script )
49
+ 5.2 [ Usage example] ( ./GPS.md#52-usage-example )
50
+ 5.3 [ The GPS class constructor] ( ./GPS.md#53-the-gps-class-constructor )
51
+ 5.4 [ Public coroutines] ( ./GPS.md#54-public-coroutines )
52
+   ;  ;  ;  ;  ; 5.4.1 [ Changing baudrate] ( ./GPS.md#5-changing-baudrate )
53
+ 5.5 [ Public bound variables] ( ./GPS.md#55-public-bound-variables )
54
+ 5.6 [ The parse method developer note] ( ./GPS.md#56-the-parse-method-developer-note )
55
+ 6 . [ Using GPS for accurate timing] ( ./GPS.md#6-using-gps-for-accurate-timing )
56
+ 6.1 [ Test scripts] ( ./GPS.md#61-test-scripts )
57
+ 6.2 [ Usage example] ( ./GPS.md#62-usage-example )
58
+ 6.3 [ GPS_Timer and GPS_RWTimer classes] ( ./GPS.md#63-gps_timer-and-gps_rwtimer-classes )
59
+ 6.4 [ Public methods] ( ./GPS.md#64-public-methods )
60
+ 6.5 [ Public coroutines] ( ./GPS.md#65-public-coroutines )
61
+ 6.6 [ Absolute accuracy] ( ./GPS.md#66-absolute-accuracy )
62
+ 6.7 [ Demo program as_GPS_time.py] ( ./GPS.md#67-demo-program-as_gps_time )
63
+ 7 . [ Supported sentences] ( ./GPS.md#7-supported-sentences )
64
+ 8 . [ Developer notes] ( ./GPS.md#8-developer-notes ) For those wanting to modify the modules.
65
+ 8.1 [ Subclassing] ( ./GPS.md#81-subclassing )
66
+ 8.2 [ Special test programs] ( ./GPS.md#82-special-test-programs )
67
+ 9 . [ Notes on timing] ( ./GPS.md#9-notes-on-timing )
68
+ 9.1 [ Absolute accuracy] ( ./GPS.md#91-absolute-accuracy )
69
+ 10 . [ Files] ( ./GPS.md#10-files ) List of files in the repo.
70
+ 10.1 [ Basic files] ( ./GPS.md#101-basic-files )
71
+ 10.2 [ Files for read write operation] ( ./GPS.md#102-files-for-read-write-operation )
72
+ 10.3 [ Files for timing applications] ( ./GPS.md#103-files-for-timing-applications )
73
+ 10.4 [ Special test programs] ( ./GPS.md#104-special-test-programs )
74
+
15
75
## 1.1 Driver characteristics
16
76
17
77
* Asynchronous: UART messaging is handled as a background task allowing the
@@ -33,7 +93,7 @@ Testing was performed using a [Pyboard] with the Adafruit
33
93
[ Ultimate GPS Breakout] board. Most GPS devices will work with the read-only
34
94
driver as they emit [ NMEA-0183] sentences on startup.
35
95
36
- ## 1.2 Comparison with [ micropyGPS]
96
+ ## 1.2 Comparison with micropyGPS
37
97
38
98
[ NMEA-0183] sentence parsing is based on [ micropyGPS] but with significant
39
99
changes.
@@ -245,6 +305,8 @@ gps = as_GPS.AS_GPS(sreader, fix_cb=callback, cb_mask= as_GPS.RMC | as_GPS.VTG)
245
305
246
306
## 4.2 Public Methods
247
307
308
+ These are grouped below by the type of data returned.
309
+
248
310
### 4.2.1 Location
249
311
250
312
* ` latitude ` Optional arg ` coord_format=as_GPS.DD ` . Returns the most recent
@@ -351,15 +413,15 @@ Note that if the GPS module does not support producing GSV sentences this
351
413
coroutine will pause forever. It can also pause for arbitrary periods if
352
414
satellite reception is blocked, such as in a building.
353
415
354
- ## 4.4 Public bound variables/ properties
416
+ ## 4.4 Public bound variables and properties
355
417
356
418
These are updated whenever a sentence of the relevant type has been correctly
357
419
received from the GPS unit. For crucial navigation data the ` time_since_fix `
358
420
method may be used to determine how current these values are.
359
421
360
422
The sentence type which updates a value is shown in brackets e.g. (GGA).
361
423
362
- ### 4.4.1 Position/ course
424
+ ### 4.4.1 Position and course
363
425
364
426
* ` course ` Track angle in degrees. (VTG).
365
427
* ` altitude ` Metres above mean sea level. (GGA).
@@ -616,7 +678,7 @@ measured in seconds) polls the value, returning it when it changes.
616
678
2 Internal antenna.
617
679
3 External antenna.
618
680
619
- ## 5.6 The parse method ( developer note)
681
+ ## 5.6 The parse method developer note
620
682
621
683
The null ` parse ` method in the base class is overridden. It intercepts the
622
684
single response to ` VERSION ` and ` ENABLE ` commands and updates the above bound
@@ -821,7 +883,7 @@ accuracy and the `get_t_split` method should provide accuracy on the order of
821
883
The reasoning behind this is discussed in
822
884
[ section 9] ( ./GPS.md#9-notes-on-timing ) .
823
885
824
- ## 6.7 Test/demo program as_GPS_time.py
886
+ ## 6.7 Demo program as_GPS_time
825
887
826
888
Run by issuing
827
889
``` python
0 commit comments