-
Notifications
You must be signed in to change notification settings - Fork 0
/
Setup
131 lines (129 loc) · 5.22 KB
/
Setup
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
1. Download and install Raspbian Lite image (Jessie)
a) add enable_uart=1 to the end of /boot/config.txt
2. Connect USB to TTY cable to RPi and boot.
3. Setup WiFi
a) sudo iwlist wlan0 scan | grep ESSID
b) wpa_passphrase "SSID" "Password"
c) sudo nano /etc/wpa_supplicant/wpa_supplicant.conf (add network info to bottom of file)
network={
ssid="SSID"
psk=generatedpasskeywithoutquotes
}
d)sudo wpa_cli reconfigure
4. sudo raspi-config
a) change password
b) expand filesystem
c) enable ssh
d) enable i2c
e) change timezone
f) change video memory - 16M
g) change hostname
h) do not wait for network on boot
5. sudo apt-get update && sudo apt-get upgrade
6. sudo apt-get install python-pip git i2c-tools dnsmasq hostapd
7. sudo pip install gitpython
8. sudo apt-get install apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi php5 python-serial python-simplejson python-configobj python-psutil python-git arduino-core build-essential python-dev python-pip git-core
9. sudo pip install psutil --upgrade
10. sudo pip install pyserial --upgrade
a) sudo useradd -m -k /dev/null -G www-data,dialout brewpi
b) sudo -u brewpi git clone -b legacy https://github.com/BrewPi/brewpi-script /home/brewpi/chamber1 #repeat as needed
c) sudo git clone -b legacy https://github.com/BrewPi/brewpi-www /var/www/chamber1 #repeat as needed
d) sudo nano /home/brewpi/chamber1/settings/config.cfg
scriptPath = /home/brewpi/chamber1/
wwwPath = /var/www/chamber1/
port = /dev/chamber1
altport = /dev/null
boardType = uno
e) sudo nano /var/www/chamber1/config_user.php
<?php
// The default settings in config.php are overruled by the settings in config_user.php
// To use custom settings, copy this file to config_user.php and make your changes in config_user.php
// do not add a php closing tag, because newlines after closing tag might be included in the html
// Do not include a trailing slash on the path
$scriptPath = '/home/brewpi/chamber1';
f) sudo nano /etc/cron.d/brewpi_chamber1
PYTHON=/usr/bin/python
SCRIPTPATH=/home/brewpi/chamber1
* * * * * brewpi $PYTHON $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg --checkstartuponly --dontrunfile; [ $? != 0 ] && $PYTHON -u $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg 1>$SCRIPTPATH/logs/stdout.txt 2>>$SCRIPTPATH/logs/stderr.txt &
g) sudo useradd -m -k /dev/null -G www-data,dialout brewpi
h) sudo passwd brewpi
i)
#8. git clone https://github.com/BrewPi/brewpi-tools.git ~/brewpi-tools
#9. sudo ~/brewpi-tools/install.sh (accept defaults)
#10. sudo python ~/brewpi-tools/updater.py --ask (choose legacy on both questions)
11. sudo modprobe rtc-ds1307
a) sudo apt-get -y remove fake-hwclock
b) sudo update-rc.d -f fake-hwclock remove
12. sudo i2cdetect -y 1
13. sudo bash
a) echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
b) exit
c) sudo hwclock -r
14. sudo hwclock -w
15. sudo nano /etc/modules (add to end of file)
rtc-ds1307
16. sudo nano /etc/rc.local (add before exit 0)
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
sudo hwclock -s
date
17. sudo nano /etc/dhcpcd.conf
a) add to bottom of file:
denyinterfaces wlan0
18. sudo nano /etc/network/interfaces
a) change wlan0 to this:
allow-hotplug wlan0
iface wlan0 inet static
address 172.24.1.1
netmask 255.255.255.0
network 172.24.1.0
broadcast 172.24.1.255
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
b) sudo service dhcpcd restart
c) sudo ifdown wlan0
d) sudo ifup wlan0
19. sudo nano /etc/hostapd/hostapd.conf (add the following)
# This is the name of the WiFi interface we configured above
interface=wlan0
# Use the nl80211 driver with the brcmfmac driver
driver=nl80211
# This is the name of the network
ssid=Pi3-AP
# Use the 2.4GHz band
hw_mode=g
# Use channel 6
channel=6
# Enable 802.11n
ieee80211n=1
# Enable WMM
wmm_enabled=1
# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
# Accept all MAC addresses
macaddr_acl=0
# Use WPA authentication
auth_algs=1
# Require clients to know the network name
ignore_broadcast_ssid=0
# Use WPA2
wpa=2
# Use a pre-shared key
wpa_key_mgmt=WPA-PSK
# The network passphrase
wpa_passphrase=raspberry
# Use AES, instead of TKIP
rsn_pairwise=CCMP
20. sudo nano /etc/default/hostapd
a) Find the line #DAEMON_CONF="" and replace it with DAEMON_CONF="/etc/hostapd/hostapd.conf"
21. sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
22. sudo nano /etc/dnsmasq.conf
a) paste:
interface=wlan0 # Use interface wlan0
listen-address=172.24.1.1 # Explicitly specify the address to listen on
bind-interfaces # Bind to the interface to make sure we aren't sending things elsewhere
server=172.24.1.1 # Don't forward DNS requests to Google DNS
domain-needed # Don't forward short names
bogus-priv # Never forward addresses in the non-routed address spaces.
dhcp-range=172.24.1.50,172.24.1.150,12h # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time
23. sudo nano /etc/hosts
a) add the following:
172.24.1.1 localhost