Skip to content

Commit 3882ddd

Browse files
authored
Merge pull request #4 from semuconsulting/RC-1.0.1
RC 1.0.1
2 parents b3ed8c7 + 1237f6c commit 3882ddd

File tree

14 files changed

+587
-32
lines changed

14 files changed

+587
-32
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"python.defaultInterpreterPath": "python3",
66
"modulename": "${workspaceFolderBasename}",
77
"distname": "${workspaceFolderBasename}",
8-
"moduleversion": "1.0.0"
8+
"moduleversion": "1.0.1"
99
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
"Sort Imports",
199199
"Format",
200200
"Pylint",
201-
//"Test",
201+
"Test",
202202
"Build",
203203
"Sphinx HTML"
204204
],

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ pyubxutils
44
[Current Status](#currentstatus) |
55
[Installation](#installation) |
66
[ubxsimulator](#ubxsimulator) |
7+
[ubxsave CLI](#ubxsave) |
8+
[ubxload CLI](#ubxload) |
9+
[ubxbase CLI](#ubxbase) |
710
[ubxsetrate CLI](#ubxsetrate) |
811
[ubxcompare CLI](#ubxcompare) |
912
[Graphical Client](#gui) |
@@ -16,6 +19,7 @@ pyubxutils is an original series of Python u-blox ™ UBX © protocol utility cl
1619
1. [`ubxsimulator`](#ubxsimulator) utility. This provides a basic simulation of a GNSS receiver serial stream by generating synthetic UBX or NMEA messages based on parameters defined in a json configuration file.
1720
1. [`ubxsave`](#ubxsave) CLI utility. This saves a complete set of configuration data from any Generation 9+ u-blox device (e.g. NEO-M9N or ZED-F9P) to a file. The file can then be reloaded to any compatible device using the `ubxload` utility.
1821
1. [`ubxload`](#ubxload) CLI utility. This reads a file containing binary configuration data and loads it into any compatible Generation 9+ u-blox device (e.g. NEO-M9N or ZED-F9P).
22+
1. [`ubxbase`](#ubxbase) CLI utility. A utility which configures compatible u-blox GNSS receivers (e.g. ZED-F9P) as RTK base stations, using either Fixed or Survey-In timing modes.
1923
1. [`ubxsetrate`](#ubxsetrate) CLI utility. A simple utility which sets NMEA or UBX message rates on u-blox GNSS receivers.
2024
1. [`ubxcompare`](#ubxcompare) CLI utility. Utility for comparing two or more u-blox config files in either text (\*.txt) or binary (\*.ubx) format. Output files from the `ubxsave` utility can be used as input files.
2125

@@ -118,7 +122,7 @@ Command line arguments can be stored in a configuration file and invoked using t
118122
*GENERATION 9+ DEVICES ONLY (e.g. NEO-M9N or ZED-F9P)*
119123

120124
```
121-
class pyubxutils.ubxconfig.UBXSaver(file, stream, **kwargs)
125+
class pyubxutils.ubxsave.UBXSaver(file, stream, **kwargs)
122126
```
123127

124128
CLI utility which saves Generation 9+ UBX device configuration data to a file. `ubxsave` polls configuration data via the device's serial port using a series of CFG-VALGET poll messages. It parses the responses to these polls, converts them to CFG-VALSET command messages and saves these to a binary file. This binary file can then be loaded into any compatible UBX device (e.g. via the `ubxload` utility) to restore the saved configuration.
@@ -145,7 +149,7 @@ ubxsave -h
145149
*GENERATION 9+ DEVICES ONLY (e.g. NEO-M9N or ZED-F9P)*
146150

147151
```
148-
class pyubxutils.ubxconfig.UBXLoader(file, stream, **kwargs)
152+
class pyubxutils.ubxload.UBXLoader(file, stream, **kwargs)
149153
```
150154

151155
CLI utility which loads UBX configuration (CFG-VALSET) data from a binary file (e.g. one created by the `ubxsave` utility) and loads it into the volatile memory (RAM) of a compatible Generation 9+ UBX device via its serial port. It then awaits acknowledgements to this data and reports any errors.
@@ -162,11 +166,34 @@ For help and full list of optional arguments, type:
162166
ubxload -h
163167
```
164168

169+
---
170+
## <a name="ubxbase">ubxbase CLI</a>
171+
172+
*RTK-COMPATIBLE GENERATION 9+ DEVICES ONLY (e.g. ZED-F9P)*
173+
174+
```
175+
class pyubxutils.ubxbase.UBXBase(file, stream, **kwargs)
176+
```
177+
178+
CLI utility which configures a compatible u-blox receiver to RTK base station mode, using either Fixed or Survey-In timing modes.
179+
180+
### CLI Usage:
181+
182+
```shell
183+
ubxbase -P /dev/ttyACM0 --timemode 2 --fixedpos 37.2334512,-115.8151357,18226.4 --postype 1 --acclimit 10 --waittime 5
184+
```
185+
186+
For help and full list of optional arguments, type:
187+
188+
```shell
189+
ubxbase -h
190+
```
191+
165192
---
166193
## <a name="ubxsetrate">ubxsetrate CLI</a>
167194

168195
```
169-
class pyubxutils.ubxconfig.UBXSetRate(**kwargs)
196+
class pyubxutils.ubxsetrate.UBXSetRate(**kwargs)
170197
```
171198

172199
A simple CLI utility to set NMEA or UBX message rates on u-blox receivers via a serial port.

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# pyubxutils Release Notes
22

3+
### RELEASE 1.0.1
4+
5+
ENHANCEMENTS:
6+
7+
1. Add `ubxbase` utility to configure compatible u-blox receiver (e.g. ZED-F9P) to Base Station mode. Type `ubxbase -h` for help.
8+
39
### RELEASE 1.0.0
410

511
CHANGES:

docs/pyubxutils.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ pyubxutils.helpers module
2828
:undoc-members:
2929
:show-inheritance:
3030

31+
pyubxutils.ubxbase module
32+
-------------------------
33+
34+
.. automodule:: pyubxutils.ubxbase
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
3139
pyubxutils.ubxcompare module
3240
----------------------------
3341

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "pyubxutils"
77
authors = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
88
maintainers = [{ name = "semuadmin", email = "semuadmin@semuconsulting.com" }]
99
description = "UBX Protocol Command Line Utilities"
10-
version = "1.0.0"
10+
version = "1.0.1"
1111
license = { file = "LICENSE" }
1212
readme = "README.md"
1313
requires-python = ">=3.9"
@@ -41,6 +41,7 @@ ubxsave = "pyubxutils.ubxsave:main"
4141
ubxload = "pyubxutils.ubxload:main"
4242
ubxsimulator = "pyubxutils.ubxsimulator_cli:main"
4343
ubxcompare = "pyubxutils.ubxcompare:main"
44+
ubxbase = "pyubxutils.ubxbase:main"
4445

4546
[project.urls]
4647
homepage = "https://github.com/semuconsulting/pyubxutils"

src/pyubxutils/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
:license: BSD 3-Clause
99
"""
1010

11-
__version__ = "1.0.0"
11+
__version__ = "1.0.1"

src/pyubxutils/helpers.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import logging
1414
import logging.handlers
1515
from argparse import ArgumentParser
16+
from math import trunc
1617
from os import getenv
1718

1819
from pyubxutils.globals import (
@@ -172,3 +173,35 @@ def progbar(i: int, lim: int, inc: int = 50):
172173
f"{int(pct*100/inc):02}% " + "\u2593" * pct + "\u2591" * (inc - pct),
173174
end="\r",
174175
)
176+
177+
178+
def h2sphp(val: float) -> tuple:
179+
"""
180+
Split height in cm into standard (cm) and high (mm * 10)
181+
precision components.
182+
183+
e.g. 123456.78 -> 123456, 78
184+
185+
:param val: decimal lat/lon value
186+
:return: tuple of integers
187+
:rtype: tuple
188+
"""
189+
190+
sp = trunc(val)
191+
hp = int(round((val - sp) * 100, 0))
192+
return sp, hp
193+
194+
195+
def ll2sphp(val: float) -> tuple:
196+
"""
197+
Split lat/lon into standard (1-7 dp) and high (8-9 dp)
198+
precision components.
199+
200+
e.g. 51.123456789 -> 511234567, 89
201+
202+
:param val: decimal height value in cm
203+
:return: tuple of integers
204+
:rtype: tuple
205+
"""
206+
207+
return h2sphp(val * 1e7)

0 commit comments

Comments
 (0)