pygnssutils 1.2.6__tar.gz → 1.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygnssutils-1.2.6/src/pygnssutils.egg-info → pygnssutils-1.2.7}/PKG-INFO +5 -46
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/README.md +3 -43
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/pyproject.toml +1 -3
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/__init__.py +0 -2
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/_version.py +1 -1
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssstreamer_cli.py +0 -37
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_globals.py +1 -1
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_helpers.py +1 -1
- {pygnssutils-1.2.6 → pygnssutils-1.2.7/src/pygnssutils.egg-info}/PKG-INFO +5 -46
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils.egg-info/SOURCES.txt +0 -3
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils.egg-info/entry_points.txt +0 -1
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils.egg-info/requires.txt +1 -2
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_cli.py +0 -5
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_static.py +0 -18
- pygnssutils-1.2.6/src/pygnssutils/gnssmqttclient.py +0 -481
- pygnssutils-1.2.6/src/pygnssutils/gnssmqttclient_cli.py +0 -262
- pygnssutils-1.2.6/src/pygnssutils/mqttmessage.py +0 -74
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/LICENSE +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/setup.cfg +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/exceptions.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/globals.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssntripclient.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssntripclient_cli.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssreader.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssserver.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssserver_cli.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/gnssstreamer.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/helpers.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_reader.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_bds.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_gal.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_glo.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_gps.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_irn.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_qzs.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rawnav_subframes_sba.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_conv.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_conv_cli.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_conv_met.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_conv_nav.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/rinex_conv_obs.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils/socket_server.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils.egg-info/dependency_links.txt +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/src/pygnssutils.egg-info/top_level.txt +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_gnssstreamer.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_rawnav.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_rinex.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_rinex_defs.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_rinex_parse.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_socketwrapper.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_sourcetable.py +0 -0
- {pygnssutils-1.2.6 → pygnssutils-1.2.7}/tests/test_stream.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygnssutils
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.7
|
|
4
4
|
Summary: GNSS Command Line Utilities
|
|
5
5
|
Author-email: Steve Smith <semuadmin@semuconsulting.com>
|
|
6
6
|
Maintainer-email: Steve Smith <semuadmin@semuconsulting.com>
|
|
@@ -31,11 +31,10 @@ Requires-Python: >=3.10
|
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
License-File: LICENSE
|
|
33
33
|
Requires-Dist: certifi>=2025.0.0
|
|
34
|
-
Requires-Dist: paho-mqtt>=2.1.0
|
|
35
34
|
Requires-Dist: pyserial>=3.5
|
|
36
35
|
Requires-Dist: pyspartn>=1.0.8
|
|
37
36
|
Requires-Dist: pyubx2>=1.3.6
|
|
38
|
-
Requires-Dist: pynmeagps>=1.1.
|
|
37
|
+
Requires-Dist: pynmeagps>=1.1.7
|
|
39
38
|
Requires-Dist: pysbf2>=1.0.4
|
|
40
39
|
Requires-Dist: pyubxutils>=1.0.6
|
|
41
40
|
Requires-Dist: pyqgc>=1.0.0
|
|
@@ -51,7 +50,6 @@ pygnssutils
|
|
|
51
50
|
[gnssstreamer CLI](#gnssstreamer) |
|
|
52
51
|
[gnssserver CLI](#gnssserver) |
|
|
53
52
|
[gnssntripclient CLI](#gnssntripclient) |
|
|
54
|
-
[gnssmqttclient CLI](#gnssmqttclient) |
|
|
55
53
|
[socketserver](#socketserver) |
|
|
56
54
|
[RINEX Conversion](#rinexconvert) |
|
|
57
55
|
[RTK Demonstration](#rtkdemo) |
|
|
@@ -71,17 +69,14 @@ pygnssutils is an original series of Python GNSS utility classes and CLI tools b
|
|
|
71
69
|
|
|
72
70
|
Originally developed in support of the [PyGPSClient](https://github.com/semuconsulting/PyGPSClient) GUI GNSS application, the utilities provided by pygnssutils can also be used in their own right:
|
|
73
71
|
|
|
74
|
-
1. `GNSSReader` class. This is essentially an amalgamation of the `*Reader` classes in all the subsidiary parsers listed above, allowing the user to seamlessly stream any of NMEA, UBX, SBF, UNI, QGC
|
|
72
|
+
1. `GNSSReader` class. This is essentially an amalgamation of the `*Reader` classes in all the subsidiary parsers listed above, allowing the user to seamlessly stream any of NMEA, UBX, SBF, UNI, QGC and RTCM3 message protocols concurrently from a single stream.
|
|
75
73
|
1. `GNSSStreamer` class and its associated [`gnssstreamer`](#gnssstreamer) (*formerly `gnssdump`*) CLI utility. This is essentially a configurable bidirectional input/output wrapper around the `GNSSReader` class with flexible message formatting, filtering and output handling options for NMEA, UBX, SBF, UNI, QGC and RTCM3 protocols.
|
|
76
74
|
1. `GNSSSocketServer` class and its associated [`gnssserver`](#gnssserver) CLI utility. This implements a TCP Socket Server for GNSS data streams which is also capable of being run as a simple NTRIP Server/Caster.
|
|
77
75
|
1. `GNSSNTRIPClient` class and its associated [`gnssntripclient`](#gnssntripclient) CLI utility. This implements
|
|
78
76
|
a simple NTRIP Client which receives RTCM3 or SPARTN correction data from an NTRIP Server and (optionally) sends this to a
|
|
79
77
|
designated output stream.
|
|
80
|
-
1. `GNSSMQTTClient` class and its associated [`gnssmqttclient`](#gnssmqttclient) CLI utility. This implements
|
|
81
|
-
a simple SPARTN IP (MQTT) Client which receives SPARTN correction data from an SPARTN IP location service and (optionally) sends this to a
|
|
82
|
-
designated output stream.
|
|
83
78
|
1. `SocketServer` class based on the native Python `ThreadingTCPServer`. Capable of operating in two modes - Socket Server or NTRIP Caster. Provides two alternate client request handler classes - `ClientHandler` (HTTP) or `ClientHandlerTLS` (HTTPS).
|
|
84
|
-
1. `RinexConverter` class and its associated [`pyrinexconv`](#rinexconvert) CLI utility. This implements a binary GNSS data log file to RINEX text file conversion facility. **NB: RINEX conversion is currently an experimental
|
|
79
|
+
1. `RinexConverter` class and its associated [`pyrinexconv`](#rinexconvert) CLI utility. This implements a binary GNSS data log file to RINEX text file conversion facility. **NB: RINEX conversion is currently an experimental feature (*contributions and feedback welcome*)**
|
|
85
80
|
|
|
86
81
|
The pygnssutils homepage is located at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils).
|
|
87
82
|
|
|
@@ -97,7 +92,7 @@ The pygnssutils homepage is located at [https://github.com/semuconsulting/pygnss
|
|
|
97
92
|
|
|
98
93
|
Sphinx API Documentation in HTML format is available at [https://www.semuconsulting.com/pygnssutils](https://www.semuconsulting.com/pygnssutils).
|
|
99
94
|
|
|
100
|
-
Contributions welcome - please refer to [CONTRIBUTING.MD](https://github.com/semuconsulting/pygnssutils/blob/main/CONTRIBUTING.md).
|
|
95
|
+
Contributions **_from human beings_** welcome - please refer to [CONTRIBUTING.MD](https://github.com/semuconsulting/pygnssutils/blob/main/CONTRIBUTING.md).
|
|
101
96
|
|
|
102
97
|
[Bug reports](https://github.com/semuconsulting/pygnssutils/blob/main/.github/ISSUE_TEMPLATE/bug_report.md) and [Feature requests](https://github.com/semuconsulting/pygnssutils/blob/main/.github/ISSUE_TEMPLATE/feature_request.md) - please use the templates provided. For general queries and advice, post a message to one of the [pygnssutils Discussions](https://github.com/semuconsulting/pygnssutils/discussions) channels.
|
|
103
98
|
|
|
@@ -182,7 +177,6 @@ class pygnssutils.gnssstreamer.GNSSStreamer(**kwargs)
|
|
|
182
177
|
- 0 = none (default)
|
|
183
178
|
- 1 = RTK NTRIP RTCM caster
|
|
184
179
|
- 2 = RTK NTRIP SPARTN caster
|
|
185
|
-
- 3 = RTK MQTT SPARTN source (see [gnssmqttclient](#gnssmqttclient) for MQTT client configuration details)
|
|
186
180
|
- 4 = serial port
|
|
187
181
|
- 5 = binary file.
|
|
188
182
|
|
|
@@ -472,41 +466,6 @@ gnssntripclient -h
|
|
|
472
466
|
|
|
473
467
|
Refer to the [Sphinx API documentation](https://www.semuconsulting.com/pygnssutils/pygnssutils.html#module-pygnssutils.gnssntripclient) for further details.
|
|
474
468
|
|
|
475
|
-
---
|
|
476
|
-
## <a name="gnssmqttclient">GNSSMQTTClient and gnssmqttclient CLI</a>
|
|
477
|
-
```
|
|
478
|
-
class pygnssutils.gnssmqttclient.GNSSMQTTClient(app=None, **kwargs)
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
The `GNSSMQTTClient` class provides a basic SPARTN IP (MQTT) Client capability and forms the basis of a [`gnssmqttclient`](#gnssmqttclient) CLI utility. It receives RTK correction data from a SPARTN IP (MQTT) location service (e.g. the u-blox / Thingstream PointPerfect service) and (optionally) sends this to a designated output stream.
|
|
482
|
-
|
|
483
|
-
### CLI Usage:
|
|
484
|
-
|
|
485
|
-
The `clientid` provided by the location service may be set as environment variable `MQTTCLIENTID`. If this environment variable is set and the TLS certificate (\*.crt) and key (\*.pem) files provided by the location service are placed in the user's `HOME` directory, the utility can use these as default settings and may be invoked without any arguments.
|
|
486
|
-
|
|
487
|
-
Assuming the Python 3 scripts (bin) directory is in your PATH, the CLI utility may be invoked from the shell thus (press CTRL-C to terminate):
|
|
488
|
-
|
|
489
|
-
```shell
|
|
490
|
-
gnssmqttclient --clientid yourclientid --server pp.services.u-blox.com --port 8883 --region eu --mode 0 --topic_ip 1 --topic_mga 1 --topic_key 1 --tlscrt '/Users/{your-user}/device-{your-clientid}-pp-cert.crt' --tlskey '/Users/{your-user}/device-{your-client-id}-pp-key.pem'} --spartndecode 0 --clioutput 0 --verbosity 2
|
|
491
|
-
```
|
|
492
|
-
```
|
|
493
|
-
2024-08-15 09:14:50.544 - INFO - pygnssutils.gnssmqttclient - Starting MQTT client with arguments {'server': 'pp.services.u-blox.com', 'port': 8883, 'clientid': 'your-client-id', 'region': 'eu', 'mode': 0, 'topic_ip': 1, 'topic_mga': 1, 'topic_key': 1, 'tlscrt': '/Users/myuser/device-your-client-id-pp-cert.crt', 'tlskey': '/Users/myuser/device-your-client-id-pp-key.pem', 'spartndecode': 0, 'output': None}.
|
|
494
|
-
2024-08-15 09:14:50.840 - INFO - pygnssutils.gnssmqttclient - RXM-SPARTN-KEY
|
|
495
|
-
2024-08-15 09:14:50.854 - INFO - pygnssutils.gnssmqttclient - MGA-INI-TIME-UTC
|
|
496
|
-
2024-08-15 09:14:50.858 - INFO - pygnssutils.gnssmqttclient - MGA-GPS-EPH
|
|
497
|
-
...
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
Command line arguments can be stored in a configuration file and invoked using the `-C` or `--config` argument. The location of the configuration file can be set in environment variable `GNSSMQTTCLIENT_CONF`.
|
|
501
|
-
|
|
502
|
-
For help and full list of optional arguments, type:
|
|
503
|
-
|
|
504
|
-
```shell
|
|
505
|
-
gnssmqttclient -h
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
Refer to the [pyspartn documentation](https://github.com/semuconsulting/pyspartn?tab=readme-ov-file#reading) for further details on decrypting encrypted (`eaf=1`) SPARTN payloads.
|
|
509
|
-
|
|
510
469
|
---
|
|
511
470
|
## <a name="socketserver">SocketServer</a>
|
|
512
471
|
|
|
@@ -7,7 +7,6 @@ pygnssutils
|
|
|
7
7
|
[gnssstreamer CLI](#gnssstreamer) |
|
|
8
8
|
[gnssserver CLI](#gnssserver) |
|
|
9
9
|
[gnssntripclient CLI](#gnssntripclient) |
|
|
10
|
-
[gnssmqttclient CLI](#gnssmqttclient) |
|
|
11
10
|
[socketserver](#socketserver) |
|
|
12
11
|
[RINEX Conversion](#rinexconvert) |
|
|
13
12
|
[RTK Demonstration](#rtkdemo) |
|
|
@@ -27,17 +26,14 @@ pygnssutils is an original series of Python GNSS utility classes and CLI tools b
|
|
|
27
26
|
|
|
28
27
|
Originally developed in support of the [PyGPSClient](https://github.com/semuconsulting/PyGPSClient) GUI GNSS application, the utilities provided by pygnssutils can also be used in their own right:
|
|
29
28
|
|
|
30
|
-
1. `GNSSReader` class. This is essentially an amalgamation of the `*Reader` classes in all the subsidiary parsers listed above, allowing the user to seamlessly stream any of NMEA, UBX, SBF, UNI, QGC
|
|
29
|
+
1. `GNSSReader` class. This is essentially an amalgamation of the `*Reader` classes in all the subsidiary parsers listed above, allowing the user to seamlessly stream any of NMEA, UBX, SBF, UNI, QGC and RTCM3 message protocols concurrently from a single stream.
|
|
31
30
|
1. `GNSSStreamer` class and its associated [`gnssstreamer`](#gnssstreamer) (*formerly `gnssdump`*) CLI utility. This is essentially a configurable bidirectional input/output wrapper around the `GNSSReader` class with flexible message formatting, filtering and output handling options for NMEA, UBX, SBF, UNI, QGC and RTCM3 protocols.
|
|
32
31
|
1. `GNSSSocketServer` class and its associated [`gnssserver`](#gnssserver) CLI utility. This implements a TCP Socket Server for GNSS data streams which is also capable of being run as a simple NTRIP Server/Caster.
|
|
33
32
|
1. `GNSSNTRIPClient` class and its associated [`gnssntripclient`](#gnssntripclient) CLI utility. This implements
|
|
34
33
|
a simple NTRIP Client which receives RTCM3 or SPARTN correction data from an NTRIP Server and (optionally) sends this to a
|
|
35
34
|
designated output stream.
|
|
36
|
-
1. `GNSSMQTTClient` class and its associated [`gnssmqttclient`](#gnssmqttclient) CLI utility. This implements
|
|
37
|
-
a simple SPARTN IP (MQTT) Client which receives SPARTN correction data from an SPARTN IP location service and (optionally) sends this to a
|
|
38
|
-
designated output stream.
|
|
39
35
|
1. `SocketServer` class based on the native Python `ThreadingTCPServer`. Capable of operating in two modes - Socket Server or NTRIP Caster. Provides two alternate client request handler classes - `ClientHandler` (HTTP) or `ClientHandlerTLS` (HTTPS).
|
|
40
|
-
1. `RinexConverter` class and its associated [`pyrinexconv`](#rinexconvert) CLI utility. This implements a binary GNSS data log file to RINEX text file conversion facility. **NB: RINEX conversion is currently an experimental
|
|
36
|
+
1. `RinexConverter` class and its associated [`pyrinexconv`](#rinexconvert) CLI utility. This implements a binary GNSS data log file to RINEX text file conversion facility. **NB: RINEX conversion is currently an experimental feature (*contributions and feedback welcome*)**
|
|
41
37
|
|
|
42
38
|
The pygnssutils homepage is located at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils).
|
|
43
39
|
|
|
@@ -53,7 +49,7 @@ The pygnssutils homepage is located at [https://github.com/semuconsulting/pygnss
|
|
|
53
49
|
|
|
54
50
|
Sphinx API Documentation in HTML format is available at [https://www.semuconsulting.com/pygnssutils](https://www.semuconsulting.com/pygnssutils).
|
|
55
51
|
|
|
56
|
-
Contributions welcome - please refer to [CONTRIBUTING.MD](https://github.com/semuconsulting/pygnssutils/blob/main/CONTRIBUTING.md).
|
|
52
|
+
Contributions **_from human beings_** welcome - please refer to [CONTRIBUTING.MD](https://github.com/semuconsulting/pygnssutils/blob/main/CONTRIBUTING.md).
|
|
57
53
|
|
|
58
54
|
[Bug reports](https://github.com/semuconsulting/pygnssutils/blob/main/.github/ISSUE_TEMPLATE/bug_report.md) and [Feature requests](https://github.com/semuconsulting/pygnssutils/blob/main/.github/ISSUE_TEMPLATE/feature_request.md) - please use the templates provided. For general queries and advice, post a message to one of the [pygnssutils Discussions](https://github.com/semuconsulting/pygnssutils/discussions) channels.
|
|
59
55
|
|
|
@@ -138,7 +134,6 @@ class pygnssutils.gnssstreamer.GNSSStreamer(**kwargs)
|
|
|
138
134
|
- 0 = none (default)
|
|
139
135
|
- 1 = RTK NTRIP RTCM caster
|
|
140
136
|
- 2 = RTK NTRIP SPARTN caster
|
|
141
|
-
- 3 = RTK MQTT SPARTN source (see [gnssmqttclient](#gnssmqttclient) for MQTT client configuration details)
|
|
142
137
|
- 4 = serial port
|
|
143
138
|
- 5 = binary file.
|
|
144
139
|
|
|
@@ -428,41 +423,6 @@ gnssntripclient -h
|
|
|
428
423
|
|
|
429
424
|
Refer to the [Sphinx API documentation](https://www.semuconsulting.com/pygnssutils/pygnssutils.html#module-pygnssutils.gnssntripclient) for further details.
|
|
430
425
|
|
|
431
|
-
---
|
|
432
|
-
## <a name="gnssmqttclient">GNSSMQTTClient and gnssmqttclient CLI</a>
|
|
433
|
-
```
|
|
434
|
-
class pygnssutils.gnssmqttclient.GNSSMQTTClient(app=None, **kwargs)
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
The `GNSSMQTTClient` class provides a basic SPARTN IP (MQTT) Client capability and forms the basis of a [`gnssmqttclient`](#gnssmqttclient) CLI utility. It receives RTK correction data from a SPARTN IP (MQTT) location service (e.g. the u-blox / Thingstream PointPerfect service) and (optionally) sends this to a designated output stream.
|
|
438
|
-
|
|
439
|
-
### CLI Usage:
|
|
440
|
-
|
|
441
|
-
The `clientid` provided by the location service may be set as environment variable `MQTTCLIENTID`. If this environment variable is set and the TLS certificate (\*.crt) and key (\*.pem) files provided by the location service are placed in the user's `HOME` directory, the utility can use these as default settings and may be invoked without any arguments.
|
|
442
|
-
|
|
443
|
-
Assuming the Python 3 scripts (bin) directory is in your PATH, the CLI utility may be invoked from the shell thus (press CTRL-C to terminate):
|
|
444
|
-
|
|
445
|
-
```shell
|
|
446
|
-
gnssmqttclient --clientid yourclientid --server pp.services.u-blox.com --port 8883 --region eu --mode 0 --topic_ip 1 --topic_mga 1 --topic_key 1 --tlscrt '/Users/{your-user}/device-{your-clientid}-pp-cert.crt' --tlskey '/Users/{your-user}/device-{your-client-id}-pp-key.pem'} --spartndecode 0 --clioutput 0 --verbosity 2
|
|
447
|
-
```
|
|
448
|
-
```
|
|
449
|
-
2024-08-15 09:14:50.544 - INFO - pygnssutils.gnssmqttclient - Starting MQTT client with arguments {'server': 'pp.services.u-blox.com', 'port': 8883, 'clientid': 'your-client-id', 'region': 'eu', 'mode': 0, 'topic_ip': 1, 'topic_mga': 1, 'topic_key': 1, 'tlscrt': '/Users/myuser/device-your-client-id-pp-cert.crt', 'tlskey': '/Users/myuser/device-your-client-id-pp-key.pem', 'spartndecode': 0, 'output': None}.
|
|
450
|
-
2024-08-15 09:14:50.840 - INFO - pygnssutils.gnssmqttclient - RXM-SPARTN-KEY
|
|
451
|
-
2024-08-15 09:14:50.854 - INFO - pygnssutils.gnssmqttclient - MGA-INI-TIME-UTC
|
|
452
|
-
2024-08-15 09:14:50.858 - INFO - pygnssutils.gnssmqttclient - MGA-GPS-EPH
|
|
453
|
-
...
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
Command line arguments can be stored in a configuration file and invoked using the `-C` or `--config` argument. The location of the configuration file can be set in environment variable `GNSSMQTTCLIENT_CONF`.
|
|
457
|
-
|
|
458
|
-
For help and full list of optional arguments, type:
|
|
459
|
-
|
|
460
|
-
```shell
|
|
461
|
-
gnssmqttclient -h
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
Refer to the [pyspartn documentation](https://github.com/semuconsulting/pyspartn?tab=readme-ov-file#reading) for further details on decrypting encrypted (`eaf=1`) SPARTN payloads.
|
|
465
|
-
|
|
466
426
|
---
|
|
467
427
|
## <a name="socketserver">SocketServer</a>
|
|
468
428
|
|
|
@@ -35,11 +35,10 @@ classifiers = [
|
|
|
35
35
|
|
|
36
36
|
dependencies = [
|
|
37
37
|
"certifi>=2025.0.0",
|
|
38
|
-
"paho-mqtt>=2.1.0",
|
|
39
38
|
"pyserial>=3.5",
|
|
40
39
|
"pyspartn>=1.0.8",
|
|
41
40
|
"pyubx2>=1.3.6",
|
|
42
|
-
"pynmeagps>=1.1.
|
|
41
|
+
"pynmeagps>=1.1.7",
|
|
43
42
|
"pysbf2>=1.0.4",
|
|
44
43
|
"pyubxutils>=1.0.6",
|
|
45
44
|
"pyqgc>=1.0.0",
|
|
@@ -50,7 +49,6 @@ dependencies = [
|
|
|
50
49
|
gnssstreamer = "pygnssutils.gnssstreamer_cli:main"
|
|
51
50
|
gnssserver = "pygnssutils.gnssserver_cli:main"
|
|
52
51
|
gnssntripclient = "pygnssutils.gnssntripclient_cli:main"
|
|
53
|
-
gnssmqttclient = "pygnssutils.gnssmqttclient_cli:main"
|
|
54
52
|
pyrinexconv = "pygnssutils.rinex_conv_cli:main"
|
|
55
53
|
|
|
56
54
|
[project.urls]
|
|
@@ -12,7 +12,6 @@ from pyubxutils.ubxsimulator import UBXSimulator
|
|
|
12
12
|
from pygnssutils._version import __version__
|
|
13
13
|
from pygnssutils.exceptions import GNSSError, GNSSStreamError, ParameterError
|
|
14
14
|
from pygnssutils.globals import *
|
|
15
|
-
from pygnssutils.gnssmqttclient import GNSSMQTTClient
|
|
16
15
|
from pygnssutils.gnssntripclient import GNSSNTRIPClient
|
|
17
16
|
from pygnssutils.gnssreader import (
|
|
18
17
|
NMEA_PROTOCOL,
|
|
@@ -26,7 +25,6 @@ from pygnssutils.gnssreader import (
|
|
|
26
25
|
from pygnssutils.gnssserver import GNSSSocketServer
|
|
27
26
|
from pygnssutils.gnssstreamer import GNSSStreamer
|
|
28
27
|
from pygnssutils.helpers import *
|
|
29
|
-
from pygnssutils.mqttmessage import *
|
|
30
28
|
from pygnssutils.rawnav import *
|
|
31
29
|
from pygnssutils.rinex_conv import RinexConverter
|
|
32
30
|
|
|
@@ -17,7 +17,6 @@ Supported output channels:
|
|
|
17
17
|
Supported input channels:
|
|
18
18
|
- NTRIP RTCM client
|
|
19
19
|
- NTRIP SPARTN client
|
|
20
|
-
- MQTT SPARTN client
|
|
21
20
|
- serial stream
|
|
22
21
|
- file stream
|
|
23
22
|
|
|
@@ -57,7 +56,6 @@ from pygnssutils.globals import (
|
|
|
57
56
|
FORMAT_PARSED,
|
|
58
57
|
FORMAT_PARSEDSTRING,
|
|
59
58
|
INPUT_FILE,
|
|
60
|
-
INPUT_MQTT_SPARTN,
|
|
61
59
|
INPUT_NONE,
|
|
62
60
|
INPUT_NTRIP_RTCM,
|
|
63
61
|
INPUT_NTRIP_SPARTN,
|
|
@@ -73,7 +71,6 @@ from pygnssutils.globals import (
|
|
|
73
71
|
OUTPUT_TEXT_FILE,
|
|
74
72
|
UBXSIMULATOR,
|
|
75
73
|
)
|
|
76
|
-
from pygnssutils.gnssmqttclient import GNSSMQTTClient
|
|
77
74
|
from pygnssutils.gnssntripclient import GNSSNTRIPClient
|
|
78
75
|
from pygnssutils.gnssreader import (
|
|
79
76
|
ERR_LOG,
|
|
@@ -162,34 +159,6 @@ def _setup_input_ntrip(app: object, datatype: str, **kwargs) -> object:
|
|
|
162
159
|
return gnc
|
|
163
160
|
|
|
164
161
|
|
|
165
|
-
def _setup_input_mqtt(app: object, datatype: str, **kwargs) -> object:
|
|
166
|
-
"""
|
|
167
|
-
Set up MQTT SPARTN client as input data source.
|
|
168
|
-
|
|
169
|
-
:param app: calling application (i.e. gnssstreamer)
|
|
170
|
-
:param datatype: "MQTT"
|
|
171
|
-
:returns: reference to MQTT client
|
|
172
|
-
:rtype: GNSSMQTTClient
|
|
173
|
-
"""
|
|
174
|
-
|
|
175
|
-
# pylint: disable=unused-argument
|
|
176
|
-
|
|
177
|
-
prot, hostname, port, path = parse_url(kwargs["input"])
|
|
178
|
-
prot = 1 if prot == "https" else 0
|
|
179
|
-
|
|
180
|
-
gmq = GNSSMQTTClient(app)
|
|
181
|
-
gmq.start(
|
|
182
|
-
server=hostname,
|
|
183
|
-
port=port,
|
|
184
|
-
clientid=kwargs.get("rtkuser", "anon"),
|
|
185
|
-
region=path.lower(), # e.g. "eu"
|
|
186
|
-
mode=0, # IP (as opposed to 1 = L-Band)
|
|
187
|
-
output=kwargs["inqueue"], # send SPARTN data to receiver
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
return gmq
|
|
191
|
-
|
|
192
|
-
|
|
193
162
|
def _setup_input_stream(app: object, datatype: str, **kwargs) -> object:
|
|
194
163
|
"""
|
|
195
164
|
Set up serial stream as input data source.
|
|
@@ -379,8 +348,6 @@ def _run_streamer(stream, **kwargs):
|
|
|
379
348
|
_setup_input_ntrip(gns, "RTCM", **kwargs)
|
|
380
349
|
elif cliinput == INPUT_NTRIP_SPARTN:
|
|
381
350
|
_setup_input_ntrip(gns, "SPARTN", **kwargs)
|
|
382
|
-
elif cliinput == INPUT_MQTT_SPARTN:
|
|
383
|
-
_setup_input_mqtt(gns, "MQTT", **kwargs)
|
|
384
351
|
elif cliinput == INPUT_SERIAL:
|
|
385
352
|
_setup_input_stream(gns, "SERIAL", **kwargs)
|
|
386
353
|
elif cliinput == INPUT_FILE:
|
|
@@ -568,7 +535,6 @@ def main():
|
|
|
568
535
|
f"CLI input type {INPUT_NONE} = none, "
|
|
569
536
|
f"{INPUT_NTRIP_RTCM} = RTK NTRIP RTCM, "
|
|
570
537
|
f"{INPUT_NTRIP_SPARTN} = RTK NTRIP SPARTN, "
|
|
571
|
-
f"{INPUT_MQTT_SPARTN} = RTK MQTT SPARTN, "
|
|
572
538
|
f"{INPUT_SERIAL} = serial port, "
|
|
573
539
|
f"{INPUT_FILE} = binary file"
|
|
574
540
|
),
|
|
@@ -577,7 +543,6 @@ def main():
|
|
|
577
543
|
INPUT_NONE,
|
|
578
544
|
INPUT_NTRIP_RTCM,
|
|
579
545
|
INPUT_NTRIP_SPARTN,
|
|
580
|
-
INPUT_MQTT_SPARTN,
|
|
581
546
|
INPUT_SERIAL,
|
|
582
547
|
INPUT_FILE,
|
|
583
548
|
],
|
|
@@ -592,8 +557,6 @@ def main():
|
|
|
592
557
|
"(e.g. 'http://rtk2go.com:2101/MOUNTPOINT'); "
|
|
593
558
|
f"If cliinput = {INPUT_NTRIP_SPARTN}, format = full url "
|
|
594
559
|
"(e.g. 'https://ppntrip.services.u-blox.com:2102/EU'); "
|
|
595
|
-
f"If cliinput = {INPUT_MQTT_SPARTN}, format = full url "
|
|
596
|
-
"(e.g. 'https://pp.services.u-blox.com:8883/eu', where /path signifies region); "
|
|
597
560
|
f"If cliinput = {INPUT_SERIAL}, format = port@baudrate (e.g. '/dev/tty.ACM1@38400'); "
|
|
598
561
|
f"If cliinput = {INPUT_FILE}, format = file name (e.g. '/home/myuser/ubxconfig.ubx'). "
|
|
599
562
|
"NB: gnssstreamer will have exclusive use of any serial port."
|
|
@@ -1355,7 +1355,7 @@ def format_licenseofuse(lou: str = "") -> str:
|
|
|
1355
1355
|
|
|
1356
1356
|
if lou == "":
|
|
1357
1357
|
return ""
|
|
1358
|
-
return f"{
|
|
1358
|
+
return f"{lou:<{DATAWIDTH}}LICENSE OF USE\n"
|
|
1359
1359
|
|
|
1360
1360
|
|
|
1361
1361
|
def format_stationinfo(station: str = "") -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygnssutils
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.7
|
|
4
4
|
Summary: GNSS Command Line Utilities
|
|
5
5
|
Author-email: Steve Smith <semuadmin@semuconsulting.com>
|
|
6
6
|
Maintainer-email: Steve Smith <semuadmin@semuconsulting.com>
|
|
@@ -31,11 +31,10 @@ Requires-Python: >=3.10
|
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
License-File: LICENSE
|
|
33
33
|
Requires-Dist: certifi>=2025.0.0
|
|
34
|
-
Requires-Dist: paho-mqtt>=2.1.0
|
|
35
34
|
Requires-Dist: pyserial>=3.5
|
|
36
35
|
Requires-Dist: pyspartn>=1.0.8
|
|
37
36
|
Requires-Dist: pyubx2>=1.3.6
|
|
38
|
-
Requires-Dist: pynmeagps>=1.1.
|
|
37
|
+
Requires-Dist: pynmeagps>=1.1.7
|
|
39
38
|
Requires-Dist: pysbf2>=1.0.4
|
|
40
39
|
Requires-Dist: pyubxutils>=1.0.6
|
|
41
40
|
Requires-Dist: pyqgc>=1.0.0
|
|
@@ -51,7 +50,6 @@ pygnssutils
|
|
|
51
50
|
[gnssstreamer CLI](#gnssstreamer) |
|
|
52
51
|
[gnssserver CLI](#gnssserver) |
|
|
53
52
|
[gnssntripclient CLI](#gnssntripclient) |
|
|
54
|
-
[gnssmqttclient CLI](#gnssmqttclient) |
|
|
55
53
|
[socketserver](#socketserver) |
|
|
56
54
|
[RINEX Conversion](#rinexconvert) |
|
|
57
55
|
[RTK Demonstration](#rtkdemo) |
|
|
@@ -71,17 +69,14 @@ pygnssutils is an original series of Python GNSS utility classes and CLI tools b
|
|
|
71
69
|
|
|
72
70
|
Originally developed in support of the [PyGPSClient](https://github.com/semuconsulting/PyGPSClient) GUI GNSS application, the utilities provided by pygnssutils can also be used in their own right:
|
|
73
71
|
|
|
74
|
-
1. `GNSSReader` class. This is essentially an amalgamation of the `*Reader` classes in all the subsidiary parsers listed above, allowing the user to seamlessly stream any of NMEA, UBX, SBF, UNI, QGC
|
|
72
|
+
1. `GNSSReader` class. This is essentially an amalgamation of the `*Reader` classes in all the subsidiary parsers listed above, allowing the user to seamlessly stream any of NMEA, UBX, SBF, UNI, QGC and RTCM3 message protocols concurrently from a single stream.
|
|
75
73
|
1. `GNSSStreamer` class and its associated [`gnssstreamer`](#gnssstreamer) (*formerly `gnssdump`*) CLI utility. This is essentially a configurable bidirectional input/output wrapper around the `GNSSReader` class with flexible message formatting, filtering and output handling options for NMEA, UBX, SBF, UNI, QGC and RTCM3 protocols.
|
|
76
74
|
1. `GNSSSocketServer` class and its associated [`gnssserver`](#gnssserver) CLI utility. This implements a TCP Socket Server for GNSS data streams which is also capable of being run as a simple NTRIP Server/Caster.
|
|
77
75
|
1. `GNSSNTRIPClient` class and its associated [`gnssntripclient`](#gnssntripclient) CLI utility. This implements
|
|
78
76
|
a simple NTRIP Client which receives RTCM3 or SPARTN correction data from an NTRIP Server and (optionally) sends this to a
|
|
79
77
|
designated output stream.
|
|
80
|
-
1. `GNSSMQTTClient` class and its associated [`gnssmqttclient`](#gnssmqttclient) CLI utility. This implements
|
|
81
|
-
a simple SPARTN IP (MQTT) Client which receives SPARTN correction data from an SPARTN IP location service and (optionally) sends this to a
|
|
82
|
-
designated output stream.
|
|
83
78
|
1. `SocketServer` class based on the native Python `ThreadingTCPServer`. Capable of operating in two modes - Socket Server or NTRIP Caster. Provides two alternate client request handler classes - `ClientHandler` (HTTP) or `ClientHandlerTLS` (HTTPS).
|
|
84
|
-
1. `RinexConverter` class and its associated [`pyrinexconv`](#rinexconvert) CLI utility. This implements a binary GNSS data log file to RINEX text file conversion facility. **NB: RINEX conversion is currently an experimental
|
|
79
|
+
1. `RinexConverter` class and its associated [`pyrinexconv`](#rinexconvert) CLI utility. This implements a binary GNSS data log file to RINEX text file conversion facility. **NB: RINEX conversion is currently an experimental feature (*contributions and feedback welcome*)**
|
|
85
80
|
|
|
86
81
|
The pygnssutils homepage is located at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils).
|
|
87
82
|
|
|
@@ -97,7 +92,7 @@ The pygnssutils homepage is located at [https://github.com/semuconsulting/pygnss
|
|
|
97
92
|
|
|
98
93
|
Sphinx API Documentation in HTML format is available at [https://www.semuconsulting.com/pygnssutils](https://www.semuconsulting.com/pygnssutils).
|
|
99
94
|
|
|
100
|
-
Contributions welcome - please refer to [CONTRIBUTING.MD](https://github.com/semuconsulting/pygnssutils/blob/main/CONTRIBUTING.md).
|
|
95
|
+
Contributions **_from human beings_** welcome - please refer to [CONTRIBUTING.MD](https://github.com/semuconsulting/pygnssutils/blob/main/CONTRIBUTING.md).
|
|
101
96
|
|
|
102
97
|
[Bug reports](https://github.com/semuconsulting/pygnssutils/blob/main/.github/ISSUE_TEMPLATE/bug_report.md) and [Feature requests](https://github.com/semuconsulting/pygnssutils/blob/main/.github/ISSUE_TEMPLATE/feature_request.md) - please use the templates provided. For general queries and advice, post a message to one of the [pygnssutils Discussions](https://github.com/semuconsulting/pygnssutils/discussions) channels.
|
|
103
98
|
|
|
@@ -182,7 +177,6 @@ class pygnssutils.gnssstreamer.GNSSStreamer(**kwargs)
|
|
|
182
177
|
- 0 = none (default)
|
|
183
178
|
- 1 = RTK NTRIP RTCM caster
|
|
184
179
|
- 2 = RTK NTRIP SPARTN caster
|
|
185
|
-
- 3 = RTK MQTT SPARTN source (see [gnssmqttclient](#gnssmqttclient) for MQTT client configuration details)
|
|
186
180
|
- 4 = serial port
|
|
187
181
|
- 5 = binary file.
|
|
188
182
|
|
|
@@ -472,41 +466,6 @@ gnssntripclient -h
|
|
|
472
466
|
|
|
473
467
|
Refer to the [Sphinx API documentation](https://www.semuconsulting.com/pygnssutils/pygnssutils.html#module-pygnssutils.gnssntripclient) for further details.
|
|
474
468
|
|
|
475
|
-
---
|
|
476
|
-
## <a name="gnssmqttclient">GNSSMQTTClient and gnssmqttclient CLI</a>
|
|
477
|
-
```
|
|
478
|
-
class pygnssutils.gnssmqttclient.GNSSMQTTClient(app=None, **kwargs)
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
The `GNSSMQTTClient` class provides a basic SPARTN IP (MQTT) Client capability and forms the basis of a [`gnssmqttclient`](#gnssmqttclient) CLI utility. It receives RTK correction data from a SPARTN IP (MQTT) location service (e.g. the u-blox / Thingstream PointPerfect service) and (optionally) sends this to a designated output stream.
|
|
482
|
-
|
|
483
|
-
### CLI Usage:
|
|
484
|
-
|
|
485
|
-
The `clientid` provided by the location service may be set as environment variable `MQTTCLIENTID`. If this environment variable is set and the TLS certificate (\*.crt) and key (\*.pem) files provided by the location service are placed in the user's `HOME` directory, the utility can use these as default settings and may be invoked without any arguments.
|
|
486
|
-
|
|
487
|
-
Assuming the Python 3 scripts (bin) directory is in your PATH, the CLI utility may be invoked from the shell thus (press CTRL-C to terminate):
|
|
488
|
-
|
|
489
|
-
```shell
|
|
490
|
-
gnssmqttclient --clientid yourclientid --server pp.services.u-blox.com --port 8883 --region eu --mode 0 --topic_ip 1 --topic_mga 1 --topic_key 1 --tlscrt '/Users/{your-user}/device-{your-clientid}-pp-cert.crt' --tlskey '/Users/{your-user}/device-{your-client-id}-pp-key.pem'} --spartndecode 0 --clioutput 0 --verbosity 2
|
|
491
|
-
```
|
|
492
|
-
```
|
|
493
|
-
2024-08-15 09:14:50.544 - INFO - pygnssutils.gnssmqttclient - Starting MQTT client with arguments {'server': 'pp.services.u-blox.com', 'port': 8883, 'clientid': 'your-client-id', 'region': 'eu', 'mode': 0, 'topic_ip': 1, 'topic_mga': 1, 'topic_key': 1, 'tlscrt': '/Users/myuser/device-your-client-id-pp-cert.crt', 'tlskey': '/Users/myuser/device-your-client-id-pp-key.pem', 'spartndecode': 0, 'output': None}.
|
|
494
|
-
2024-08-15 09:14:50.840 - INFO - pygnssutils.gnssmqttclient - RXM-SPARTN-KEY
|
|
495
|
-
2024-08-15 09:14:50.854 - INFO - pygnssutils.gnssmqttclient - MGA-INI-TIME-UTC
|
|
496
|
-
2024-08-15 09:14:50.858 - INFO - pygnssutils.gnssmqttclient - MGA-GPS-EPH
|
|
497
|
-
...
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
Command line arguments can be stored in a configuration file and invoked using the `-C` or `--config` argument. The location of the configuration file can be set in environment variable `GNSSMQTTCLIENT_CONF`.
|
|
501
|
-
|
|
502
|
-
For help and full list of optional arguments, type:
|
|
503
|
-
|
|
504
|
-
```shell
|
|
505
|
-
gnssmqttclient -h
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
Refer to the [pyspartn documentation](https://github.com/semuconsulting/pyspartn?tab=readme-ov-file#reading) for further details on decrypting encrypted (`eaf=1`) SPARTN payloads.
|
|
509
|
-
|
|
510
469
|
---
|
|
511
470
|
## <a name="socketserver">SocketServer</a>
|
|
512
471
|
|
|
@@ -5,8 +5,6 @@ src/pygnssutils/__init__.py
|
|
|
5
5
|
src/pygnssutils/_version.py
|
|
6
6
|
src/pygnssutils/exceptions.py
|
|
7
7
|
src/pygnssutils/globals.py
|
|
8
|
-
src/pygnssutils/gnssmqttclient.py
|
|
9
|
-
src/pygnssutils/gnssmqttclient_cli.py
|
|
10
8
|
src/pygnssutils/gnssntripclient.py
|
|
11
9
|
src/pygnssutils/gnssntripclient_cli.py
|
|
12
10
|
src/pygnssutils/gnssreader.py
|
|
@@ -15,7 +13,6 @@ src/pygnssutils/gnssserver_cli.py
|
|
|
15
13
|
src/pygnssutils/gnssstreamer.py
|
|
16
14
|
src/pygnssutils/gnssstreamer_cli.py
|
|
17
15
|
src/pygnssutils/helpers.py
|
|
18
|
-
src/pygnssutils/mqttmessage.py
|
|
19
16
|
src/pygnssutils/rawnav.py
|
|
20
17
|
src/pygnssutils/rawnav_reader.py
|
|
21
18
|
src/pygnssutils/rawnav_subframes_bds.py
|
|
@@ -55,11 +55,6 @@ class StreamTest(unittest.TestCase):
|
|
|
55
55
|
res = res.stdout.decode("utf-8")
|
|
56
56
|
self.assertEqual(res[0:22], "usage: gnssntripclient")
|
|
57
57
|
|
|
58
|
-
def testsmqttlient(self):
|
|
59
|
-
res = run(["gnssmqttclient", "-h"], stdout=PIPE, check=False)
|
|
60
|
-
res = res.stdout.decode("utf-8")
|
|
61
|
-
self.assertEqual(res[0:21], "usage: gnssmqttclient")
|
|
62
|
-
|
|
63
58
|
|
|
64
59
|
if __name__ == "__main__":
|
|
65
60
|
# import sys;sys.argv = ['', 'Test.testName']
|
|
@@ -29,7 +29,6 @@ from pygnssutils.helpers import (
|
|
|
29
29
|
parse_config,
|
|
30
30
|
parse_url,
|
|
31
31
|
)
|
|
32
|
-
from pygnssutils.mqttmessage import MQTTMessage
|
|
33
32
|
from tests.test_sourcetable import TESTSRT
|
|
34
33
|
from pygnssutils.gnssreader import GNSSMessage
|
|
35
34
|
|
|
@@ -172,23 +171,6 @@ class StaticTest(unittest.TestCase):
|
|
|
172
171
|
self.assertEqual("IPv4", ipprot2str(AF_INET))
|
|
173
172
|
self.assertEqual("IPv6", ipprot2str(AF_INET6))
|
|
174
173
|
|
|
175
|
-
def testparsemqttfreq(self): # test MQTTMessage constructor
|
|
176
|
-
topic = "/pp/frequencies/Lb"
|
|
177
|
-
payload = b'{\n "frequencies": {\n "us": {\n "current": {\n "value": "1556.29"\n }\n },\n "eu": {\n "current": {\n "value": "1545.26"\n }\n }\n }\n}'
|
|
178
|
-
parsed = MQTTMessage(topic, payload=payload)
|
|
179
|
-
self.assertEqual(
|
|
180
|
-
str(parsed),
|
|
181
|
-
"<MQTT(/PP/FREQUENCIES/LB, frequencies_us_current_value=1556.29, frequencies_eu_current_value=1545.26)>",
|
|
182
|
-
)
|
|
183
|
-
payload2 = b'{\n "frequencies": {\n "us": {\n "current": {\n "value": {"msb": "1556.29", "lsb": "0.645"}\n }\n },\n "eu": {\n "current": {\n "value": "1545.26"\n }\n },\n "jp": {\n "current": {\n "value": "1548.23"\n }\n }\n}\n}'
|
|
184
|
-
parsed = MQTTMessage(topic, payload=payload2)
|
|
185
|
-
self.assertEqual(
|
|
186
|
-
str(parsed),
|
|
187
|
-
"<MQTT(/PP/FREQUENCIES/LB, frequencies_us_current_value_msb=1556.29, frequencies_us_current_value_lsb=0.645, frequencies_eu_current_value=1545.26, frequencies_jp_current_value=1548.23)>",
|
|
188
|
-
)
|
|
189
|
-
with self.assertRaises(ValueError):
|
|
190
|
-
MQTTMessage(topic, payload=b"arsebiscuits")
|
|
191
|
-
|
|
192
174
|
def testparseconfig(self):
|
|
193
175
|
EXPECTED_RESULT = {
|
|
194
176
|
"filename": "pygpsdata-MIXED3.log",
|