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
:
- Enter the following command in a terminal:
sudo raspi-config
- Move down to option
1 Expand Filesystem
and press ENTER - Move right until
Finish
is highlighted, then press ENTER
Installing the ZeroBorg
First enable I2C using raspi-config
:
- Enter the following command in a terminal:
sudo raspi-config
- Move down to option
8 Advanced Options
and press ENTER - Move down to option
A7 I2C
and press ENTER - Make sure
Yes
is highlighted and press ENTER - When the dialog says I2C is enabled press ENTER
- Make sure
Yes
is highlighted again and press ENTER - When the dialog says I2C will be loaded by default press ENTER
- 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:
- Enter the following command in a terminal:
sudo raspi-config
- Move down to option
5 Enable camera
and press ENTER - Make right until
Enable
is highlighted and press ENTER - Move right until
Finish
is highlighted, then press ENTER - If asked if you would like to reboot, make sure
Yes
is highlighted, then press ENTER - 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.
Add new comment