Skip to content

Commit 76440ef

Browse files
committed
update caster RTCM outputs
1 parent 2178a6b commit 76440ef

25 files changed

Lines changed: 340 additions & 281 deletions

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[TTY Commands](#ttycommands) |
1010
[Load/Save/Record Commands](#recorder) |
1111
[NTRIP Client](#ntripconfig) |
12-
[Socket Server / NTRIP Caster](#socketserver) |
12+
[NTRIP Caster/Socket Server](#socketserver) |
1313
[GPX Track Viewer](#gpxviewer) |
1414
[Mapquest API Key](#mapquestapi) |
1515
[User-defined Presets](#userdefined) |
@@ -108,7 +108,7 @@ For more comprehensive installation instructions, please refer to [INSTALLATION.
108108
3. 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
109109
![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.
110110
- `Rate bps` (baud rate) is typically the only setting that might need adjusting, but tweaking the `timeout` setting may improve performance on certain platforms.
111-
- When the connection is first established, PyGPSClient will send various query messages (*one for each selected protocol*) to the receiver in an attempt to establish its model and firmware version. You may see a handful of 'unknown protocol' warnings in response to some of these queries - these can be disregarded.
111+
- When the connection is first established, PyGPSClient will poll various hardware information messages (*one for each selected protocol*) to the receiver in an attempt to establish its model and firmware version. You may see a handful of 'unknown protocol' warnings in response to some of these queries - these can be disregarded. **NB:** Some receivers will not output hardware information messages at low baud rates (<38,400).
112112
- If you get a permissions error on attempting to connect to a serial port e.g. `[Errno 13] permission denied /dev/ttyACM0`, refer to the [Installation Guidelines - User Privileges](https://github.com/semuconsulting/PyGPSClient/blob/master/INSTALLATION.md#user-privileges).
113113
- 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).
114114
4. 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.
@@ -212,7 +212,7 @@ For more comprehensive installation instructions, please refer to [INSTALLATION.
212212

213213
The UBX Configuration Dialog currently provides the following UBX configuration panels:
214214

215-
1. Version panel shows current device hardware/firmware versions (*via MON-VER and MON-HW polls*).
215+
1. Version panel shows current device hardware/firmware versions (*Double-left-click to refresh*).
216216
1. Protocol Configuration panel (CFG-PRT) sets baud rate and inbound/outbound protocols across all available ports (*legacy protocols only*).
217217
1. Solution Rate panel (CFG-RATE) sets navigation solution interval in ms (e.g. 1000 = 1/second) and measurement ratio (ratio between the number of measurements and the number of navigation solutions, e.g. 5 = five measurements per navigation solution) (*legacy protocols only*).
218218
1. For each of the panels above, clicking anywhere in the panel background will refresh the displayed information with the current configuration.
@@ -240,7 +240,7 @@ warning ![warning icon](https://github.com/semuconsulting/PyGPSClient/blob/maste
240240
**Instructions:**
241241

242242
The NMEA Configuration Dialog currently provides the following NMEA configuration panels:
243-
1. Version panel shows current device hardware/firmware versions (*via PQTMVERNO polls*).
243+
1. Version panel shows current device hardware/firmware versions (*Double-left-click to refresh*).
244244
1. Dynamic configuration panel providing structured updates for supported receivers e.g. Quectel LGSERIES via PQTM* sentences, or LCSERIES via PAIR* sentences. Once a command is selected, the configuration is polled and the current values displayed. The user can then amend these values as required and send the updated configuration. Some polls require input arguments (e.g. portid or msgname) - these are highlighted and will be set at default values initially (e.g. portid = 1), but can be amended by the user and re-polled using the ![refresh](https://github.com/semuconsulting/PyGPSClient/blob/master/src/pygpsclient/resources/iconmonstr-refresh-lined-24.png?raw=true) button.
245245
1. Preset Commands widget supports a variety of user-defined NMEA commands and queries - see [user defined presets](#userdefined).
246246

@@ -257,6 +257,8 @@ warning ![warning icon](https://github.com/semuconsulting/PyGPSClient/blob/maste
257257

258258
![ttydialog screenshot](https://github.com/semuconsulting/PyGPSClient/blob/master/images/tty_dialog.png?raw=true)
259259

260+
Version panel shows current device hardware/firmware versions (*Double-left-click to refresh*).
261+
260262
The TTY Commands dialog provides a facility to send user-defined ASCII TTY configuration commands (e.g. `AT+` style commands) to the connected serial device. Commands can be entered manually or selected from a list of user-defined presets. The dialog can be accessed via the TTY Config button or Menu..Options..TTY Commands.
261263
- CRLF checkbox - if ticked, a CRLF (`b"\x0d\x0a"`) terminator will be added to the command string.
262264
- Echo checkbox - if ticked, outgoing TTY commands will be echoed on the console with the marker `"TTY<<"`.
@@ -356,28 +358,39 @@ By default, the server/caster binds to the host address '0.0.0.0' (IPv4) or '::'
356358

357359
1. Select NTRIP CASTER mode and (if necessary) enter the host IP address and port.
358360
1. Select 'TLS' to enable an encrypted TLS (HTTPS) connection.
359-
1. An additional expandable panel is made available to allow the user to configure a connected RTK-compatible receiver to operate in either `FIXED` or `SURVEY-IN` Base Station mode (*NB: parameters can only be amended while the caster is stopped*).
361+
1. An additional expandable panel is made available to allow the user to configure a connected RTK-compatible receiver to operate in either `BASE FIXED`, `BASE SVIN` (Survey In) or `ROVER` mode (*NB: parameters can only be amended while the caster is stopped*).
360362
1. Select the receiver type and click the Send button to send the appropriate configuration commands to the receiver.
361-
1. **NB** Septentrio Mosaic X5 or Unicore UM980: These receivers are configured via ASCII TTY commands - to monitor the command responses, set the console protocol to "TTY" (*remember to set it back to RTCM when monitoring the RTCM3 output*). Note also that the input (ASCII command) UART port may be different to the output (RTCM3) UART port - make sure to select the appropriate port(s) when configuring the device and monitoring the RTCM3 output.
362-
1. NMEA messages can be suppressed by checking 'Disable NMEA'.
363+
1. **Where supported by the receiver**, NMEA messages can be suppressed by checking 'Disable NMEA'.
363364
1. NTRIP client login credentials are set via the user and password fields.
364365
1. Check the Socket Server/NTRIP Caster checkbox to activate the caster.
365366
1. To stop the caster, uncheck the checkbox.
366367

367368
### <a name="basestation">Base Station Configuration</a>
368369

369-
**NB:** Some receivers (*e.g. Quectel LG Series*) will require one or more restarts to enable or disable Base Station mode.
370+
The current version of PyGPSClient supports 'one click' base station configuration for the following receiver types:
371+
1. u-blox - any modern u-blox RTK model (e.g. XED-F9P, ZED-X20P) configured by binary UBX CFG-VALSET commands.
372+
1. Septentrio - most Septentrio Mosaic series (e.g. Mosaic X5) configured by ASCII TTY commands.
373+
1. Unicore - most UM9* series (e.g. UM981S) configured by ASCII TTY commands.
374+
1. Quectel LG Series - most LG series (e.g. LG290, LG580) configured by NMEA PQTM commands.
375+
1. Quectel LC Series - most LC series (e.g. LC29H) configured by NMEA PAIR commands.
376+
377+
**NOTE:**
378+
1. Some receivers (*e.g. Quectel LG Series*) will require one or more restarts to enable or disable Base Station mode. This may take several seconds.
379+
1. Different receiver models support different RTCM3 message cohorts, as indicated by the pygnssutils sourcetable entry e.g. `1006(5),1013(5),1019(5),1020(5),1033(5),1077(1),1087(1),1097(1),1127(1),1230(1)`
380+
1. To monitor ASCII TTY command responses, set the console protocol to "TTY" (*remember to set it back to RTCM when monitoring the RTCM3 output*). Note also that the input (ASCII command) UART port may be different to the output (RTCM3) UART port - make sure to select the appropriate port(s) when configuring the device and monitoring the RTCM3 output.
370381

371382
| Configuration Settings | Base Station Mode |
372383
|------------------------------------------------------|---------------------------------------------------------|
373-
| ![basestation config](https://github.com/semuconsulting/PyGPSClient/blob/master/images/basestation_fixed.png?raw=true) | **FIXED**. In this mode, the known base station coordinates (*Antenna Reference Point or ARP*) are specified in either LLH or ECEF (X,Y,Z) format. The coordinates are pre-populated with the receiver's current navigation solution (if available), but these can (and normally should) be overridden with accurately surveyed values. If the coordinates are accepted, the Fix status will change to `TIME ONLY` and the receiver will start outputting RTCM `1005` or `1006` (*Antenna Reference Point or ARP*) messages containing the base station location in ECEF (X,Y,Z) format. |
374-
| ![basestation config](https://github.com/semuconsulting/PyGPSClient/blob/master/images/basestation_svin.png?raw=true) | **SURVEY-IN (SVIN)**. In this mode, the base station coordinates are derived from a series of observations made by the receiver over a specified survey duration. The minimum duration is 60 seconds, but a longer survey may yield more accurate results. **Where supported by the receiver** in the form of SVIN status messages, survey progress can be monitored via a progress bar. If the survey is successful (*i.e. the requisite level of accuracy is achieved within the specified survey duration*), the Fix status will change to `TIME ONLY` and the receiver will start outputting RTCM `1005` or `1006` messages containing the base station location in ECEF (X,Y,Z) format. The surveyed base station location will be updated from the position provided by these RTCM `1005` or `1006` messages.|
375-
| ![basestation config](https://github.com/semuconsulting/PyGPSClient/blob/master/images/basestation_off.png?raw=true) | **DISABLED**. Disable base station and resume standard (Rover) operation. |
384+
| ![basestation config](https://github.com/semuconsulting/PyGPSClient/blob/master/images/basestation_fixed.png?raw=true) | **BASE FIXED**. In this mode, the known base station coordinates (*Antenna Reference Point or ARP*) are specified in either LLH or ECEF (X,Y,Z) format. The coordinates are pre-populated with the receiver's current navigation solution (if available), but these can (and normally should) be overridden with accurately surveyed values. If the coordinates are accepted, the receiver will start outputting RTCM `1005` or `1006` (*Antenna Reference Point or ARP*) messages containing the base station location in ECEF (X,Y,Z) format. |
385+
| ![basestation config](https://github.com/semuconsulting/PyGPSClient/blob/master/images/basestation_svin.png?raw=true) | **BASE SVIN (Survey In)**. In this mode, the base station coordinates are derived from a series of observations made by the receiver over a specified survey duration. The minimum duration is 60 seconds, but a longer survey may yield more accurate results. **Where supported by the receiver¹** in the form of SVIN status messages, survey progress can be monitored via a progress bar. If the survey is successful (*i.e. the requisite level of accuracy is achieved within the specified survey duration*), the receiver will start outputting RTCM `1005` or `1006` messages containing the base station location in ECEF (X,Y,Z) format. The surveyed base station location will be updated from the position provided by these RTCM `1005` or `1006` messages.|
386+
| ![basestation config](https://github.com/semuconsulting/PyGPSClient/blob/master/images/basestation_off.png?raw=true) | **ROVER**. Disable base station and resume standard Rover operation. |
376387

377388
**NB:** To operate effectively as an RTK Base Station, antenna positioning is of paramount importance. Refer to the following links for advice:
378389
- [u-blox GNSS Antennas Paper](https://www.ardusimple.com/wp-content/uploads/2022/04/GNSS-Antennas_AppNote_UBX-15030289.pdf)
379390
- [Ardusimple GNSS Antenna Installation Guide](https://www.ardusimple.com/gps-gnss-antenna-installation-guide/)
380391

392+
¹ Unicore and Septentrio devices do not appear to support an SVIN status output message, so Survey-in % completion is not available.
393+
381394
---
382395
## <a name="spartnconfig">SPARTN Client Facilities</a>
383396

RELEASE_NOTES.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
FIXES:
66
1. Fix `CFG-VALSET ACK-NAK` error when configuring ZED-X20P as base station.
7-
1. Fix `AttributeError: ... has no attribute frm_socketserver` error in Server Config panel when configuring Septentrio devices for SVIN.
7+
1. Fix `AttributeError: ... has no attribute frm_socketserver` error in Server Config panel when configuring certain devices for SVIN.
88

99
ENHANCEMENTS:
10-
1. Improve base station receiver configuration dialog.
11-
1. Add connected device descriptor to status bar (e.g. "u-blox ZED-F9P", "Unicore UM981S", "Septentrio mosaic-X5" or "Quectel LG290AG03"). Note that some (mainly older) devices may not return a meaningful descriptor, in which case "N/A" will be displayed.
10+
1. Improve Base Station receiver configuration handling in the NTRIP Caster/Socket Server dialog.
11+
1. Add connected device descriptor to status bar (e.g. "u-blox ZED-F9P", "Unicore UM981S", "Septentrio mosaic-X5" or "Quectel LG290AG03"). **FYI** This is based on a series of query messages (*one for each enabled protocol*) sent approximately 3 seconds after the connection is started (*you may see 'unknown protocol' warnings in response to some of these messages; these can be ignored)*. Failing this, a generic descriptor is displayed on receipt of a message protocol unique to a particular manufacturer (*e.g. "u-blox" on receipt of a UBX message, "Unicore" on receipt of a UNI message, etc.*). Note that some (mainly older) devices may not return a meaningful descriptor, in which case "N/A" will be displayed.
1212
1. Minor updates to serial port configuration panel (additional timeout values).
13+
1. Mininum pynmeagps version updated to v1.1.1.
1314

1415
### RELEASE 1.6.3
1516

images/basestation_fixed.png

2.76 KB
Loading

images/basestation_off.png

22.3 KB
Loading

images/basestation_svin.png

-56.8 KB
Loading

images/tty_dialog.png

-80 KB
Loading

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ dependencies = [
5454
"Pillow>=9.0.0",
5555
"pygnssutils>=1.1.22",
5656
"pyunigps>=0.2.0",
57+
"pynmeagps>=1.1.1",
5758
]
5859

5960
[project.scripts]

src/pygpsclient/app.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@
7070
from pygpsclient._version import __version__ as VERSION
7171
from pygpsclient.banner_frame import BannerFrame
7272
from pygpsclient.configuration import Configuration
73-
from pygpsclient.dialog_state import DialogState
73+
from pygpsclient.dialog_state import DLGTNMEA, DLGTTTY, DLGTUBX, DialogState
7474
from pygpsclient.file_handler import FileHandler
7575
from pygpsclient.globals import (
7676
BGCOL,
7777
CLASS,
78+
CMDINITDELAY,
7879
CMDPAUSE,
7980
CONFIGFILE,
8081
CONNECTED_NTRIP,
@@ -94,6 +95,7 @@
9495
NOPORTS,
9596
NTRIP_EVENT,
9697
OKCOL,
98+
RTCMSTR,
9799
SOCKSERVER_MAX_CLIENTS,
98100
SPARTN_EVENT,
99101
SPARTN_PROTOCOL,
@@ -231,6 +233,7 @@ def __init__(self, master, **kwargs):
231233
self._recorded_commands = [] # captured by RecorderDialog
232234
self.recording = False # RecordDialog status
233235
self.recording_type = 0 # 0 = TTY ONLY, 1 = UBX/NMEA
236+
self.ntriprtcmstr = RTCMSTR
234237

235238
# open database if database recording enabled
236239
dbpath = self.configuration.get("databasepath_s")
@@ -604,9 +607,11 @@ def dialog(self, dlg: str) -> Toplevel:
604607

605608
return self.dialog_state.state[dlg][DLG]
606609

607-
def sockserver_start(self):
610+
def sockserver_start(self, ntriprtcmstr: str = RTCMSTR):
608611
"""
609612
Start socket server thread.
613+
614+
:param str ntriprtcmstr: source table string indicating RTCM3 types and intervals
610615
"""
611616

612617
cfg = self.configuration
@@ -620,7 +625,6 @@ def sockserver_start(self):
620625
ntripuser = cfg.get("ntripcasteruser_s")
621626
ntrippassword = cfg.get("ntripcasterpassword_s")
622627
tlspempath = cfg.get("tlspempath_s")
623-
ntriprtcmstr = "1002(1),1006(5),1077(1),1087(1),1097(1),1127(1),1230(1)"
624628
self._socket_thread = Thread(
625629
target=self._sockserver_thread,
626630
args=(
@@ -1037,16 +1041,18 @@ def poll_version(self, protocol: int):
10371041
msgs.append(UBXMessage("MON", "MON-VER", POLL).serialize())
10381042
if protocol & SBF_PROTOCOL:
10391043
msgs.append(b"SSSSSSSSSS\r\n")
1040-
msgs.append(b"esoc,COM1,ReceiverSetup\r\n")
1044+
msgs.append(b"exeSBFOnce, COM1, ReceiverSetup\r\n")
10411045
if protocol & UNI_PROTOCOL:
10421046
msgs.append(b"VERSIONB\r\n")
10431047
if protocol & NMEA_PROTOCOL:
10441048
msgs.append(NMEAMessage("P", "QTMVERNO", POLL).serialize())
10451049

1046-
# pause for 1 second before sending first command to allow connection to stabilise
1050+
# pause for n seconds before sending first command to allow connection to stabilise
10471051
# allow a small interval between individual commands to allow receiver time to process
10481052
self.send_to_device(
1049-
msgs, pause=1000, interval=self.configuration.get("ttydelay_b") * CMDPAUSE
1053+
msgs,
1054+
pause=CMDINITDELAY,
1055+
interval=self.configuration.get("ttydelay_b") * CMDPAUSE,
10501056
)
10511057

10521058
@property
@@ -1130,6 +1136,12 @@ def device_label(self, device: str | tuple[str, str]):
11301136
)
11311137
self.update_idletasks()
11321138

1139+
# update configuration panels
1140+
for dlg in (DLGTTTY, DLGTUBX, DLGTNMEA):
1141+
if self.dialog(dlg) is not None:
1142+
if hasattr(self.dialog(dlg), "frm_device_info"):
1143+
self.dialog(dlg).frm_device_info.reset()
1144+
11331145
@property
11341146
def status_label(self) -> Label:
11351147
"""

src/pygpsclient/configuration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@
5353
SPARTN_OUTPORT,
5454
SPARTN_PPSERVER_URL,
5555
TRACK,
56+
UBLOX_ZEDF9,
5657
UMM,
5758
WORLD,
58-
ZED_F9,
5959
)
6060
from pygpsclient.init_presets import INIT_PRESETS
6161
from pygpsclient.mapquest_handler import MAP_UPDATE_INTERVAL
62+
from pygpsclient.serverconfig_dialog import BASE_SVIN
6263
from pygpsclient.spartn_lband_frame import D9S_PP_EU as D9S_PP
6364
from pygpsclient.strings import (
6465
LOADCONFIGBAD,
@@ -176,8 +177,8 @@ def __init__(self, app):
176177
"sockportntrip_n": SOCKSERVER_NTRIP_PORT,
177178
"sockmode_b": 0,
178179
"sockhttps_b": 0,
179-
"ntripcasterbasemode_s": "SURVEY IN",
180-
"ntripcasterrcvrtype_s": ZED_F9,
180+
"ntripcasterbasemode_s": BASE_SVIN,
181+
"ntripcasterrcvrtype_s": UBLOX_ZEDF9,
181182
"ntripcasteracclimit_f": 100.0,
182183
"ntripcasterduration_n": 60,
183184
"ntripcasterposmode_s": "LLH",

0 commit comments

Comments
 (0)