Emlidtool test mpu9250: Failed lsm9ds1: Failed gps: Failed

Hi,

I’m using a Pi3 B v1.2 with a Navio2, the emlidtool test is returning errors on lsm9ds1, gps and mpu9250. I’ve tried the SD card on different hardware, even on a new {RPi + navio 2} I get this error. Does anyone has any advice to provide ?

Thanks a lot!

version
@navio:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.9 (stretch)
Release: 9.9
Codename: stretch

@navio:~ $ sudo emlidtool info
Vendor: Emlid Limited
Product: Navio 2
Issue: Emlid 2019-02-27 1548ce733215806c8ad171c8b78ebca0c7cf8395
Kernel: 4.14.95-emlid-v7+
RCIO firmware: 0xb09979ae

@navio:~ $ sudo emlidtool --version
emlidtool version: 1.0.8

The errors I get

@navio:~ $ sudo emlidtool test
2019-07-19 16:29:04 navio root[1502] ERROR lsm9ds1: Failed
– Reason: No connection!
2019-07-19 16:29:04 navio root[1502] INFO pwm: Passed
2019-07-19 16:29:04 navio root[1502] ERROR gps: Failed
– Reason: Timeout
2019-07-19 16:29:04 navio root[1502] INFO rcio_firmware: Passed
2019-07-19 16:29:04 navio root[1502] INFO adc: Passed
2019-07-19 16:29:04 navio root[1502] ERROR mpu9250: Failed
– Reason: No connection!
2019-07-19 16:29:04 navio root[1502] INFO rcio_status_alive: Passed
2019-07-19 16:29:04 navio root[1502] INFO ms5611: Passed

Some information

@navio:~ $ lsmod
Module Size Used by
rcio_spi 16384 0
rcio_core 36864 1 rcio_spi
fuse 106496 3
ipt_MASQUERADE 16384 1
nf_nat_masquerade_ipv4 16384 1 ipt_MASQUERADE
iptable_nat 16384 1
nf_nat_ipv4 16384 1 iptable_nat
nf_nat 32768 2 nf_nat_masquerade_ipv4,nf_nat_ipv4
nf_conntrack_ipv4 16384 3
nf_defrag_ipv4 16384 1 nf_conntrack_ipv4
xt_conntrack 16384 1
nf_conntrack 139264 6 nf_conntrack_ipv4,ipt_MASQUERADE,nf_nat_masquerade_ipv4,xt_conntrack,nf_nat_ipv4,nf_nat
iptable_filter 16384 1
binfmt_misc 20480 1
spidev 16384 0
brcmfmac 311296 0
brcmutil 20480 1 brcmfmac
cfg80211 614400 1 brcmfmac
rfkill 32768 5 cfg80211
i2c_bcm2835 16384 0
spi_bcm2835aux 16384 0
spi_bcm2835 20480 0
bcm2835_gpiomem 16384 2
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
fixed 16384 0
i2c_dev 20480 0
ip_tables 24576 2 iptable_filter,iptable_nat
x_tables 36864 4 ip_tables,iptable_filter,ipt_MASQUERADE,xt_conntrack
ipv6 438272 46

