Instructions for getting your Raspberry Pi working with the sensor code.
The software setup for the Raspberry Pi is moderately complex. It requires some decent knowledge of Linux environments. The code to operate the sensors on the Raspberry Pi is available publically on GitHub and is released under the GNU GPL license. The Git repository containing this code can be found here: https://github.com/arharvey918/turbo-sense. This guide was written by Avriel Harvey.
The software referenced on this page is consolidated into the list below for your convenience.
This guide will walk you through the setup of a Raspberry Pi model B+ and the installation of the code that will operate the sensors. There is a list of requirements, a guide for the initial setup of the Raspberry Pi, and finally, steps to download, compile, and run the sensor code on the Raspberry Pi.
The Raspberry Pi Foundation has compiled a great quick-start guide: http://www.raspberrypi.org/help/quick-start-guide/. You should follow this guide understand the initial operating system set up. The NOOBS operating system setup is the easiest to use. The guide for NOOBS can be found here: http://www.raspberrypi.org/help/noobs-setup/. The operating system you need to install using NOOBS is Raspbian. After installation of the operating system onto the microSD card, continue to the next portion of this guide.
After Raspbian is installed, power on your Raspberry Pi with the ethernet cable connected to your router. At the login prompt, sign in as pi with the password raspberry. To install the SSH server, execute the following commands at the shell prompt:
sudo apt-get update
sudo apt-get install openssh-server
If the installation completes successfully, you should now have a SSH server running on your Raspberry Pi. Next, get the IP address of the Pi using the following command:
Now that you have the IP address, you can SSH into your Raspberry Pi from any other computer on the same network. Linux and Macs come with SSH clients by default. Windows computers can use PuTTY or some similar tool as an SSH client.
The source code for our team is stored in a public Git repository. In order to be able to download this to your Pi, you need to install Git using the following command:
sudo apt-get install git
In order to get the most accurate results from the sensors, it is strongly recommended that you run a real-time kernel on the Raspberry Pi. Real-time kernels can significantly reduce latency for user code in the operating system. This is particularly important for this challenge due to the real-time constraints of the system. There are two options that you have:
Option 1 probably takes significantly less time than option 2, but we did not choose this option. Option 2 requires compiling the operating system kernel from scratch. This guide only covers option 2. This can be achieved by using the Raspberry Pi’s 3.12.28 kernel source and applying the rt patch available from kernel.org. The version of the kernel we had success with is 3.12.28-rt40+.
The kernel compilation will take place on the Raspberry Pi.
sudo apt-get install bc build-essential libqt4-dev pkg-config
git clone https://github.com/raspberrypi/linux.git cd linux git checkout rpi-3.12.28
git clone https://github.com/raspberrypi/tools.git
xzcat patches-3.12.26-rt40.tar.xz | patch -p1
cp /proc/config.gz ./ zcat config.gz > .config
export ARCH=arm export CROSS_COMPILE=/home/$USER/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- export INSTALL_MOD_PATH=/home/$USER/raspi-image
make oldconfig | yes make xconfig
make bzImage make modules sudo make modules_install
Congratulations! Your Pi is now ready for the sensor code.
The sensor package code is stored in a public Git repository.
wget abyz.co.uk/rpi/pigpio/pigpio.zip unzip pigpio.zip cd PIGPIO make sudo make install
git clone https://github.com/arharvey918/turbo-sense.git