-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-your-own-pi.txt
102 lines (79 loc) · 3.64 KB
/
install-your-own-pi.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
If you want to run our grovepi software on your own raspberry pi, ask Joe or Stuart and we can burn an sd card for you with a pre-prepared image.
If you don't want to, the instructions below *should* work, as they are roughly how I set up our raspberry pis, but I can't guarantee that they aren't slightly out of date, so you are likely to have some fiddling to do.
First, download raspbian image from:
https://www.raspberrypi.org/downloads/raspbian/
We use lite version on the lab PIs, I think either version will work.
Write the image to an sd card. On windows I used Win32diskimager
http://sourceforge.net/projects/win32diskimager/?source=typ_redirect
Make raspberry pi talk to the grovepi (via I2C)
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c
Start up the raspberry pi with a screen/keyboard (you can connect hdmi to screens in the lab, ask us if you need a keyboard (or unplug from lab machines))
1) sudo raspi-config (if it isn't already in raspi-config)
2) Select interfacing options
3) Select I2C, and press yes to everything - I2C is how the raspberry pi talks to the grovepi board
4) Log in (pi / raspberry)
6)Connect to the wifi network or an ethernet cable.
If you're in the computer lab, you can connect to eduroam. To do this:
type:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
paste into that conf file exactly the below, except with your username and password in there:
network={
ssid="eduroam"
key_mgmt=WPA-EAP
pairwise=CCMP
group=CCMP TKIP
eap=PEAP
identity="<USERNAME>@nottingham.ac.uk"
domain_suffix_match="radius.nottingham.ac.uk"
phase2="auth=MSCHAPV2"
password="YOUR_PASSWORD"
anonymous_identity="anonymous@nottingham.ac.uk"
}
or for a home network it looks like this:
network={
ssid="Joe and Penny"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="your network password"
}
7)Restart wifi
type: sudo ifconfig wlan0 down
sudo ifconfig wlan0 up
8) update everything
sudo apt-get update
sudo apt-get upgrade
8) Install useful i2c utilities:
sudo apt-get install i2c-tools
sudo apt install python3-rpi.gpio
9) make sure kernel support for i2c is reallyu on
sudo i2cdetect -y 1
This should work, and should show something on address 4 of the i2c bus. If not, follow the 'manually enable i2c' instructions from https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c
10)Download the lab software:
First install GIT, which lets you get hold of the software, and subversion which is used in the getlatest script
sudo apt-get install git
sudo apt-get install subversion
git clone https://github.com/joemarshall/g54mrt-useful-code.git
11)Install the show ip address script (and an update script which will get latest versions from github when they change.
cd ~/g54mrt-useful-code/startup-scripts
sudo cp rc.local /etc/rc.local
sudo cp showIP.py /home/pi
sudo cp grovepi.py /home/pi
sudo cp grovelcd.py /home/pi
sudo cp checkUpdate.sh /home/pi
12)Install python3 virtual environment (optional - this makes it so you don't have to type python3 to run your scripts) and make it run as default on login
sudo apt-get install python3-pip
sudo pip3 install virtualenv
virtualenv --system-site-packages py3
echo "source ~/py3/bin/activate\n" >> ~/.profile
13)Add g54mrt user and get the latest grovepi stuff into that user
sudo adduser g54mrt
cd /home/g54mrt
sudo cp /home/pi/g54mrt-useful-code/grovepi-base/getlatest.sh .
sudo chown g54mrt.g54mrt /home/g54mrt/getlatest.sh
sudo -u g54mrt bash ./getlatest.sh
sudo adduser g54mrt i2c
14) Login as g54mrt then make a virtualenv there too
virtualenv --system-site-packages py3
printf "source ~/py3/bin/activate\n" >> ~/.profile