Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc 1.5.2 #174

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Python: Module",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "pygpsclient"
}
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"editor.formatOnSave": true,
"modulename": "pygpsclient",
"distname": "pygpsclient",
"moduleversion": "1.5.1",
"python.defaultInterpreterPath": "python3",
}
22 changes: 12 additions & 10 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@
"type": "process",
"command": "sphinx-apidoc",
"args": [
"--doc-project=${config:modulename}",
"--doc-author=semuadmin",
"--doc-version=${config:moduleversion}",
"--doc-release=${config:moduleversion}",
"--ext-autodoc",
"--ext-viewcode",
"--templatedir=docs",
Expand Down Expand Up @@ -205,29 +201,32 @@
},
{
"label": "Install Wheel",
"type": "process",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
"${workspaceFolder}/dist/${config:distname}-${config:moduleversion}-py3-none-any.whl",
"--user",
"--force-reinstall"
"--force-reinstall",
"*.whl"
],
"options": {
"cwd": "dist"
},
"problemMatcher": []
},
{
"label": "Install Locally",
"type": "process",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": [
"-m",
"pip",
"install",
"${workspaceFolder}/dist/${config:distname}-${config:moduleversion}-py3-none-any.whl",
"--user",
"--force-reinstall"
"--force-reinstall",
"*.whl"
],
"dependsOrder": "sequence",
"dependsOn": [
Expand All @@ -240,6 +239,9 @@
"Build",
"Sphinx HTML"
],
"options": {
"cwd": "dist"
},
"problemMatcher": []
}
]
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ You will need to logout and login for the launcher to take effect.