@navio:~ $ sudo modprobe -r rcio_spi && sudo modprobe rcio_spi && dmesg | grep rcio
[ 7.292005] rcio_core: loading out-of-tree module taints kernel.
[ 7.314089] rcio spi1.0: rcio_status: Firmware CRC: 0xb09979ae
[ 7.314760] rcio spi1.0: rcio_status: Board type: 0x0 (navio2)
[ 7.315439] rcio spi1.0: rcio_status: Git hash: dae830a
[ 7.316235] rcio spi1.0: rcio_pwm: Advanced frequency configuration is supported on this firmware
[ 7.319256] rcio spi1.0: rcio_pwm: updated freq on grp 0 to 50
[ 7.323712] rcio spi1.0: rcio_pwm: updated freq on grp 1 to 50
[ 7.326364] rcio spi1.0: rcio_pwm: updated freq on grp 2 to 50
[ 7.329886] rcio spi1.0: rcio_pwm: updated freq on grp 3 to 50
[ 7.354413] rcio spi1.0: rcio_pwm: PWM probe success
[ 7.355304] rcio spi1.0: rcio_gpio: GPIO is supported on this firmware
[ 7.355327] rcio spi1.0: rcio_gpio: registered gpio module
[ 7.355700] rcio spi1.0: rcio_gpio: gpiochip added successfully under gpio500
[ 318.243843] rcio spi1.0: rcio_status: Firmware CRC: 0xb09979ae
[ 318.244567] rcio spi1.0: rcio_status: Board type: 0x0 (navio2)
[ 318.245285] rcio spi1.0: rcio_status: Git hash: dae830a
[ 318.246112] rcio spi1.0: rcio_pwm: Advanced frequency configuration is supported on this firmware
[ 318.248194] rcio spi1.0: rcio_pwm: updated freq on grp 0 to 50
[ 318.248877] rcio spi1.0: rcio_pwm: updated freq on grp 1 to 50
[ 318.249555] rcio spi1.0: rcio_pwm: updated freq on grp 2 to 50
[ 318.250286] rcio spi1.0: rcio_pwm: updated freq on grp 3 to 50
[ 318.261401] rcio spi1.0: rcio_pwm: PWM probe success
[ 318.262136] rcio spi1.0: rcio_gpio: GPIO is supported on this firmware
[ 318.262150] rcio spi1.0: rcio_gpio: registered gpio module
[ 318.262360] rcio spi1.0: rcio_gpio: gpiochip added successfully under gpio500

Picture of the setup

1 Like

Hi @julien.16071983,

Could you please check whether the following examples work or not?

Hi Tatiana,

Results of examples are not good.

@navio:~/Navio2/Python $ sudo python AccelGyroMag.py -i mpu
Selected: MPU9250
Connection established: False

@navio:~/Navio2/Python $ sudo python AccelGyroMag.py -i lsm
Selected: LSM9DS1
Connection established: False

@navio:~/Navio2/Python $ sudo python GPS.py
It never shows any line.

@navio:~/Navio2/Utilities/ublox-spi-to-tcp $ make
g++ -I ../.. ublox-spi-to-tcp.c -o ublox-spi-to-tcp
@navio:~/Navio2/Utilities/ublox-spi-to-tcp $ ./ublox-spi-to-tcp 5000
open() SPI error

