SPI not working with Raspberry 2, Navio2

Dear Emlid people.

I am currently working with two other people on 3 sets of raspberry pi 2 + Navio 2. We all seem to encounter the same problem with the spi interface, so our IMU’s are not working like we would like them to. Our goal is to use the navio board on an RC motorbike, to make some autonomous control, using ROS ( http://wiki.ros.org/ )

Here are the different approaches that we used :

  • Flash the SD card using your own raspbian image. In that case, it is working until a certain point. We figured out from some other forum that the python scripts were not so reliable so we only tried with the C++ version at the end. At this point it is working, until we do apt upgrade, at which point, it is kinda screwing up the kernel somehow ? If we install spi-dev it is also not working anymore.

  • We also tried using some already made images with ROS on them, but that makes the same errors.

  • We tried installing ROS from source, that made the same errors

  • We tried installing ROS from binaries, in this case, we were lacking some libraries ( libboost-mt something ) etc and we could not compile…

  • We also tried installing ubuntu on the RPI but that didn’t work either.

  • We tried using the raspi-config to enable the device tree, the spi interface, also in boot.txt with dtparam=spi=on etc…

  • We also tried the backup of some kernels (suggested somewhere else on the forums) but none of those solutions work permanently. Actually, We had many cases when we thought that it was suddenly working by miracle, even when we rebooted, but when we left for lunch and left it powered off, it was not working when powered on again…

The only way it was working was if we used a fresh image from EMLID and without any modifications…

The main problems that we encounter (For the IMU) are :

Sensor not enabled (C++) / Connection established : true or false, with random output values (Python ) etc. So, Apparently, there is a kernel upgrade from 2708 to 2709 or 2835 or something, which changes everything for the IMU drivers, so anytime that we change those kernels during upgrades or installs or anything, the IMU’s are not working anymore.

So we are kind of desperate, because we need this to work ASAP for our master thesis… We would like to know if there is any way of using the new kernels by upgrading everything and installing new packages such as ROS, or using ubuntu 14.04 LTS, but to make the spi interface still work.

Is there anyone who could help us with this we would be very grateful.

Currently performing apt-get upgrade breaks compatibility with Navio2. We are working on a new image that will solve this issue. Python scripts are being fixed.

The best way would be to install ROS from sources on top of our image without performing apt-get upgrade.

We have plans to provide image with ROS, but this is not yet available.

Ok thanks.

I don’t mind the python being broken I can use everything with C++, so that;s not so much a problem right now. However, if I want to build ROS from source, there is firstly no version compatible with the image you are giving, and also there are a lot of packages that need to be installed ( plus that ROS requires apt upgrade when installing from source ), so in any cases it’s not possible to build it without corrupting the kernels… By the way I have already tried that.

So, isn’t there anything else we could do in the meantime, or perhaps could you detail to us the exact reason why it’s not working, so that we can try to find a temporary fix ourselves ?

I was thinking that maybe we could change something in the drivers, or something, because it seems bcm2835 is handling the SPI differently than bcm2708 ? But then again I’m not so sure how all this works…

Thanks for any advice, recommendations or further explanations !

Are you sure about that? It might be in the tutorial, but it does not look like it should be necessary. Our image is relatively fresh. Can you try without upgrade?

Basically I’m following these instructions : groovy/Installation/Raspbian/Source - ROS Wiki which are for a Wheezy version of raspbian whereas your image is Jessie. (please have a look)

What I do is that I skip all steps in the beginning and start at 2. Then for 3. I use the mobile install, and I get some small errors with that command. I skip 4, and 5, and just do the two commands in 5.6 and build the catkin workspace (6) but I don’t receive the folder “catkin” in the src folder… so I don’t know if all the commands are executed properly… Thus I cannot even continue point 6.

Any suggestions ?


so I actually finally got it to work. Just by using the Indigo version of ROS instead of Groovy version and installing using the source. following these directives for jessie : ROSberryPi/Installing ROS Indigo on Raspberry Pi - ROS Wiki

Thanks for the support !