1. To connect to a GNSS receiver via USB or UART port, select the device from the listbox, set the appropriate serial connection parameters and click
![connect icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/usbport-1-24.png?raw=true). The application will endeavour to pre-select a recognised GNSS/GPS device but this is platform and device dependent. Press the ![refresh](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-refresh-6-16.png?raw=true) button to refresh the list of connected devices at any point. `Rate bps` (baud rate) is typically the only setting that might need adjusting, but tweaking the `timeout` setting may improve performance on certain platforms. The `Msg Mode` parameter defaults to `GET` i.e., periodic or poll response messages *from* a receiver. If you wish to parse streams of command or poll messages being sent *to* a receiver, set the `Msg Mode` to `SET` or `POLL`. An optional serial or socket stream inactivity timeout can also be set (in seconds; 0 = no timeout).
1. A custom user-defined serial port can also be passed via the json configuration file setting `"userport_s":`, via environment variable `PYGPSCLIENT_USERPORT` or as a command line argument `--userport`. A special userport value of "ubxsimulator" invokes the experimental [`pygnssutils.UBXSimulator`](https://github.com/semuconsulting/pygnssutils/blob/main/src/pygnssutils/ubxsimulator.py) utility to emulate a GNSS NMEA/UBX serial stream.
1. A custom user-defined serial port can also be passed via the json configuration file setting `"userport_s":`, via environment variable `PYGPSCLIENT_USERPORT` or as a command line argument `--userport`. A special userport value of "ubxsimulator" invokes the experimental [`pyubxutils.UBXSimulator`](https://github.com/semuconsulting/pyubxutils/blob/main/src/pyubxutils/ubxsimulator.py) utility to emulate a GNSS NMEA/UBX serial stream.
1. To connect to a TCP or UDP socket, enter the server URL and port, select the protocol (defaults to TCP) and click
![connect socket icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/ethernet-1-24.png?raw=true).
1. To stream from a previously-saved <a name="filestream">binary datalog file</a>, click
Expand Down Expand Up @@ -281,7 +281,7 @@ You will need to logout and login for the launcher to take effect.
|![sysmon widget](https://github.com/semuconsulting/PyGPSClient/blob/master/images/sysmon_widget.png?raw=true)| System Monitor widget showing device cpu, memory and I/O utilisation (*GNSS receiver must be capable of outputting UBX MON-SYS and/or MON-COMMS messages*). Tick checkbox to toggle between actual (cumulative) I/O stats and pending I/O. |
|![scatterplot widget](https://github.com/semuconsulting/PyGPSClient/blob/master/images/scatterplot_widget.png?raw=true)| Scatterplot widget showing variability in position reporting over time. (Optional) Enter fixed reference position. Select Average to center plot on dynamic average position (*displayed at top left*), or Fixed to center on fixed reference position (*if entered*). Check Autorange to set plot range automatically. Set the update interval (e.g. 4 = every 4th navigation solution). Use the range slider or mouse wheel to adjust plot range. Right-click to set fixed reference point to the current mouse cursor position. Double-click to clear the existing data. Settings may be saved to a json configuration file. |
|![rover widget](https://github.com/semuconsulting/PyGPSClient/blob/master/images/rover_widget.png?raw=true) | Rover widget plots the relative 2D position, track and status information for the roving receiver in a fixed or moving base / rover RTK configuration. Can also display relative position of NTRIP mountpoint and receiver in a static RTK configuration. Double-click to clear existing plot. (*GNSS rover receiver must be capable of outputting UBX NAV-RELPOSNED messages.*) |
|![chart view](https://github.com/semuconsulting/PyGPSClient/blob/master/images/chart_widget.png?raw=true) | Chart widget acts as a multi-channel "oscilloscope", allowing the user to plot a series of named numeric data attributes from any NMEA, UBX, RTCM or SPARTN data source, with configurable y (value) and x (time) axes. By default, the number of channels is set to 4, but this can be manually edited by the user via the json configuration file setting `chartsettings_d["numchn_n"]`. For each channel, user can select: (*optional*) identity of message source e.g. `NAV-PVT`; attribute name e.g. `hAcc`; scaling factor (divisor) e.g. 1000; y axis range e.g. 0 - 5. Wildcards are available for attribute groups - "\*" (average of group values), "+" (maximum of group values), "-" (minimum of group values) e.g. `cno*` will plot the average `cno` value for a group of satellites. Double-click to clear the existing data. Double-right-click to save the current chart data to the clipboard in CSV format. Settings may be saved to a json configuration file. |
|![chart view](https://github.com/semuconsulting/PyGPSClient/blob/master/images/chart_widget.png?raw=true) | Chart widget acts as a multi-channel "plotter", allowing the user to plot a series of named numeric data attributes from any NMEA, UBX, RTCM or SPARTN data source, with configurable y (value) and x (time) axes. By default, the number of channels is set to 4, but this can be manually edited by the user via the json configuration file setting `chartsettings_d["numchn_n"]`. For each channel, user can select: (*optional*) identity of message source e.g. `NAV-PVT`; attribute name e.g. `hAcc`; scaling factor (divisor) e.g. 1000; y axis range e.g. 0 - 5. Wildcards are available for attribute groups - "\*" (average of group values), "+" (maximum of group values), "-" (minimum of group values) e.g. `cno*` will plot the average `cno` value for a group of satellites. Double-click to clear the existing data. Double-right-click to save the current chart data to the clipboard in CSV format. Settings may be saved to a json configuration file. |
---
## <a name="ubxconfig">UBX Configuration Facilities</a>

Expand Down Expand Up @@ -443,7 +443,7 @@ Below is a illustrative SPARTN DGPS data log, showing:
## <a name="socketserver">Socket Server / NTRIP Caster Facilities</a>

The Socket Server / NTRIP Caster facility is capable of operating in either of two modes;
1. SOCKET SERVER - an open, unauthenticated TCP socket server available to any socket client including, for example, another instance of PyGPSClient or the [`gnssdump` CLI utility](https://github.com/semuconsulting/pygnssutils#gnssdump). In this mode it will broadcast the host's currently connected GNSS data stream (NMEA, UBX, RTCM3). The default port is 50012.
1. SOCKET SERVER - an open, unauthenticated TCP socket server available to any socket client including, for example, another instance of PyGPSClient or the [`gnssstreamer` CLI utility](https://github.com/semuconsulting/pygnssutils#gnssstreamer). In this mode it will broadcast the host's currently connected GNSS data stream (NMEA, UBX, RTCM3). The default port is 50012.
2. NTRIP CASTER - a simple implementation of an authenticated NTRIP caster available to any NTRIP client including, for example, u-blox's [legacy u-center NTRIP client](https://www.u-blox.com/en/product/u-center), BKG's [NTRIP Client (BNC)](https://igs.bkg.bund.de/ntrip/download), the PyGPSClient NTRIP Client facility or the [`gnssntripclient` CLI utility](https://github.com/semuconsulting/pygnssutils#gnssntripclient). Login credentials for the NTRIP caster are set via the `"ntripcasteruser_s":` and `"ntripcasterpassword_s":` settings in the *.json confirmation file (they can also be set via PyGPSClient command line arguments `--ntripcasteruser`, `--ntripcasterpassword`, or by setting environment variables `NTRIPCASTER_USER`, `NTRIPCASTER_PASSWORD`). Default settings are as follows: bind address: 0.0.0.0, port: 2101, mountpoint: pygnssutils, user: anon, password: password.

By default, the server/caster binds to the host address '0.0.0.0' (IPv4) or '::' (IPv6) i.e. all available IP addresses on the host machine. This can be overridden via the settings panel or a host environment variable `PYGPSCLIENT_BINDADDRESS`. A label on the settings panel indicates the number of connected clients, and the server/caster status is indicated in the topmost banner: running with no clients: ![transmit icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-noclient-10-24.png?raw=true), running with clients: ![transmit icon](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-transmit-10-24.png?raw=true).
Expand Down Expand Up @@ -564,18 +564,19 @@ Multiple commands can be concatenated on a single line. Illustrative examples ar
---
## <a name="cli">Command Line Utilities</a>

The `pygnssutils` library which underpins many of the functions in `PyGPSClient` also incorporates command line versions of these functions:
The `pygnssutils` and `pyubxutils` libraries which underpin many of the functions in `PyGPSClient` also incorporate command line versions of these functions:

1. `gnssdump` CLI utility. This is essentially a configurable input/output wrapper around the [`pyubx2.UBXReader`](https://github.com/semuconsulting/pyubx2#reading) class with flexible message formatting and filtering options for NMEA, UBX and RTCM3 protocols.
1. `gnssstreamer` CLI utility. This is essentially a configurable input/output wrapper around the [`pyubx2.UBXReader`](https://github.com/semuconsulting/pyubx2#reading) class with flexible message formatting and filtering options for NMEA, UBX and RTCM3 protocols.
1. `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.
1. `gnssntripclient` CLI utility. This implements a simple NTRIP Client which receives RTCM3 correction data from an NTRIP Server and (optionally) sends this to a
designated output stream.
1. `gnssmqttclient` CLI utility. This implements a simple SPARTN IP (MQTT) Client which receives SPARTN and UBX correction data from a SPARTN IP location service (e.g. u-blox / Thingstream PointPerfect) and (optionally) sends this to a designated output stream.
1. <a name="ubxsave">`ubxsave` CLI utility</a>. 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.
1. `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).
1. `ubxsetrate` CLI utility. A simple utility which sets NMEA or UBX message rates on u-blox GNSS receivers.
1. `ubxbase` CLI utility. This configures an RTK-compatible UBX receiver (e.g. the ZED-F9P) to operate in Base Station mode.

For further details, refer to the `pygnssutils` homepage at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils).
For further details, refer to the `pygnssutils` homepage at [https://github.com/semuconsulting/pygnssutils](https://github.com/semuconsulting/pygnssutils) or `pyubxutils` homepage at [https://github.com/semuconsulting/pyubxutils](https://github.com/semuconsulting/pyubxutils).

--
## <a name="knownissues">Known Issues</a>
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# PyGPSClient Release Notes

### RELEASE 1.5.2

1. Fix logpath setting in config file - Fixes [#171](https://github.com/semuconsulting/PyGPSClient/issues/171)
1. Add support for pyubxutils.
1. Minor updates to vscode task configurations.

### RELEASE 1.5.1

1. Add new user-selectable and configurable "Chart" widget:
Expand Down
2 changes: 2 additions & 0 deletions pygpsclient.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"unusedsat_b": 0,
"logformat_s": "Binary",
"datalog_b": 0,
"logpath_s": "",
"recordtrack_b": 0,
"trackpath_s": "",
"bpsrate_n": 9600,
"databits_n": 8,
"stopbits_f": 1.0,
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "pygpsclient"
dynamic = ["version"]
authors = [{ name = "semuadmin", email = "[email protected]" }]
maintainers = [{ name = "semuadmin", email = "[email protected]" }]
description = "GNSS Diagnostic and UBX Configuration GUI Application"
version = "1.5.1"
license = { file = "LICENSE" }
keywords = [
"PyGPSClient",
Expand Down Expand Up @@ -53,6 +53,7 @@ dependencies = [
"requests>=2.28.0",
"Pillow>=9.0.0",
"pygnssutils>=1.1.9",
"pyubxutils>=1.0.2",
"pyserial>=3.5",
]

Expand All @@ -79,6 +80,9 @@ test = [
"sphinx-rtd-theme",
]

[tool.setuptools.dynamic]
version = { attr = "pygpsclient._version.__version__" }

[tool.black]
target-version = ['py39']

Expand Down
2 changes: 1 addition & 1 deletion src/pygpsclient/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.5.1"
__version__ = "1.5.2"
13 changes: 8 additions & 5 deletions src/pygpsclient/file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,17 @@ def save_config(self, config: dict, filename: Path = CONFIGFILE) -> str:
except (OSError, json.JSONDecodeError) as err:
return str(err)

def set_logfile_path(self) -> Path:
def set_logfile_path(self, initdir=HOME) -> Path:
"""
Set file path.

:param str initdir: initial directory (HOME)
:return: file path
:rtype: str
"""

self._logpath = filedialog.askdirectory(
title=SAVETITLE, initialdir=HOME, mustexist=True
title=SAVETITLE, initialdir=initdir, mustexist=True
)
if self._logpath in ((), ""):
return None # User cancelled
Expand All @@ -224,6 +225,7 @@ def open_logfile(self):

# pylint: disable=consider-using-with

self._logpath = self.__app.frm_settings.config.get("logpath_s", HOME)
self._lines = 0
_, self._logname = set_filename(self._logpath, "data", "log")
self._logfile = open(self._logname, "a+b")
Expand All @@ -236,7 +238,7 @@ def write_logfile(self, raw_data, parsed_data):
"""

if self._logfile is None:
return
self.open_logfile()

settings = self.__app.frm_settings.config
lfm = settings["logformat_s"]
Expand Down Expand Up @@ -275,16 +277,17 @@ def close_logfile(self):
except IOError:
pass

def set_trackfile_path(self) -> Path:
def set_trackfile_path(self, initdir=HOME) -> Path:
"""
Set track directory.

:param str initdir: initial directory (HOME)
:return: file path
:rtype: str
"""

self._trackpath = filedialog.askdirectory(
title=SAVETITLE, initialdir=HOME, mustexist=True
title=SAVETITLE, initialdir=initdir, mustexist=True
)
if self._trackpath in ((), ""):
return None # User cancelled
Expand Down
Loading
Loading