@navio:~/Navio2 $ ls /dev/*spi*
/dev/spidev0.0  /dev/spidev0.1  /dev/spidev0.2  /dev/spidev0.3

@navio:~/Navio2 $ sudo nano /etc/modules
i2c-dev

I added ‘spi-dev’ in in /etc/modules but it does not change anything.

I even added spi to user but it’s still not working

@navio:~/Navio2/Python $ groups
myloginname sudo users netdev spi
@navio:~/Navio2/Python $ sudo groups
root spi

/boot/config.txt

[all]
dtoverlay=pi3-disable-bt

dtparam=spi=on
dtoverlay=spi0-4cs
dtoverlay=spi1-1cs,cs0_pin=16,cs0_spidev=disabled
dtoverlay=rcio
dtoverlay=navio-rgb

dtparam=i2c1=on
dtparam=i2c1_baudrate=1000000

'# Additional overlays and parameters are documented /boot/overlays/README

'# Enable audio (loads snd_bcm2835)
#dtparam=audio=on

start_x=1
gpu_mem=128

disable_camera_led=1

Outputs with c examples are:

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

@navio:~/Navio2/C++/Examples/AccelGyroMag $ ./AccelGyroMag -i lsm
Selected: LSM9DS1
Sensor not enabled

@navio:~/Navio2/C++/Examples/GPS $ ./gps
Ublox test not passed
Abort program!

@navio:~/Navio2/Utilities/ublox-spi-to-tcp $ ./ublox-spi-to-tcp 5000
Waiting for connection.
Connection accepted.
Client disconnected.

Nothing happens on the u-blox packets monitor

??:??:??  R <- UBX MON,  Size   8,  'Monitor'
??:??:??  R <- UBX MON,  Size   8,  'Monitor'
??:??:??  R <- UBX MON,  Size   8,  'Monitor'
??:??:??  R <- UBX MON,  Size   8,  'Monitor'
??:??:??  R <- UBX INF,  Size  40,  'Information'

Hi @julien.16071983,

May I ask you to reflash the SD card with the latest image and check whether the issue remains? Just to eliminate the fact that it may be a software issue.

Could you also make sure the header isn’t damaged?

Tatiana,

With the latest image, everything is working fine. This is just a software issue. I get an “Under-voltage detected” message which might be unrelated to my issue.

I’ve added my user with more groups with ‘sudo usermod -a -G input myloginname’ but it does not work better.

@navio:~ $ groups
myloginname sudo users input netdev gpio i2c spi

What is strange is when I log in as fast I can and run ‘python Navio2/Python/AccelGyroMag.py -i mpu’ it works and then stops.

Do you have any advice to find what’s wrong ?

I run other softwares on my Pi and I recently reinstalled everything. Starting again from a fresh install takes too much time, I would like to avoid this option.

Thank you!

You can save an .img of your working sdcard and restore it when needed.

It seems that reloading the spi_bcm2835 makes it work for a moment.

@navio:~ $ sudo modprobe -r spi_bcm2835 && sudo modprobe spi_bcm2835 && lsmod | grep spi
spi_bcm2835            20480  0
rcio_spi               16384  0
rcio_core              36864  1 rcio_spi
spidev                 16384  0
spi_bcm2835aux         16384  0
@navio:~ $ python Navio2/Python/AccelGyroMag.py -i mpu
Selected: MPU9250
Connection established: True
Acc:  -0.115  -0.124  +9.912  Gyr:   -0.001   -0.006   +0.026  Mag:  +0.000  +0.000  +0.000
Acc:  -0.163  -0.129  +9.787  Gyr:   +0.001   -0.005   +0.024  Mag:  +0.000  +0.000  +0.000

but it ends with a failure after some time

Acc:  +0.000  +0.000  +0.000  Gyr:   +0.000   +0.000   +0.000  Mag:  +0.000  +0.000  +0.000
Acc:  +0.000  +0.000  +0.000  Gyr:   +0.000   +0.000   +0.000  Mag:  +0.000  +0.000  +0.000
Acc:  +0.000  +0.000  +0.000  Gyr:   +0.000   +0.000   +0.000  Mag:  +0.000  +0.000  +0.000


@navio:~ $ python Navio2/Python/AccelGyroMag.py -i mpu
Selected: MPU9250
Connection established: False

Just leaving the bcm2835 is enough to make the example works (removing the rcio_spi)

@navio:~ $ python Navio2/Python/AccelGyroMag.py -i mpu
Selected: MPU9250
Connection established: True
Acc:  -0.115  +0.000  +9.922  Gyr:   -0.002   -0.010   +0.023  Mag: -3548.285 +30.122  +0.000
Acc:  -0.168  -0.029  +9.697  Gyr:   +0.001   -0.007   +0.021  Mag: -13.268 -505.976 +97.472
Acc:  -0.177  -0.062  +9.888  Gyr:   +0.000   -0.009   +0.026  Mag: -11.834 -505.976 +95.737


@navio:~ $ lsmod | grep spi && lsmod | grep bcm
spi_bcm2835            20480  0
spidev                 16384  0
spi_bcm2835            20480  0
bcm2835_gpiomem        16384  0

It works fine until 0 are displayed then the bcm2835_gpiomem value changes to 2.
( Reloading the spi_bcm2835 module make bcm2835_gpiomem back to 0 and then all examples work fine for short a moment less than 1 mn)

Pin 11 was accessed by another py file, which is not free.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.