Navio2 GPS C++ example works but Python doesn't

Hi all,

I’m just in the process of setting up my Navio2 by following the instructions on this instructable.

The example run using C++ runs perfectly fine as per image below.

However, when I run the Python example, the file runs but I get no output whatsoever and I have to break (Cntrl + C) to get out of it.

Please help! Thanks :slight_smile:

Hello,

GPS.py example run fine on my configuration and latest up to date Emlid Navio2 20191128 image.

Capture d’écran 2020-03-14 à 07.37.31

Hey @mlebret,

That’s really odd because I’m also running the same image 20191128. Extra odd that it works on c++ but not python.

Do you have any ideas why mine doesn’t output anything? Is it just waiting to fix? The c++ fixed almost immediately.

Or do you think it’s something like me having to put in the shebang line #!/usr/bin/env python

What version of python do you have? Maybe I accidentally typed in ‘sudo apt-get install python’ at some stage.

Thanks for helping out!

It is a brand new 20191128 image, with

sudo apt-get update && sudo apt-get dist-upgrade

and Navio2 dev folder imported from GitHub.

git clone https://github.com/emlid/Navio2.git

Hi,

May I ask you to try launching an example under sudo and see if it helps?

Could you also tell what Python version is on your Raspberry board? Simply put “python -V” into the shell and it’ll output version info.

2.7.16 :slight_smile:

Hi,

Your Python version is up to date, this is not a version mismatch issue.

Can you, please, put

sudo emlidtool test

in your shell and post the screenshot with the result?

Also, you can try reflashing your Raspbian image. This could help or at least exclude possible software errors.

I have the same problem. C++ example runs fine but the Python example will not run. I just received the Navio 2 and set it up and tested the ardupilot and connected it to groundstation. Everything else has worked so far. I ran emlidtool test and i ran the gps example and took a screenshot.

I tried it about a dozen times and let it sit for awhile after issuing the command. It is like it is hanging and waiting for something. One time it did put out a single line of GPS data. But i could not repeat this. Again it’s sitting by the window and the GPS worded fine in ground station and the C++ example worked fine so it is getting a fix.

Hi Jerome,

Do you have C++ script running at the same time? If you run Python’s script simultaneously you won’t be able to get the readings from GNSS module.

no, i stop the C++ script. Also you have to turn off the ardupilot. It lets you know you can not check the sensor with the ardupilot running. Can the problem be something with the latest Rpi4 Raspbian OS updates? I installed everything fresh last month when i got the navio. It sounds as if it had been working previously for other users.

Hi Jerome,

The latest Emlid Raspbian image should work fine with the examples. Did I get correctly that you use Python 2.17.16?

You can check it with python -V command.