-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
80 lines (63 loc) · 2 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
Running debian for the first time.
Login
$ sudo su
# apt remove apache2
# apt update
# apt upgrade
# dpkg-reconfigure tzdata
# dpkg-reconfigure locales
# wget -qO - http://weewx.com/keys.html | sudo apt-key add -
# wget -qO - http://weewx.com/apt/weewx.list | sudo tee /etc/apt/sources.list.d/weewx.list
# apt update
Copy rc.local to /etc (Modify the power saving time if necessary)
Copy weather-power-saver to /etc
# chmod +x /etc/rc.local
# chmod +x /etc/weather-power-saver
Only copy these file if you have a webcam and are sftp-ing the image.
Copy upload.sh to /etc (Edit and add the username, password and host)
Copy uploadfile.sftp to /etc
# chmod +x /etc/upload.sh (webcam only)
# apt install fswebcam putty-tools (webcam only)
# apt install weewx
# apt install python-ephem (option for addition power saving, sun rise and sun set)
# chmod + /home/debian/sunrise.py
# chmod + /home/debian/sunset.py
When you are done, weeWX will be running in the background as a daemon.
If you are using a third-party weather service. EG. Weather underground.
Edit the /etc/weewx/weewx.conf add your usename and password.
NOTE: vantage: LOOP try #1; error: Expected to read 99 chars; got 0 instead
edit /usr/shared/weewx/weewx/drivers/vantage.py
Change: 200 to 100
for _loop_packet in self.genDavisLoopPackets(200):
to:
for _loop_packet in self.genDavisLoopPackets(100):
# tailf /var/log/syslog
Add to .bashrc
# Shut down power saving?
while true; do
read -p "Shut down powersaver [Y/n]?" yn
case $yn in
[Yy]* )
sudo service rc.local stop;
sudo systemctl daemon-reload;
break;;
[Nn]* )
break;;
* )
echo "Please answer y or n";;
esac
done
Add to .bash_logout
# Start power saving?
while true; do
read -p "Start powersaver [Y/n]?" yn
case $yn in
[Yy]* )
sudo service rc.local start;
break;;
[Nn]* )
break;;
* )
echo "Please answer y or n";;
esac
done