pyubxutils

Python UBX GNSS device command line utilities

https://github.com/semuconsulting/pyubxutils

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Python UBX GNSS device command line utilities

Basic Info
  • Host: GitHub
  • Owner: semuconsulting
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Size: 72.3 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Security

README.md

pyubxutils

Current Status | Installation | ubxsimulator | ubxsave CLI | ubxload CLI | ubxbase CLI | ubxsetrate CLI | ubxcompare CLI | Graphical Client | Author & License

pyubxutils is an original series of Python u-blox ™ UBX © protocol utility classes and CLI tools built around the following core libraries from the same stable:

  • pyubx2 - UBX parsing and generation library
  1. 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.
  2. 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.
  3. 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).
  4. 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.
  5. ubxsetrate CLI utility. A simple utility which sets NMEA or UBX message rates on u-blox GNSS receivers.
  6. 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.

The pyubxutils homepage is located at https://github.com/semuconsulting/pyubxutils.

This is an independent project and we have no affiliation whatsoever with u-blox.

Current Status

Status Release Build Release Date Last Commit Contributors Open Issues

Sphinx API Documentation in HTML format is available at https://www.semuconsulting.com/pyubxutils.

Contributions welcome - please refer to CONTRIBUTING.MD.

Bug reports and Feature requests - please use the templates provided. For general queries and advice, post a message to one of the pyubxutils Discussions channels.


Installation

Python version PyPI version PyPI downloads

pyubxutils is compatible with Python 3.9-3.13.

