Comments (10)
Hello
except ube.UBXMessageError() as err:
should be except ube.UBXMessageError as err:
??
Try remove the parenthesis and catch your real error if i am correct.
from pyubx2.
Hi @Hadatko ,
same problem but cleaner without the ()
Starting serial read thread...
Starting HTTP Server on http://127.0.0.1:8123 ...
Press Ctrl-C to terminate.
<UBX(NAV-PVT, iTOW=15:17:25, year=2022, month=4, day=11, hour=15, min=17, second=25, validDate=1, validTime=1, fullyResolved=1, validMag=0, tAcc=1006, nano=155037, fixType=3, gnssFixOk=1, difSoln=1, psmState=0, headVehValid=0, carrSoln=2, confirmedAvai=1, confirmedDate=1, confirmedTime=1, numSV=21, lon=-1.0281327, lat=45.9921395, height=50492, hMSL=2369, hAcc=36, vAcc=50, velN=6, velE=-13, velD=-11, gSpeed=14, headMot=116.17642, sAcc=99, headAcc=180.0, pDOP=1.21, invalidLlh=0, lastCorrectionAge=0, reserved0=1044519020, headVeh=0.0, magDec=0.0, magAcc=0.0)>
Something went wrong Message checksum b'\x00\x1a' invalid - should be b'\x8e\x84'
<UNKNOWN PROTOCOL(header=b'$\x00')>
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/basegnss/pyubx2/examples/webserver/ubxserver.py", line 150, in _read_thread
self.set_data(parsed_data)
File "/home/basegnss/pyubx2/examples/webserver/ubxserver.py", line 167, in set_data
if parsed_data.identity == 'NAV-PVT':
AttributeError: 'str' object has no attribute 'identity'
from pyubx2.
Hi @jancelin Sorry you're having difficulties.
To be honest, the webserver example was something I knocked up fairly quickly and it's by no means a production-strength implementation. Errors of the kind you're seeing (invalid checksum, unknown protocol) are normally indicative of a problem with the serial stream itself. Are you sure you have the correct baud rate set (the default on F9P UART1/2 is normally 38400)? Do you get the same errors if you use, say, the gnssdump cli utility to parse the output?
I've just uploaded a slightly amended version of the webserver example with enhanced exception handling (and one fixed typo which @Hadatko spotted!) and tried it against my own F9P - seems to be working fine...
(NB: this fix doesn't address the root cause of any 'unknown protocol' error - it just stops it knocking over the web server)
Connecting to serial port /dev/tty.usbmodem141301 at 9600 baud...
Starting serial read thread...
Starting HTTP Server on http://localhost:8080 ...
Press Ctrl-C to terminate.
127.0.0.1 - - [11/Apr/2022 16:47:08] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2022 16:47:08] "GET /scripts.js HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2022 16:47:08] "GET /styles.css HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2022 16:47:08] "GET /gps HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2022 16:47:13] "GET /gps HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2022 16:47:18] "GET /gps HTTP/1.1" 200 -
^C
Terminated by user
Suggest you have a go with this amended version and let me know how you get on.
from pyubx2.
Hi
It's OK, it works on my side. Thanks a lot!
I use str2str to inject RTCM3 data for RTK centipede.fr, so I'm going to modify the web interface a bit to have all the PVT information on the precision of hAcc, vAcc, carrSoln data,...
it's for the physalia and Rtkbase project,
I'll share my progress.
from pyubx2.
OK glad the web server example works OK, and if it provides a useful basis for your own project then great! It's easy enough to amend the set_data()
routine to accept other incoming data sources (including NMEA and RTCM3 if needs be). Do please share progress - thanks.
Just bear in mind that this is a fairly simplistic web server implementation; please heed the warning on the http.server library home page:
Out of interest, did you actually get to the bottom of the 'invalid checksum' and 'UNKNOWN PROTOCOL' errors? pyubx2
should be capable of handling any of the protocols output by a u-blox device such as the F9P (i.e. NMEA, UBX or RTCM3), so - as I say - errors of this kind are normally associated with a corrupt serial stream (e.g. incorrect baud rate or some other process interfering with the stream such as gpsd
).
Are you happy to close this issue in relation to the web server example? If you continue to get persistent 'UNKNOWN PROTOCOL' errors from pyubx2
elsewhere then by all means raise a separate issue. Cheers.
from pyubx2.
Hello
Is it possible to make such webserver example for pyrtcm + ntrip?
from pyubx2.
Hi @foxittt. The intention with this example is to wrap a simple HTTP server around the parsed serial data stream from a local GNSS device. For simplicity sake it currently only parses selected UBX messages, but could easily be modified to parse NMEA and/or RTCM3 messages coming from the same device.
NTRIP, on the other hand, is already an internet-based protocol so much of this would be superfluous. You can access any (public) NTRIP caster by simply opening the appropriate URL in any web browser (e.g. http://rtk2go.com:2101), though you obviously wouldn't get the parsed RTCM3 data without further client-side processing.
Have a look at ntrip_handler.py
in PyGPSClient
for an illustration of how to receive and parse an NTRIP data stream: https://github.com/semuconsulting/PyGPSClient/blob/master/pygpsclient/ntrip_handler.py
from pyubx2.
Thanks! I`ll try.
from pyubx2.
Hi @foxittt ,
FYI This is typical output from an NTRIP caster as displayed by the PyGPSClient utility - is this the sort of thing you were looking to see?
from pyubx2.
Yes.
from pyubx2.
Related Issues (20)
- Getting CFG-PRT to change UART speed HOT 6
- Value of "dyn" field in CFG-NAV5 HOT 1
- pyubx2 stop processing when there is a broken data in the ubx file. HOT 3
- I think this could become slightly more higher level. HOT 1
- Meta-data for "MON-RF.group.flags.jammingState" is incorrect. It is specified as U1 when it should be U2.
- my get stuck in SocketStream.read() HOT 10
- Typo in UBX-ESF-INS message
- UBX-MGA-GPS-EPH size mismatch
- Trying to set configuration from configuration file HOT 1
- Configuration Interface error CFG_UART1_BAUDRATE HOT 1
- How to extract GPS time or higher number of digits in the iTOW field instead of UTC time? HOT 3
- NAV-PVT via I2C? HOT 3
- rinex output HOT 4
- Enabling RTCM Corrections on the ZED-F9K receivers via serial communication HOT 2
- Parsing .ubx files HOT 1
- quitonerror option doesn't work for nmeamessage.py _do_attributes errors HOT 2
- pynmeagps>=1.0.17 Not found HOT 4
- Getting ACK/NAK response from command HOT 4
- Serialization of messages into bytes sometimes gives non-hex values HOT 2
- Add sigId to RXM-RAWX message in ubxtypes_get.py
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 pyubx2.