Code Monkey home page Code Monkey logo

Comments (11)

Korving-F avatar Korving-F commented on August 19, 2024

Hi; I can try ^_^

Can you send me your entire code snippet as you write it?
Can you also try the following and send the resulting output?

y = x.read()
print(y.ubx_id)
print(y.ubx_class)

Which version of python are you using?

from ublox.

yuanshuai19960730 avatar yuanshuai19960730 commented on August 19, 2024

image
Thanks for your reply:
Can you see the picture i send,my code snippet is on it
I had tried y.ubx_id ,it says 'UbxMessage' object has no attribute 'ubx_id'
The vision of python is Python 3.6.9 on Ubuntu system.
Look forward to your reply,thanks

from ublox.

Korving-F avatar Korving-F commented on August 19, 2024

I think I can see what the problem is: you're enabling NAV-POSLLH to be sent regularly.
But other messages have been enabled on your GPS module as well (many are not supported as of this moment).
At the moment the script fails silently if it receives unsupported messages.

>>> y = x.read()
Receiving
02 14  # <- This is a class 2, id 14 event you are receiving: UBX-RXM-MEASX not NAV-POSLLH

There are multiple things you can/should do:

  • Disable the event and any others you're not interested in:
x.disable_message(2,20) # Note that it prints out the class/id in hexadecimal, but takes in these as integers
  • Read safely and possibly without a flush (untested code; may contain a typo):
while(True):
    try:
        y = x.read()
        if(y.ubx_id == '02' and y.ubx_class == '01'):
            print("You found a NAV-POSLLH message ^_^")
            print(y.lat)
        else:
            print("You found a different but supported message.")
            print("ID: " + y.ubx_id + " Class: " + y.ubx_class)
            print("Variables: " + vars(y))
    except:
        print("Now you found an unsupported message")

See this document for more message types and technical information on the receiver: https://www.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_%28UBX-13003221%29.pdf

If you find a message you want to have added let me know :)

from ublox.

yuanshuai19960730 avatar yuanshuai19960730 commented on August 19, 2024

image
thanks a lot ,i had received some message illustrated as the up picture
but ,there is still a problem:
i only enable two kinds message POSLLH(01,02) and PVT(01,07) on u-center on my computer
image
and then i do as follow:

x.disable_message(1,7)
.xenable_message(1,7)
image
does it means i cannot enable message use the code but only can enable message use u-center?because PVT turn gray on u-center
image

from ublox.

Korving-F avatar Korving-F commented on August 19, 2024

I'm not sure what exactly the issue is for you; it seems to work. Some things maybe you can try:

  • Set the baudrate to 9600
  • Disable all NMEA messages if you don't need them:
x.disable_NMEA() # get rid of noise
  • try multiple executions of x.enable_message(1,7).

When it enables a message type a CFG message is sent and only when the receiver processes this correctly an ACK is sent. If the message is sent but is malformed/not supported etc. it will send a NACK. In your case it seems to receive neither.

Let me know how your experiments are going; hope I can be of more help ^_^

from ublox.

yuanshuai19960730 avatar yuanshuai19960730 commented on August 19, 2024

i have tried , i can only disable_message here.
I have set on u-center that i can only receive 01,07 and 01,02 ,and after i disable_message(01,07)
i cannot receive 01,02 message either,it syas
image
i think i can only enable/disable message on u-center now,and that does not matter.

and here i have a much more imortant question ,when i receive 01,02 message, it works well
image

but when i receive a 01,07 message
image
i just cannot understanding it!!
wish u can help me with that😂

from ublox.

Korving-F avatar Korving-F commented on August 19, 2024

Hmm; this seems like a classical python2 vs. 3 error.
Can you stop sending all messages in u-center and send back a similar image as below?

btw; do you have pyserial properly installed?

pip install --upgrade --force-reinstall pyserial
pip3 install --upgrade --force-reinstall pyserial

Also which version of this project are you using? (maybe do a pull / clean clone? just in case)

image

image

from ublox.

yuanshuai19960730 avatar yuanshuai19960730 commented on August 19, 2024

image
i stopped all information and did pip3 install --upgrade --force-reinstall pyserial.
the only difference is my pyserial is in dir /.local/lib/python3.6/site-packages and yours is in dir usr/loacl/lib/python3.6/dist-packages.
does it matter? I'm not familiar with Python on linux.Because i have this mission ,i have to learn about it .

my project is python 3.6.9,i did not install python 2.x
image

and In the same case,message 01,02 works well ,but 01,07 just has problem ,it is really Weird !!
my mother language is not english ,and i cannot understand the meaning of "do a pull / clean clone",sorry about that😭
BTW,you reply to me so early today ,i guess you must have a holiday today😁.Wish you have a good time!

from ublox.

Korving-F avatar Korving-F commented on August 19, 2024

You're probably doing the installation correct; the way I installed the package on my system is actually insecure and should be avoided. Although you could look into using venv virtual environment.

Could you try to print PATH as described here just in case?: https://www.dummies.com/programming/python/how-to-find-path-information-in-python/

If you don't see your .local dir printed there follow for example PYTHONPATH example to add it manually: https://www.devdungeon.com/content/python-import-syspath-and-pythonpath-tutorial

Git pull / git clone:

cd ~/Desktop/py/
git clone https://github.com/Korving-F/ublox
# https://docs.github.com/en/enterprise/2.13/user/articles/cloning-a-repository

Can you also send a "ls -lah /dev/ttyACM3"?
It might be that running in a VM is complicating things.

Doing this from my phone so sorry for the incomplete response. Really not sure what it otherwise could be..

P.s. your English is good ^_^

from ublox.

yuanshuai19960730 avatar yuanshuai19960730 commented on August 19, 2024

i am so happy that the question is solved:
i just git pull/git clone and it works well now
image
however, the enable/disable still does not work.but i can continue my work now:to add some message that i need like you do in the code .
BTW,i noticed that my ublox is version f9p,maybe this is the reason?
You are such a warmhearted and nice man,Wish everything goes well with you☺.Thank you very much!!

from ublox.

Korving-F avatar Korving-F commented on August 19, 2024

Awesome :D no worries and good luck with your project!
I'll try to look at f9p; maybe something changed :)
Greetings!

from ublox.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.