In the following, python3 & pip refer to the Python 3 executables. You may need to substitute python for python3, depending on your particular environment (on Windows it's generally python). It is strongly recommended that the Python 3 binaries (\Scripts or /bin) and site_packages directories are included in your PATH (most standard Python 3 installation packages will do this automatically if you select the 'Add to PATH' option during installation).

The recommended way to install the latest version of pyubxutils is with pip:

shell python3 -m pip install --upgrade pyubxutils

If required, pyubxutils can also be installed into a virtual environment, e.g.:

shell python3 -m pip install --user --upgrade virtualenv python3 -m virtualenv env source env/bin/activate (or env\Scripts\activate on Windows) python3 -m pip install --upgrade pyubxutils ... deactivate

For Conda users, pyubxutils is also available from conda forge:

Anaconda-Server Badge Anaconda-Server Badge

shell conda install -c conda-forge pyubxutils


ubxsimulator utility

EXPERIMENTAL

Provides a simple simulation of a GNSS serial stream by generating synthetic UBX or NMEA messages based on parameters defined in a json configuration file. Can simulate a motion vector based on a specified course over ground and speed. Location of configuration file can be set via environment variable UBXSIMULATOR.

Example usage:

shell ubxsimulator --simconfigfile "/home/myuser/ubxsimulator.json" --interval 1000 --timeout 3 --verbosity 3

```python from os import getenv from pyubxutils import UBXSimulator, UBXSIMULATOR from pyubx2 import UBXReader

with UBXSimulator( configfile=getenv(UBXSIMULATOR, "/home/myuser/ubxsimulator.json"), interval=1000, timeout=3, ) as stream: ubr = UBXReader(stream) for raw, parsed in ubr: print(parsed) ```

Generates mock acknowledgements (ACK-ACK) for valid incoming UBX or TTY (AT+) commands and polls.

See sample ubxsimulator.json configuration file in the \examples folder, and the Sphinx API documentation.

NB: Principally intended for testing Python GNSS application functionality. There is currently no attempt to simulate real-world satellite geodetics, though this could be done using e.g. the Python skyfield library and the relevant satellite TLE (orbital elements) data. We may look into adding such functionality as and when time permits. Contributions welcome.

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 UBXSIMULATOR_CONF.


ubxsave CLI

GENERATION 9+ DEVICES ONLY (e.g. NEO-M9N or ZED-F9P)

class pyubxutils.ubxsave.UBXSaver(file, stream, **kwargs)

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.

The CFG-VALSET commands are stored as a single transaction. If one or more fails on reload, the entire set will be rejected.

NB: The utility relies on receiving a complete set of poll responses within a specified waittime. If the device is exceptionally busy or the transmit buffer is full, poll responses may be delayed or dropped altogether. If the utility reports errors, try increasing the waittime.

CLI Usage:

shell ubxsave --port /dev/ttyACM1 --baudrate 9600 --timeout 0.02 --outfile ubxconfig.ubx --verbosity 1

For help and full list of optional arguments, type:

shell ubxsave -h


ubxload CLI

GENERATION 9+ DEVICES ONLY (e.g. NEO-M9N or ZED-F9P)

class pyubxutils.ubxload.UBXLoader(file, stream, **kwargs)

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.

CLI Usage:

shell ubxload --port /dev/ttyACM1 --baudrate 9600 --timeout 0.05 --infile ubxconfig.ubx --verbosity 1

For help and full list of optional arguments, type:

shell ubxload -h


ubxbase CLI

RTK-COMPATIBLE GENERATION 9+ DEVICES ONLY (e.g. ZED-F9P)

class pyubxutils.ubxbase.UBXBase(file, stream, **kwargs)

CLI utility which configures a compatible u-blox receiver to RTK base station mode, using either Fixed or Survey-In timing modes.

CLI Usage:

shell ubxbase -P /dev/ttyACM0 --timemode 2 --fixedpos 37.2334512,-115.8151357,18226.4 --postype 1 --acclimit 10 --waittime 5

For help and full list of optional arguments, type:

shell ubxbase -h


ubxsetrate CLI

class pyubxutils.ubxsetrate.UBXSetRate(**kwargs)

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

CLI Usage:

Assuming the Python 3 scripts (bin) directory is in your PATH, the CLI utility may be invoked from the shell thus:

This example sets the UBX NAV-HPPOSLLH message rate to 1:

shell ubxsetrate --port /dev/ttyACM0 --baudrate 38400 --msgClass 0x01 --msgID 0x14 --rate 1 ``` Opening serial port /dev/ttyACM0 @ 38400 baud...

Sending configuration message ...

Configuration message sent. ```

Refer to pyubx2 documentation for available msgClass and msgID values. msgClass and msgID can be specified in either integer or hexadecimal formats.

Alternatively, the msgClass keyword can be set to one of the following group values (in which case the msgID keyword can be omitted): - "allubx" - set rate for all available UBX NAV messages - "minubx" - set rate for a minimum set of UBX NAV messages (NAV-PVT, NAV-SAT) - "allnmea" - set rate for all available NMEA messages - "minnmea" - set rate for a minimum set of NMEA messages (GGA, GSA, GSV, RMC, VTG)

For help and full list of optional arguments, type:

shell ubxsetrate -h


ubxcompare CLI

class pyubxutils.ubxcompare.UBXCompare(infiles, form, diffsonly)

A simple CLI utility for comparing the contents of two or more u-blox configuration files. Files can be in text (*.txt) format (as used by u-center or ArduSimple) or binary (*.ubx) format (as used by PyGPSClient or ubxsave).

e.g.

shell ubxcompare --infiles "simpleRTK2B_FW132_Rover_1Hz-00.txt, simpleRTK2B_FW132_Rover_10Hz-00.txt" --format 0 --diffsonly 1 ``` 24 configuration commands processed in simpleRTK2BFW132Rover_1Hz-00.txt

24 configuration commands processed in simpleRTK2BFW132Rover_10Hz-00.txt

2 files processed, list of differences in config keys and their values follows:

CFGMSGOUTNMEAIDGSAUART1 (DIFFS!): {1: '1', 2: '0'} CFGMSGOUTNMEAIDGSAUART2 (DIFFS!): {1: '1', 2: '0'} CFGMSGOUTNMEAIDGSVUART1 (DIFFS!): {1: '1', 2: '0'} CFGMSGOUTNMEAIDGSVUART2 (DIFFS!): {1: '1', 2: '0'} CFGRATEMEAS (DIFFS!): {1: '1000', 2: '100'}

Total config keys: 1475. Total differences: 5. ```

For help and full list of optional arguments, type:

shell ubxcompare -h


Author & License Information

semuadmin@semuconsulting.com

License

pyubxutils is maintained entirely by unpaid volunteers. It receives no funding from advertising or corporate sponsorship. If you find the utility useful, please consider sponsoring the project with the price of a coffee...

Sponsor

Owner

  • Name: SEMU Consulting
  • Login: semuconsulting
  • Kind: organization

Citation (CITATION.bib)

@Misc{pyubxutils,
  author       = {{SEMU Consulting}},
  howpublished = {GitHub repository},
  note         = {Viewed last: xxxx:xx:xx},
  title        = {Python library for reading, parsing and generating NMEA, UBX and RTCM3 GNSS messages},
  year         = {2022},
  url          = {https://github.com/semuconsulting/pyubxutils},
}

GitHub Events

Total
  • Release event: 4
  • Watch event: 3
  • Delete event: 3
  • Push event: 17
  • Pull request review event: 3
  • Pull request event: 5
  • Create event: 9
Last Year
  • Release event: 4
  • Watch event: 3
  • Delete event: 3
  • Push event: 17
  • Pull request review event: 3
  • Pull request event: 5
  • Create event: 9

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 11
  • Total Committers: 1
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 11
  • Committers: 1
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
semuadmin 2****n 11

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • semuadmin (5)
Top Labels
Issue Labels
Pull Request Labels
enhancement (3) bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 5,423 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
pypi.org: pyubxutils

UBX Protocol Command Line Utilities

  • Documentation: https://pyubxutils.readthedocs.io/
  • License: BSD 3-Clause License ("BSD License 2.0", "Revised BSD License", "New BSD License", or "Modified BSD License") Copyright (c) 2020, SEMU Consulting All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • Latest release: 1.0.3
    published 11 months ago
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 5,423 Last month
Rankings
Dependent packages count: 10.0%
Average: 33.0%
Dependent repos count: 56.1%
Maintainers (1)
Last synced: 8 months ago

Dependencies

.github/workflows/checkpr.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/main.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
pyproject.toml pypi
  • pyserial >=3.5
  • pyubx2 >=1.2.48