forked from AdrianBowyer/WiControl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
194 lines (108 loc) · 5.82 KB
/
README
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
Wireless Home/Building Control System
=====================================
Adrian Bowyer
RepRap Ltd
https://reprapltd.com
Licence: GPL
This is a system for controlling devices in buildings (primarily, but not exclusively, heating; it will also do lighting and other things) with a web interface. It is fully open-source and free. The licence is the GPL.
There are two versions:
1. Raspberry Pi + PanStamp in the directory PanStamp. This has been working for a few years, and is now frozen and will not be developed further.
2. WiFi based on the ESP-8266 in the directory ESP-8266. This is in development.
Both start with a php script that serves web pages where you can edit, for example, temperature profiles for individual rooms. That data is saved in files on the server.
The ESP-8266s (or Pi) then get that data and decide(s) what to turn on and off.
More documentation needs to be written...
More importantly, security is minimal and needs to be properly implemented.
See also (for homemade solenoid valves): https://www.thingiverse.com/thing:3496770
WiControl - ESP-8266
====================
This version does everything that the PanStamp version did, but more simply and robustly (the robustness has nothing to do with the hardware change; the PanStamps are fine; it has to do with a simplification of the protocols and hardware).
This version of the system will also support Google Home and Amazon Echo/Alexa.
Some more instructions here would be a good idea...
WiControl - Raspberry Pi + PanStamp
===================================
This allows temperature profiles to be set for each individual room for all times of the day and every day of the week.
It can be controlled using a web browser from anywhere.
It uses Panstamps (http://www.panstamp.com/) for the individual rooms and a Raspberry Pi (https://www.raspberrypi.org/) as the main building controller.
This repository contains all the software and all the hardware designs.
One thing it lacks is full documentation, as I created it for my own use and I know how it works. Sorry.
Installation:
-------------
On the Pi:
This assumes you have an out-of-the-box Raspberry Pi SD card with no extra software installed.
First set your local timezone:
$ sudo dpkg-reconfigure tzdata
You may want to change the default name of the Pi ("raspberrypi") to something more appropriate
like "heatingcontrol". To do that:
$ sudo nano /etc/hostname
That file contains a single name - the name of the Pi. Change it to what you want, save the file, then reboot.
Change you password:
$ passwd
And enable ssh:
$ sudo raspi-config
Next install Apache and PHP:
$ sudo apt-get update
$ sudo apt-get install apache2 -y
$ sudo apt-get install php5 libapache2-mod-php5 -y
At this point it is a good idea to check that the webserver is now running. In the URL address bar of a web browser on a PC or phone type
myname.home/
where myname is the Pi's name that you created above (some networks need myname.local instead). If you don't get anything type
$ ifconfig
on the Pi. This will tell you the Pi's IP address (something like 192.168.1.163). Type that IP address into the web browser's URL bar. You should see the default Apache/Debian server homepage.
Next install ftp:
$ sudo apt-get install ftp
And the ftp demon:
$ sudo apt-get install pure-ftpd
Create an ftp user (see https://www.raspberrypi.org/documentation/remote-access/ftp.md) called "upload" with access to the html directory:
$ sudo groupadd ftpgroup
$ sudo useradd ftpuser -g ftpgroup -s /sbin/nologin -d /dev/null
$ pushd /var/www/html/
$ sudo chown -R ftpuser:ftpgroup .
$ sudo pure-pw useradd upload -u ftpuser -g ftpgroup -d /var/www/html -m
[** You will be asked to create a password for the user upload at this point**]
$ sudo pure-pw mkdb
$ sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/60puredb
$ sudo service pure-ftpd restart
$ popd
You next need to install the heating software:
$ git clone https://github.com/RepRapLtd/WiControl.git
$ cd WiControl/PanStamp
Copy the control file:
$ cp run-heat-control.sample run-heat-control
and edit the file run-heat-control and replace the "zone-1"s with the name of the zone you want.
Copy the sending file:
$ cp sendtemps.sample sendtemps
and edit the sendtemps file to include the ftp password you set above and to change zone-1 to the name of your zone.
Backup the webserver's index file, and copy all the heating web files there and set permissions:
$ sudo mv /var/www/html/index.html /var/www/html/index.html.old
$ cd Web
$ sudo cp -r * /var/www/html
$ sudo chown -R ftpuser:ftpgroup /var/www/html
$ sudo chmod 666 /var/www/html/*.dat
$ sudo chmod 777 /var/www/html/zone-1-Profiles
Finally
$ sudo crontab -e
and add a line at the end like this:
* * * * * /home/pi/WiControl/run-heat-control
That will cause the shell script run-heat-control to be run once a minute.
On the PanStamps:
You can just about run the Arduino IDE on the Raspberry Pi, but it's probably better to
use a big serious computer to do this bit. Install the Arduino IDE on your computer if
you haven't already got it:
https://www.arduino.cc/en/Main/Software
And clone the repository https://github.com/RepRapLtd/WiControl.git as you did on the Pi.
Load the arduino program in the folder Panstamp-control into the IDE.
At the head of the file Control.h set up your heating zones and device names and numbers. Load
this program into each device (e.g. boiler, radiator) on your heating system.
Running
-------
When it runs it creates a status file called Status.
$ cat Status
will tell you what your system last did. If you
$ touch Log
then each time run-heat-control runs it will append the status
report to the end of itself, which keeps a history and is therefore
useful for debugging.
When you have finished debugging don't forget to
$ rm Log
otherwise it will eventually fill up the SD/disc...
Adrian Bowyer