Standard Formula Pi SD card image - Winter 2016

Please note that most of the installation steps will expect the Raspberry Pi to be connected to the internet.
On a Raspberry Pi Zero this will probably need a USB hub and a WiFi / Ethernet dongle.

For MonsterBorgs follow the Standard Formula Pi SD card image - Monster series guide instead.

Basic Raspbian image

The standard image is based on the offical version of Raspbian.
We have tested using the 27th of May 2016 version: http://downloads.raspberrypi.org/raspbian/images/raspbian-2016-05-31/
We recommend following the install guide here.

We also recommend expanding the filesystem using raspi-config:

  1. Enter the following command in a terminal: sudo raspi-config
  2. Move down to option 1 Expand Filesystem and press ENTER
  3. Move right until Finish is highlighted, then press ENTER

Installing the ZeroBorg

First enable I2C using raspi-config:

  1. Enter the following command in a terminal: sudo raspi-config
  2. Move down to option 8 Advanced Options and press ENTER
  3. Move down to option A7 I2C and press ENTER
  4. Make sure Yes is highlighted and press ENTER
  5. When the dialog says I2C is enabled press ENTER
  6. Make sure Yes is highlighted again and press ENTER
  7. When the dialog says I2C will be loaded by default press ENTER
  8. Move right until Finish is highlighted, then press ENTER

If the I2C option is not available simply proceed to the next step.

To run through the automatic installer just use this one line in a terminal:

bash <(curl https://www.piborg.org/install-zeroborg.txt)

If you would prefer to manually run through the steps use the commands below:

mkdir ~/zeroborg
cd ~/zeroborg
wget http://www.piborg.org/downloads/zeroborg/examples.zip
unzip examples.zip
chmod +x install.sh
./install.sh

Setting up the camera

After powering the Raspberry Pi you want to enable the camera functionality:

  1. Enter the following command in a terminal: sudo raspi-config
  2. Move down to option 5 Enable camera and press ENTER
  3. Make right until Enable is highlighted and press ENTER
  4. Move right until Finish is highlighted, then press ENTER
  5. If asked if you would like to reboot, make sure Yes is highlighted, then press ENTER
  6. Wait for the Raspberry Pi to restart

You can check the Raspberry Pi camera is attached and working by using the following command:

raspistill -d

If the camera is working you should see the image from the camera on the monitor for a few seconds.
If it is not working or incorrectly connected you will get error messages instead.

Next we want to install the Python library for talking to the camera:

sudo apt-get -y install python-picamera

As we want to do image processing we want the OpenCV libraries as well.
This download is a bit larger and may take a while:

sudo apt-get -y install libcv-dev libopencv-dev python-opencv

Final notes

We will download and unzip your code into the /home/pi/formulapi directory.
We will add this line into rc.local to start the code:

sudo python /home/pi/formulapi/Formula.py &

This means you will need a Python script called Formula.py as the starting part of your code.
This will be how our standard example works, with Formula.py loading all of the other scripts.

If you wish to use a language other than Python you may, but it must be started from the command in rc.local listed above.
If your code will not run on our standard image you will need to provide a pre-setup micro SD card which will work with the Raspberry Pi Zero and will start up into a waiting for lights state on its own.

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: bash, cpp, perl, python.
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.