mayeranalytics / pyubx Goto Github PK
View Code? Open in Web Editor NEWPython library for parsing/generating u-blox UBX protocol messages, and for creating parsers/generators in other languages.
License: GNU General Public License v3.0
Python library for parsing/generating u-blox UBX protocol messages, and for creating parsers/generators in other languages.
License: GNU General Public License v3.0
I wrote a simple script trying to query some settings of a receiver. However, after sending (for example) a UBX.CFG.PRT_GET message, the UBXManager fails to parse the response correctly.
I traced this error down already to some extent:
The root cause is that both UBX.CFG.PRT_GET and UBX.CFG.PRT have the same _id. When initMessageClass initially fills the _lookup-dictionary of UBX.CFG, duplicate keys are partially discarded, only the last key-value is stored, leaving only UBX.CFG.PRT_GET in there.
When parseUBXPayload then tries to look up the subclass from the _lookup-dictionary with .get(msgid), only UBX.CFG.PRT_GET is present.
The issue can be worked around by changing the order of PRT and PRT_GET in the source code (same applies for TP5 and TP5_GET, but explicitly excluding _GET-messages from the list of parseable messages might be a better idea.
Interesting side effect: The Exception message wrongly states "Message not fully consumed while parsing a UBX.CFG.TP5_GET!", even though this should read UBX.CFG.PRT_GET. I did not track down what causes this, but it threw me off first while looking for the root cause of the problem.
Test code:
import serial
import time
import UBX
from UBXManager import UBXManager
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=None)
manager = UBXManager(ser, debug=True)
manager.start()
# query port settings - response triggers bug
time.sleep(1)
prt = UBX.CFG.PRT_GET(b'\x01')
manager.send(prt.serialize())
Modify the Xn bitfield types to actually handle bitfields.
as defined in §31.3.5
The code is not packaged as a module. (See the packaging guide. Ideally I would be able to do something like:
(bash)$ pip install /path/to/pyUBX
(bash)$ python
>>> import pyUBX
>>> manager = pyUBX.UBXManager(serial_port)
and so on. This lets you use the code with other software (such as a snazzy map display).
Instead, the M.O. of using it seems to be to cd into the pyUBX directory before running python, which makes it hard to integrate.
I will be tackling this after finishing support for relposNED. Any tripwires I want to avoid to keep compatible with your use cases? (Or objections to me doing this? It will involve moving directories around.)
Thanks.
Is it possible to use this library on the UBX M8P for RTK purpose (base-station)?
configure dynamic model
get the RTCM3 corrections (1005, 1077 and 1087)
If not, do you plan on supporting it, is this project open for contributions?
For using the Ardusimple GPS-based heading kit, I need NAV-RELPOSNED and NAV-PVT support.
Hi! I'm currently using an UDOO Neo with python 3.4.3
I cloned your pyUBX but python3 setup.py install fails at:
byte-compiling build/bdist.linux-armv7l/egg/ubx/UBX/ESF.py to ESF.cpython-34.pyc
File "build/bdist.linux-armv7l/egg/ubx/UBX/ESF.py", line 37
datas = (self.__getattribute__(f'data_{idx}') for idx in range(1, self.numMeas+1))
^
SyntaxError: invalid syntax
Thank you!
Hello,
I'm trying to setup my device with the following code:
import serial from UBXManager import UBXManager ser = serial.Serial('COM4', 115200, timeout=None) manager = UBXManager(ser, debug=True) manager.start()
I'm getting the following error:
Traceback (most recent call last): File "c:/projects/pyUBX/start.py", line 4, in <module> manager = UBXManager(ser, debug=True) File "c:\projects\pyUBX\UBXManager.py", line 28, in __init__ from UBXMessage import UBXMessage File "c:\projects\pyUBX\UBXMessage.py", line 9, in <module> import UBX File "c:\projects\pyUBX\UBX\__init__.py", line 1, in <module> from UBX.ACK import * File "c:\projects\pyUBX\UBX\ACK.py", line 3, in <module> from UBXMessage import initMessageClass, addGet ImportError: cannot import name 'initMessageClass' from 'UBXMessage' (c:\projects\pyUBX\UBXMessage.py)
Do you have any ideas how to fix it?
Thank you for your work!
BR Michael
currently when debug=1 stuff will be dumped to UBX.log. In any case too much is printed to stdout.
Better use a framework such as logging
.
I have created a ubx file by using u-center with ZED-F9P.
I just want to extract information from .ubx file created by u-center.
Am I able to do that with this repo?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.