Raspberry Pi Setup
Steps
If you are using your own Raspberry Pi and already have your OS installed, skip to step 5.
- Set up the SD Card (Instructions)
- Download NOOBS
- Extract NOOBS
- Copy all files in the .zip to the SD Card directory
- Prepare the Pi for boot
- Insert the SD card in the Pi
- Connect HDMI to display
- Connect a USB keyboard (mouse optional)
- Connect ethernet cable
- Connect USB-micro power (wall or computer is fine)
- Install OS
- Select Raspbian from the list using arrow keys (or mouse) then select "Install".
- Wait a while for the install to complete. The Pi will reboot when it's done.
- When the Pi powers up the first time,
raspi-config
will start.- Select "Advanced Options"
- Select "SSH" to set up SSH access to the Pi.
- Select "Finish" when done.
Install
ddd
sudo apt-get install ddd
Install
geany
sudo apt-get install geany
Install wiringPi (Instructions)
Install
git
sudo apt-get install git-core
(Optional) Make sure you have the latest Raspian updates
sudo apt-get update sudo apt-get upgrade
Get wiringPi using
git
git clone git://git.drogon.net/wiringPi
Move into the wiringPi directory
cd wiringPi
(Optional) Update wiringPi
git pull origin
Build wiringPi
./build
Modify the
XAUTHORITY
environment variable to allowsudo
for visual applications.export XAUTHORITY=/home/pi/.Xauthority
if your shell isbash
orexport $XAUTHORITY="/home/pi/.Xauthority"
if your shell iszsh
.Make the change permanent by modifying the
/etc/sudoers
file.sudo visudo
then insert a line so the file has the following at the top (after the comments)# Defaults env_reset Defaults env_keep+=”HOME XAUTHORITY” Defaults mail_badpass
You're good to go!
Other stuff
SPI device (Lab 7)
If you get the message Unable to open SPI device: No such file or directory
then your SPI device is probably blacklisted. To test this, run cat /etc/modprobe.d/raspi-blacklist.conf
and look at what you see. If you see the following you have a problem. (source)
# blacklist spi and i2c by default (many users don't need them)
blacklist spi-bcm2708
blacklist i2c-bcm2708
What you want to see is the following
# blacklist spi and i2c by default (many users don't need them)
#blacklist spi-bcm2708
blacklist i2c-bcm2708
You can edit the file using sudo nano /etc/modprobe.d/raspi-blacklist.conf
.
Back up and Restore SD card
Mac
diskutil list
diskutil unmountDisk /dev/diskN
dd if=/dev/diskN of=/path/to/image
dd if=/path/to/image of=/dev/diskN
Linux
fdisk -l
unmount /dev/sba*
dd if=/dev/diskN of=/path/to/image
dd if=/path/to/image of=/dev/diskN
Raspberry Pi network addresses
Only needed for using in the e85 lab:
sudo nano /etc/network/interfaces
Replace
iface eth0 inet dhcp
with the following wherexxx
is replaced by the table of IPs.iface eth0 inet static address 134.173.52.xxx netmask 255.255.255.0 broadcast 134.173.52.255 gateway 134.173.52.200
Use ctrl-x to quit, press
y
to confirm saving, thenenter
to save the file.sudo reboot
to restart with the updated network configurationYou should be able to login with
ssh
or putty for the rest of the setup.
rPi | IP Address |
---|---|
01 | 134.173.52.32 |
02 | 134.173.52.33 |
03 | 134.173.52.34 |
04 | 134.173.52.35 |
05 | 134.173.52.36 |
06 | 134.173.52.37 |
07 | 134.173.52.38 |
06 | 134.173.52.39 |
09 | 134.173.52.40 |
10 | 134.173.52.41 |