Can I run example code to test Navio2 sensors before quad build?

I’m working with my teenage son to build a quad using a Navio2. We wanted to try the example code for some of the sensors before completing our build. Some of the examples seem like they should run with just the Navio2 and a Raspberry Pi 2 (no other hardware attached).

However, we are having mixed results with the different example code (tried both C++ and Python):

Can anyone verify that we should be able to run these examples without any other hardware attached?

  • Barometer
    C++ - runs successfully
    Python - will not run…
pi@navio:~Navio2/Python $ sudo python Barometer.py
Traceback (most recent call last):
File "Barometer.py", line 13, in <module>
	import navio.ms5611
File "/home/pi/Navio2/Python/navio/ms5611.py", line 31, in <module>
	from smbus import SMBus
ImportError: No module named smbus
  • RGBLed
    C++ - partial success (changes color between red/yellow/green, no cyan/magenta/blue).
    Python - same results

  • AccelGyroMag
    Python - will not run

pi@navio:~/Navio2/Python $ sudo python AccelGyroMag.py
Traceback (most recent call last):
File “AccelGyroMag.py”, line 29, in
import spidev
ImportError: No module named spidev

     *C++ - will not run*
   pi@navio:~/Navio2/C++/Examples/AccelGyroMag $ sudo ./AccelGyroMag -i mpu
   Selected: MPU9250
   Sensor not enabled

Rebooting has not produced any different results.

In addition, we attempted to run ArduCopter-quad, but it doesn’t appear to even start up.


For reference, we completed these setup steps following the Docs instructions:

Docs » Navio2 with APM autopilot » Hardware setup
Attaching Navio2 to a Raspberry Pi (used a Raspberry Pi 2 Model B and provided standoff hardware)
Powering Navio2 (currently powered with microUSB, 5V 1A supply)

No other hardware connections made.

Docs » Navio2 with APM autopilot » Raspberry Pi configuration
Downloading configured Raspbian image
Writing image to SD card
SD card set up with emlid-raspberrypi2-raspbian-navio2-20160212.img.
Configuring Wi-Fi access
Successful, able to SSH via Wi-Fi.

Docs » Navio2 with APM autopilot » APM installation and running
Installing APM

wget 'http://files.emlid.com/apm/apm-navio2_3.3.2-rc2-beta-1.2_armhf.deb' -O apm-navio2.deb
sudo dpkg -i apm-navio2.deb

Running APM

Installed APM Planner from http://ardupilot.com/downloads/?category=35 on both Ubuntu 14.4 and Windows10 machines.

Attempted to run Arducopter with different parameters, but it doesn’t appear to start.
1st attempt

pi@navio:~ $ sudo ArduCopter-quad -A udp:192.168.1.19:14550
Raspberry Pi 2 with BCM2709!
No INS backends available

2nd attempt:

 pi@navio:~ $ sudo ArduCopter-quad
 Raspberry Pi 2 with BCM2709!

Init APM:Copter V3.4-dev (cce4f12e)

Free RAM: 262144
FW Ver: 120

load_all took 13us
/sys/kernel/rcio/adc/ch255 not opened: No such file or directory0 0 0 ▒ Q}▒No INS backends available
HMC5843: Could not detect version
MPU9250: unexpected WHOAMI 0xFF

Update:
I found a post that seems to have the same issue:

with a reply

I understand now that the python examples aren’t working.

I tried the cat /sys/kernel/rcio/adc/ch0 command and have consistent readings over 5.2v using a 5V 2A power supply with nothing but a wireless dongle attached.

I was also able to run the C++ example ADC

pi@navio:~/Navio2/C++/Examples/ADC $ ./ADC
A0: 5.2740V A1: 0.0120V A2: 0.0240V A3: 0.0100V A4: 0.0320V A5: 0.0320V
A0: 5.3000V A1: 0.0120V A2: 0.0140V A3: 0.0220V A4: 0.0080V A5: 0.0320V
A0: 5.3000V A1: 0.0120V A2: 0.0140V A3: 0.0220V A4: 0.0080V A5: 0.0320V
A0: 5.3000V A1: 0.0120V A2: 0.0240V A3: 0.0080V A4: 0.0080V A5: 0.0320V
A0: 5.2960V A1: 0.0120V A2: 0.0120V A3: 0.0220V A4: 0.0080V A5: 0.0320V
A0: 5.2960V A1: 0.0120V A2: 0.0240V A3: 0.0100V A4: 0.0320V A5: 0.0320V
A0: 5.3000V A1: 0.0120V A2: 0.0100V A3: 0.0220V A4: 0.0080V A5: 0.0320V
A0: 5.2940V A1: 0.0120V A2: 0.0240V A3: 0.0100V A4: 0.0320V A5: 0.0160V

Still getting same results when trying to run AccelGyroMag.

SOLVED: We changed to a different Raspberry Pi 2 and we can now run the example code without errors, happy that the problem was not the Navio2!

Good. Also make sure that Navio2 is properly mounted on the RPi with provided screws and spacers, it could have been a lack of contact issue.

Hello i’m the university student.

I’m using Navio2 and RaspberryPi 2.
I have same issue about error of absence backend sensors.
While testing my customized code, i get some errors about absene of backend sensors.
and i found out sometimes it gets error in the middle of finding backend sensors like MPU .

I’m not sure the reason, but when i try several times, it outputs error log.

I think there should be constant tests and find out the reason in the long run.
(It could be hardware problem…also)

Thanks.

Hi Jung,

Please start a new topic with detailed description of your issue and we will try to help you. It is hard to tell what is the problem by your current description.

It’s actually an issue with "MPU9250 :unexpected WHOAMI 0XFF"
I’m not sure what the number of question is,
but the name of question is “MPU9250 :unexpected WHOAMI 0XFF” in this Community forum.

please check it out,
Thanks