forked from geekskunk/remotegardensite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RPi_remote_garden_monitor_prep_ArchLinux.txt
148 lines (113 loc) · 3.74 KB
/
RPi_remote_garden_monitor_prep_ArchLinux.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
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
132
133
134
135
136
137
138
139
140
141
142
#---------------------------------------------
# RasperryPi w/Arch Linux setup for GardenPi
# (Post NOOBS v.1.3.3 boot into Arch Linux)
#---------------------------------------------
#---------------------------------------------
# Misc General
#---------------------------------------------
pacman -Syu
pacman -S git
pacman -S traceroute
#---------------------------------------------
# RPI900/dnt900/dnt3400 (to do all http://rpi900.com/ tutorials)
#---------------------------------------------
pacman -S linux-raspberrypi-headers
pacman -S base-devel abs bc wget
pacman -S make
pacman -S gcc
pacman -S ppp
#---------------------------------------------
# Xively (python scripts), could really get away with just python2
#---------------------------------------------
pacman -S python
pacman -S python2
pacman -S python-pip
pacman -S python2-pip
pip2 install --pre xively-python
pip install --pre xively-python
#---------------------------------------------
# Support for headless operations of Garden Sensors
# ref:
# http://supervisord.org/index.html
# https://wiki.archlinux.org/index.php/Systemd
#---------------------------------------------
pacman -S supervisor # Will require python2-setuptools & python2-meld3
cp ./systemd_files/supervisor.service /etc/systemd/system/
#---------------------------------------------
# Specifc supervisor conf for my scripts
#
# edit supervisord.conf add the following:
#---------------------------------------------
[program:air_temp]
directory=/root/garden_monitor/post_to_xively/
command=/root/garden_monitor/post_to_xively/air_temp.py
autostart=true
autorestart=true
[program:rpi_case_temp]
directory=/root/garden_monitor/post_to_xively/
command=/root/garden_monitor/post_to_xively/rpi_case_temp.py
autostart=true
autorestart=true
[program:bat_case_temp]
directory=/root/garden_monitor/post_to_xively/
command=/root/garden_monitor/post_to_xively/bat_case_temp.py
autostart=true
autorestart=true
[program:soil_moisture]
directory=/root/garden_monitor/post_to_xively/
command=/root/garden_monitor/post_to_xively/soil_moisture.py
autostart=true
autorestart=true
[program:soil_temp]
directory=/root/garden_monitor/post_to_xively/
command=/root/garden_monitor/post_to_xively/soil_temp.py
autostart=true
autorestart=true
[program:cpu_temp]
directory=/root/garden_monitor/post_to_xively/
command=/root/garden_monitor/post_to_xively/cpu_temp.py
autostart=true
autorestart=true
systemctl enable supervisor.service
systemctl start supervisor.service
#---------------------------------------------
# Initial hack to get ntp time after boot
#---------------------------------------------
cp ./systemd_files/ntpd.service /etc/systemd/system/
systemctl enable ntpd.service
systemctl start ntpd.service
#---------------------------------------------
# In case of fsck issue
# ref:
# http://www.raspberrypi.org/phpBB3/viewtopic.php?p=477478
#---------------------------------------------
git clone http://daniel-baumann.ch/git/software/dosfstools.git
cd dosfstools
make
# usage:
# umount /boot
# ./fsck.fat -V /dev/<fsck fs issue reported in dmesg>
# (if dirty bit set select 1)
# ./fsck.fat -a /dev/<fsck fs issue reported in dmesg>
# mount /boot
#---------------------------------------------
# Not sure if really needed, pretty sure no
#---------------------------------------------
pacman -S nss-mdns
# required for python-eeml
pacman -S libxml2
pacman -S python-lxml
git clone https://github.com/petervizi/python-eeml.git
cd python-eeml
python setup.py install
#---------------------------------------------
# Setup cronjobs
# Since I didn't set up NTP yet, check every day at 2300
#---------------------------------------------
EDITOR=nano;
export EDITOR
crontab -e
#add the following
0 23 * * * ntpdate -b -s -u pool.ntp.org
#confirm
crontab -l