Comments (11)
from pygpsclient.
Hi @hpsaturn
FYI I've added a PR containing the following enhancement:
Add provision to pass user-defined serial port designator via command line keyword argument port
or environment variable PYGPSCLIENT_USERPORT
.
e.g.
pygpsclient port=/dev/tty12345
or
export PYGPSCLIENT_USERPORT = "/dev/tty12345"
pygpsclient
Any user-defined port will appear in the serial port listbox as the first preselected item.
from pygpsclient.
I wrote a small guide to have virtual serial ports. This guide uses your script socker server implementation and one virtual serial port. With this possible new feature, we could put direct the virtual serial port instead the socket server. It's only an idea.
from pygpsclient.
Hi @hpsaturn. Thanks for this, and sorry it's taken a while to get back to you.
Given the additional information you've provided on virtual ports, I'm not entirely clear what the outstanding issue is or what additional functionality you're after.
As you've presumably seen, the serial port listbox in PyGPSClient uses the standard Python serial.tools.list_ports.comports
function to list the available serial ports. This is primarily intended for physical serial connections (i.e. USB or UART), and as a standard library function I have no direct control over its functionality.
I could, as you suggest, add a manual
serial port entry facility, but since the listbox works for 99% of standard use cases I'm somewhat loath to complicate the UI for what would be a niche case. I could, as an alternative, provide an optional command line facility for manual port override e.g. pygpsclient port=/dev/pts/14
.
As you've seen, PyGPSClient can also read directly from a TCP or UDP socket stream - have you actually tried reading your device's UDP stream directly using this facility, rather than coverting it to a virtual serial port using socat
?
If you can clarify exactly what missing functionality you're after, I'm happy to investigate further.
from pygpsclient.
Hi @semuadmin
Thanks for your detailed explanation. I think that option on the command line or via an environment variable could works. Also I understand that this feature maybe nobody needs it, is a minor feature. With the command line option I wouldn't have to start the UDP server.
Regarding to try to read direct the UDP device stream, I need test again because didn't works. I tried many times on many ways. But let me test again, maybe I had some protocol mistakes..
from pygpsclient.
Hi @hpsaturn Yes, suggest try the direct UDP/TCP socket and let me know how you get on. Purely out of interest, any particular reason why you favour UDP over TCP?
I take it you're working with IOT devices like the ESP32? I have in the past tested using a WROOM ESP32 with an old NEO-M6 GPS module connected via UART, transmitting a raw NMEA data stream via a TCP socket using the wifiserver.h
Arduino library, and it did work fine with PyGPSClient's socket stream facility.
from pygpsclient.
Yes I will try again it. Regarding TCP/UDP, don't matter. I want map the UART output via TCP/UDP for other features. For example I have a CLI, and sometimes for debugging via UDP could be more fast without no matter lost some packets.. But again, let me try again to test the direct UDP/TCP socket again, for close this issue.
from pygpsclient.
Works like a charm!
(pvenv) (add-app-entry-kwargs) avp:PyGPSClientȹ export PYGPSCLIENT_USERPORT="/dev/pts/10"
(pvenv) (add-app-entry-kwargs) avp:PyGPSClientȹ python3 -m pygpsclient
I will change my guide because with this improvement I don't need starting the socket server, I don't need the last part on the guide.
Thanks!
from pygpsclient.
I'm in need of this workaround due to pyserial/pyserial#489, it blocks /dev/ttyS0
on which the GPS is present.
Unfortunately, I can't seem to get the tweak to work
Hi @hpsaturn
FYI I've added a PR containing the following enhancement:
Add provision to pass user-defined serial port designator via command line keyword argument
port
or environment variablePYGPSCLIENT_USERPORT
.e.g.
pygpsclient port=/dev/tty12345or
export PYGPSCLIENT_USERPORT = "/dev/tty12345" pygpsclientAny user-defined port will appear in the serial port listbox as the first preselected item.
pygpsclient: error: unrecognized arguments: port=/dev/ttyS0
PyGPSClient 1.4.7
Python 3.9.2
Raspberry Pi OS 64-bit "Bullseye"
Thanks for your time,
Martin
from pygpsclient.
Hi @Ve2mrx
Things have moved on a bit since this change was originally made. The easiest way to do this now is via a *.json configuration file e.g. pygpsclient.json
. The following configuration setting in the file will take precedence over any command line arguments:
"userport_s": "/dev/ttyS0",
To create an initial default configuration file, simply use the 'File...Save Configuration` menu option.
Unfortunately it appears I've broken the command line parsing so the alternative pygpsclient --userport /dev/ttyS0
or pygpsclient -U /dev/ttyS0
command line argument (note updated syntax) doesn't currently work - a fix will go into v1.4.8: 13ec43b.
Hope this helps
from pygpsclient.
@semuadmin Thanks, this fixed my problem!
Martin
from pygpsclient.
Related Issues (20)
- Pygpsclient crashes when "save configuration" on macos HOT 7
- PIL.Image has no attribute ANTIALIAS HOT 5
- Why the advanced configuratinos are hidden for socket server mode? HOT 3
- I'm getting a KeyError: 'serial_settings' from stream_handler.py when trying to use a socket as gnss source. Approx line 124 but I may have added some debug prints.
- KeyError: 'inactivity_timeout' when trying to use l-band spartn corrections:
- Support Ublox NTRIP Client (No MQTT) SPARTN format HOT 3
- Starting gui fails on Windows 10 HOT 1
- Error in _process_UBX03() function when handling satellite elevation and azimuth
- Incorrect PUBX03 elev/azim handling in Sky View HOT 1
- Saving L-band config into D9S HOT 4
- socket.timeout: timed out HOT 5
- KeyError on private RTCM3 messages HOT 3
- UI text unreadable in MacOS with Dark theme HOT 3
- Unable to start the Tk on Mac m1 HOT 2
- ValueError if pygpsclient starts without default configuration file
- Ublox Config Dialog with TCP Socket HOT 5
- Raspberry Pi 32-bit HOT 10
- incomplete configuration saving and loading HOT 4
- MacOSX 11.7.9 no idea what's wrong HOT 19
- vdop not populated for NMEA messages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygpsclient.