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-configwill start.- Select "Advanced Options"
- Select "SSH" to set up SSH access to the Pi.
- Select "Finish" when done.
Install
dddsudo apt-get install dddInstall
geanysudo apt-get install geanyInstall wiringPi (Instructions)
Install
gitsudo apt-get install git-core(Optional) Make sure you have the latest Raspian updates
sudo apt-get update sudo apt-get upgradeGet wiringPi using
gitgit clone git://git.drogon.net/wiringPiMove into the wiringPi directory
cd wiringPi(Optional) Update wiringPi
git pull originBuild wiringPi
./build
Modify the
XAUTHORITYenvironment variable to allowsudofor visual applications.export XAUTHORITY=/home/pi/.Xauthorityif your shell isbashorexport $XAUTHORITY="/home/pi/.Xauthority"if your shell iszsh.Make the change permanent by modifying the
/etc/sudoersfile.sudo visudothen 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/interfacesReplace
iface eth0 inet dhcpwith the following wherexxxis 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.200Use ctrl-x to quit, press
yto confirm saving, thenenterto save the file.sudo rebootto restart with the updated network configurationYou should be able to login with
sshor 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 |