-
Notifications
You must be signed in to change notification settings - Fork 300
/
setup.htm
304 lines (255 loc) · 11.3 KB
/
setup.htm
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="en-us" http-equiv="Content-Language"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>weewx: Installation using setup.py</title>
<link href="css/weewx_docs.css" rel="stylesheet"/>
<link rel="icon" type="image/png" href="/docs/images/favicon.png">
</head>
<body>
<h1 class="title">weewx: Installation using setup.py</h1>
<p class='os-icons'>
<img class='logo' src='images/logo-linux.png' alt=""/>
<img class='logo' src='images/logo-debian.png' alt=""/>
<img class='logo' src='images/logo-ubuntu.png' alt=""/>
<img class='logo' src='images/logo-mint.png' alt=""/><br/>
<img class='logo' src='images/logo-redhat.png' alt=""/>
<img class='logo' src='images/logo-centos.png' alt=""/>
<img class='logo' src='images/logo-fedora.png' alt=""/>
<img class='logo' src='images/logo-suse.png' alt=""/>
</p>
<p>These are generic instructions for installing
<span class="code">weewx</span> using the Python utility
<span class="code">setup.py</span>.
</p>
<p>The installation will place <span class="code">weewx</span> in the
<span class="code">/home/weewx</span> directory with the following
layout: </p>
<table class='locations' style="width:50%">
<tr>
<td align='right'>executable:</td>
<td class='tty'>/home/weewx/bin/weewxd</td>
</tr>
<tr>
<td align='right'>configuration file:</td>
<td class='tty'>/home/weewx/weewx.conf</td>
</tr>
<tr>
<td align='right'>utilities:</td>
<td class='tty'>/home/weewx/bin/</td>
</tr>
<tr>
<td align='right'>skins and templates:</td>
<td class='tty'>/home/weewx/skins/</td>
</tr>
<tr>
<td align='right'>sqlite databases:</td>
<td class='tty'>/home/weewx/archive/</td>
</tr>
<tr>
<td align='right'>generated web pages and images:</td>
<td class='tty'>/home/weewx/public_html/</td>
</tr>
<tr>
<td align='right'>documentation:</td>
<td class='tty'>/home/weewx/docs/</td>
</tr>
</table>
<h2>Install Prerequisites</h2>
<p>Ensure that Python2 is installed. Python 2.6 or 2.7 will work,
but Python 3 will not.</p>
<pre class='tty cmd'>python -V</pre>
<p>Then install required python packages using the package management software for your system (<em>e.g.</em>, <span class='code'>apt-get</span>, <span class='code'>yum</span>, <span class='code'>yast</span>) or the Python Package Management System (<span class='code'>pip</span>). Select the appropriate tab for specific instructions.</p>
<div class='tabs'>
<div id='prereq-tab-debian' class='tab selected' onclick="showprereq('debian')">Debian <imge src='images/logo-debian.png' class='thumbnail' alt=""/> <img src='images/logo-ubuntu.png' class='thumbnail' alt=""/> <img src='images/logo-mint.png' class='thumbnail' alt=""/></div>
<div id='prereq-tab-redhat' class='tab' onclick="showprereq('redhat')">Redhat <img src='images/logo-redhat.png' class='thumbnail' alt=""/> <img src='images/logo-centos.png' class='thumbnail' alt=""/> <img src='images/logo-fedora.png' class='thumbnail' alt=""/></div>
<div id='prereq-tab-suse' class='tab' onclick="showprereq('suse')">SuSE <img src='images/logo-suse.png' class='thumbnail' alt=""/></div>
<div id='prereq-tab-pip' class='tab' onclick="showprereq('pip')">pip</div>
</div>
<div id='prereq' style='clear:both'>
<div id='prereq-debian'>
<pre class='tty'># debian, ubuntu, mint
# required packages:
<span class="cmd">sudo apt-get install python-configobj
sudo apt-get install python-cheetah
sudo apt-get install python-imaging</span>
# required if hardware is serial or USB:
<span class="cmd">sudo apt-get install python-serial
sudo apt-get install python-usb</span>
# required if using MySQL:
<span class="cmd">sudo apt-get install mysql-client
sudo apt-get install python-mysqldb</span>
# required if you are on Raspbian and planning on using FTP:
<span class="cmd">sudo apt-get install ftp</span>
# optional for extended almanac information:
<span class="cmd">sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install pyephem</span></pre>
</div>
<div id='prereq-redhat' style='display:none'>
<pre class='tty'># redhat, centos, fedora
# required packages:
<span class="cmd">sudo yum install python-configobj
sudo yum install python-cheetah
sudo yum install python-imaging</span>
# required if hardware is serial or USB:
<span class="cmd">sudo yum install python-setuptools
sudo easy_install pyserial
sudo easy_install pyusb</span>
# required if using MySQL:
<span class="cmd">sudo yum install mysql-client
sudo yum install python-mysqldb</span>
# optional for extended almanac information:
<span class="cmd">sudo yum install pyephem</span></pre>
</div>
<div id='prereq-suse' style='display:none'>
<pre class='tty'># suse
# on some SuSE systems, use 'yast -i' instead of 'zypper install'
# required packages:
<span class="cmd">sudo zypper install python-configobj
sudo zypper install python-imaging
sudo zypper install python-Cheetah</span>
# required if hardware is serial or USB:
<span class="cmd">sudo zypper install python-pyserial
sudo zypper install pyton-usb</span>
# required if using MySQL:
<span class="cmd">sudo zypper install mysql-community-server-client
sudo zypper install python-mysql</span>
# optional for extended almanac information:
<span class="cmd">sudo zypper install python-devel
sudo zypper install setuptools
sudo pip install pyephem</span></pre>
</div>
<div id='prereq-pip' style='display:none'>
<pre class='tty'># python setup tool (pip)
# required packages:
<span class="cmd">sudo pip install configobj
sudo pip install Cheetah
sudo pip install pillow</span>
# required if hardware is serial or USB:
<span class="cmd">sudo pip install pyserial
sudo pip install pyusb</span>
# optional for extended almanac information:
<span class="cmd">sudo pip install pyephem</span></pre>
</div>
</div>
<h2>Download</h2>
<p>
Download the source archive <span class='code'>weewx-X.Y.Z.tar.gz</span> from <a href="http://weewx.com/downloads"><span class="code">weewx.com/downloads</span></a>.
</p>
<h2>Install <span class='code'>weewx</span></h2>
<p>Expand the source archive:</p>
<pre class="tty cmd">tar xvfz weewx-X.Y.Z.tar.gz</pre>
<p>Change directory:</p>
<pre class="tty cmd">cd weewx-X.Y.Z</pre>
<p>To specify a location different from the standard
<span class='code'>/home/weewx</span>, modify the parameter
<span class='code'>home</span> in the
<span class='code'>setup.cfg</span> file.</p>
<p>Then build and install:</p>
<pre class="tty cmd">./setup.py build
sudo ./setup.py install</pre>
<p>
The installer will prompt for a location, latitude/longitude, altitude, station type, and parameters specific to the station.
</p>
<h2>Run</h2>
<p>Run the main program directly:</p>
<pre class="tty cmd">cd /home/weewx
sudo ./bin/weewxd weewx.conf</pre>
<p>Or as a daemon automatically when the computer starts:</p>
<div class='tabs'>
<div id='startup-tab-debian' class='tab selected' onclick="showstartup('debian')">Debian <img src='images/logo-debian.png' class='thumbnail' alt=""/> <img src='images/logo-ubuntu.png' class='thumbnail' alt=""/> <img src='images/logo-mint.png' class='thumbnail' alt=""/></div>
<div id='startup-tab-redhat' class='tab' onclick="showstartup('redhat')">Redhat <img src='images/logo-redhat.png' class='thumbnail' alt=""/> <img src='images/logo-centos.png' class='thumbnail' alt=""/> <img src='images/logo-fedora.png' class='thumbnail' alt=""/></div>
<div id='startup-tab-suse' class='tab' onclick="showstartup('suse')">SuSE <img src='images/logo-suse.png' class='thumbnail' alt=""/></div>
</div>
<div id='startup' style='clear:both'>
<div id='startup-debian'>
<pre class="tty cmd">cd /home/weewx
sudo cp util/init.d/weewx.debian /etc/init.d/weewx
sudo chmod +x /etc/init.d/weewx
sudo update-rc.d weewx defaults 98
sudo /etc/init.d/weewx start</pre>
</div>
<div id='startup-redhat' style='display:none'>
<pre class="tty cmd">cd /home/weewx
sudo cp util/init.d/weewx.redhat /etc/rc.d/init.d/weewx
sudo chmod +x /etc/rc.d/init.d/weewx
sudo chkconfig weewx on
sudo /etc/rc.d/init.d/weewx start</pre>
</div>
<div id='startup-suse' style='display:none'>
<pre class="tty cmd">cd /home/weewx
sudo cp util/init.d/weewx.suse /etc/init.d/weewx
sudo chmod +x /etc/init.d/weewx
sudo /usr/lib/lsb/install_initd /etc/init.d/weewx
sudo /etc/init.d/weewx start</pre>
</div>
</div>
<h2>Status</h2>
<p>
Look in the system log for messages from <span class='code'>weewx</span>.
For example, on Debian systems:
</p>
<pre class='tty cmd'>sudo tail -f /var/log/syslog</pre>
<h2>Verify</h2>
<p>
After about 5 minutes, open the station web page in a web browser. You
should see your station information and data.
</p>
<pre class='tty'><a href="file:///home/weewx/public_html/index.html">file:///home/weewx/public_html/index.html</a></pre>
<p>If your hardware supports hardware archiving, then how long you wait
will depend on the
<a href="usersguide.htm#archive_interval">archive interval</a>
set in your hardware.
</p>
<h2>Customize</h2>
<p>
To enable uploads such as Weather Underground or to customize reports,
modify the configuration file
<span class='code'>/home/weewx/weewx.conf</span>. See the
<a href="usersguide.htm">User Guide</a> and
<a href="customizing.htm">Customization Guide</a> for details.
</p>
<p>
<span class='code'>weewx</span> must be restarted for configuration file
changes to take effect.
</p>
<h2>Uninstall</h2>
<p>
To uninstall, simply delete the directory
<span class='code'>/home/weewx</span>. This will delete weewx,
configuration files, and data.
</p>
<pre class='tty cmd'>sudo rm -r /home/weewx
sudo rm /etc/init.d/weewx</pre>
<p class='copyright'>
© <a href='copyright.htm'>Copyright</a> Tom Keffer
</p>
<script type="text/javascript">
function showprereq(id) {
document.getElementById('prereq-debian').style.display = 'none';
document.getElementById('prereq-redhat').style.display = 'none';
document.getElementById('prereq-suse').style.display = 'none';
document.getElementById('prereq-pip').style.display = 'none';
document.getElementById('prereq-tab-debian').className = 'tab';
document.getElementById('prereq-tab-redhat').className = 'tab';
document.getElementById('prereq-tab-suse').className = 'tab';
document.getElementById('prereq-tab-pip').className = 'tab';
document.getElementById('prereq-' + id).style.display = 'block';
document.getElementById('prereq-tab-' + id).className = 'tab selected';
}
function showstartup(id) {
document.getElementById('startup-debian').style.display = 'none';
document.getElementById('startup-redhat').style.display = 'none';
document.getElementById('startup-suse').style.display = 'none';
document.getElementById('startup-tab-debian').className = 'tab';
document.getElementById('startup-tab-redhat').className = 'tab';
document.getElementById('startup-tab-suse').className = 'tab';
document.getElementById('startup-' + id).style.display = 'block';
document.getElementById('startup-tab-' + id).className = 'tab selected';
}
</script>
</body>
</html>