-
|
I like to run gnssstreamer_cli as a service later. If I want data via Socket, i must use only format 2 runs. Other formats not able? lat: 53.1064656667, lon: 12.8946828333, alt: 58.9, fix: RTK FIXED, corr age: 37.0 It runs in lambda example: I need the positions data online on the simplest way from gnssstreamer_cli in a "good" format. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Hi @duemchen So if you want to run gnssstreamer as a socket server, you can choose any output format you want (including json), e.g. this will run fine: gnssstreamer -P /dev/tty.usbmodem101 --cliout 3 --output localhost:50011 --verbosity 2 --format 32However, if you also want to run gnsstreamer as a socket client, the output format must be binary ( You need to clarify what exactly you mean by "online in the simplest way", but I don't think gnssstreamer is what you're after. I suspect you're probably looking at some kind of HTTP server solution which can be consumed by a web browser or REST API. There is, as it happens, an example Python script of just such a thing here: https://github.com/semuconsulting/pynmeagps/tree/master/examples/webserver It's only a simple illustration - I certainly wouldn't use it for any mission-critical application! - but in essence you execute the script as follows: If you then enter an address of http://localhost:8080 in your web browser, you will see a web page that looks something like this (this assumes your receiver is outputting standard NMEA RMC, GGA and GSA sentences):
The data will refresh automatically every 5 seconds. Does this look like the sort of thing that might meet your needs? |
Beta Was this translation helpful? Give feedback.
-
|
Hello Steven, I only need your fine RTK-FIXed Position Data receive in my Program. On the simplest way (Socket or other). Some Days before you have helped me and the data are fine in lambda print: gnssstreamer --port /dev/ttyACM0 --baudrate 115200 --msgfilter "GNGGA" --cliinput 1 --input www.sapos-bb-ntrip.de:2101/VRS_3_2G_BB --rtkuser duemcxxxx --rtkpassword Hoxxxxx --rtkggaint 10 --clioutput 4 --output "lambda msg: print(f'lat: {msg.lat}, lon: {msg.lon}, alt: {msg.alt}, fix: {['NO FIX','2D','3D','N/A','RTK FIXED','RTK FLOAT'][msg.quality]}, corr age: {msg.diffAge}')" --verbosity 3 --logtofile /home/pi/log.txt lat: 53.1064658333, lon: 12.8946826667, alt: 58.9, fix: RTK FIXED, corr age: 2.0 With my Socket client also this runs, gnssstreamer --port /dev/ttyACM0 --baudrate 115200 --msgfilter "GNGGA" --cliinput 1 --input www.sapos-bb-ntrip.de:2101/VRS_3_2G_BB --rtkuser duemcxxxx --rtkpassword Horxxxx --rtkggaint 10 --clioutput 3 --format 2 --output 127.0.0.1:2000 --verbosity 2 but only with format 2 i receive data: My socket connects with gnsstreamer in all formats. The client socket code is simple. Can you see my mistake? import socket |
Beta Was this translation helpful? Give feedback.

Hi @duemchen
If only Python socket programming was as simple as that!
Your simple socket client assumes that the incoming GNSS data can be parsed ("decoded") using the
decode()method, but that will only work in very limited circumstances:decodeonly works for binary-encoded ascii text i.e. NMEA data sent in binary format (it wouldn't work for UBX or RTCM data, for example). As I mentioned earlier, if you use any other format, you need to substitutedecodefor a method which can parse that format, and that is non-trivial.