mirror of
https://github.com/weewx/weewx.git
synced 2026-04-18 08:36:54 -04:00
342 lines
13 KiB
HTML
342 lines
13 KiB
HTML
<!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" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
|
|
|
|
<!-- $Revision$ -->
|
|
<!-- $Author$ -->
|
|
<!-- $Date$ -->
|
|
|
|
<head>
|
|
<meta content="en-us" http-equiv="Content-Language" />
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
|
<title>weewx quick-start for linux</title>
|
|
<link href="weewx_docs.css" rel="stylesheet" />
|
|
<style type="text/css">
|
|
tr {
|
|
vertical-align: middle;
|
|
}
|
|
.cmdtbl {
|
|
border: none;
|
|
width: 100%;
|
|
}
|
|
.cmdcell {
|
|
width: 50%;
|
|
border: none;
|
|
}
|
|
.cmdhdr {
|
|
font-weight: bold;
|
|
font-size: 80%;
|
|
border: none;
|
|
}
|
|
.os-icons {
|
|
float: right;
|
|
margin-left: 100px;
|
|
}
|
|
.logo {
|
|
width: 60px;
|
|
}
|
|
.thumbnail {
|
|
width: 14px;
|
|
}
|
|
.locations {
|
|
margin-left: 20px;
|
|
}
|
|
.tabs {
|
|
float: left;
|
|
margin-left: 20px;
|
|
margin-right: 20px;
|
|
}
|
|
.tab {
|
|
font-size: 80%;
|
|
font-weight: bold;
|
|
color: #aaaaaa;
|
|
margin: 0px;
|
|
padding: 4px 16px 4px 16px;
|
|
float: left;
|
|
}
|
|
.selected {
|
|
color: black;
|
|
border-top: 1px solid #ddddaa;
|
|
border-left: 1px solid #ddddaa;
|
|
border-right: 1px solid #ddddaa;
|
|
background-color: #FFFFee;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
function showpanel(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('startup-debian').style.display = 'none';
|
|
document.getElementById('startup-redhat').style.display = 'none';
|
|
document.getElementById('startup-suse').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('startup-tab-debian').className = 'tab';
|
|
document.getElementById('startup-tab-redhat').className = 'tab';
|
|
document.getElementById('startup-tab-suse').className = 'tab';
|
|
|
|
document.getElementById('prereq-'+id).style.display = 'block';
|
|
document.getElementById('prereq-tab-'+id).className = 'tab selected';
|
|
document.getElementById('startup-'+id).style.display = 'block';
|
|
document.getElementById('startup-tab-'+id).className = 'tab selected';
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1 class="title">weewx: Quick start installation using setup.py</h1>
|
|
<p class="os-icons"><img class="logo" src="logo-linux.png" />
|
|
<img alt="Debian logo" class="logo" src="logo-debian.png" />
|
|
<img alt="Ubuntu logo" class="logo" src="logo-ubuntu.png" />
|
|
<img alt="Mint logo" class="logo" src="logo-mint.png" /><br />
|
|
<img alt="Redhat logo" class="logo" src="logo-redhat.png" />
|
|
<img alt="Centos logo" class="logo" src="logo-centos.png" />
|
|
<img alt="Fedora logo" class="logo" src="logo-fedora.png" />
|
|
<img alt="SuSE logo" class="logo" src="logo-suse.png" /> </p>
|
|
<p>These are generic instructions for installing <span class="code">weewx</span>,
|
|
which should work on any operating system. They use the Python utility
|
|
<span class="code">setup.py</span>. You should use this method if you plan on doing
|
|
customization of <span class="code">weewx</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">
|
|
<tr>
|
|
<td align="right">configuration file: </td>
|
|
<td class="tty">/home/weewx/weewx.conf</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">web pages and images: </td>
|
|
<td class="tty">/home/weewx/public_html/</td>
|
|
</tr>
|
|
</table>
|
|
<h3>Install Prerequisites</h3>
|
|
<p>Ensure that Python2 is installed. Python 2.5, 2.6, or 2.7 will work, but Python
|
|
3 will not. Then install required python packages using the package management system
|
|
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 below
|
|
for the specific installation instructions.</p>
|
|
<div class="tabs">
|
|
<div id="prereq-tab-debian" class="tab selected" onclick="showpanel('debian')">
|
|
Debian <img class="thumbnail" src="logo-debian.png" />
|
|
<img alt="Ubuntu logo" class="thumbnail" src="logo-ubuntu.png" />
|
|
<img alt="Mint logo" class="thumbnail" src="logo-mint.png" /></div>
|
|
<div id="prereq-tab-redhat" class="tab" onclick="showpanel('redhat')">
|
|
Redhat <img class="thumbnail" src="logo-redhat.png" />
|
|
<img alt="Centos logo" class="thumbnail" src="logo-centos.png" />
|
|
<img alt="Fedora logo" class="thumbnail" src="logo-fedora.png" /></div>
|
|
<div id="prereq-tab-suse" class="tab" onclick="showpanel('suse')">
|
|
SuSE <img alt="SuSE logo" class="thumbnail" src="logo-suse.png" /></div>
|
|
<div id="prereq-tab-pip" :="" class="tab" onclick="showpanel('pip')">
|
|
pip</div>
|
|
</div>
|
|
<div id="prereq" style="clear: both">
|
|
<div id="prereq-debian">
|
|
<p class="tty"># Install for Debian, Ubuntu, Mint<br />
|
|
#<br />
|
|
# Required packages:<br />
|
|
sudo apt-get install python-configobj<br />
|
|
sudo apt-get install python-cheetah<br />
|
|
sudo apt-get install python-imaging<br />
|
|
<br />
|
|
# If using MySQL:<br />
|
|
sudo apt-get install python-mysqldb<br />
|
|
sudo apt-get install python-mysql-client<br />
|
|
<br />
|
|
# Install serial or USB, depending on hardware.<br />
|
|
# Consult "<a href="usersguide.htm#Supported_hardware">Supported Hardware</a>"
|
|
in the User's Guide.<br />
|
|
sudo apt-get install python-serial<br />
|
|
sudo apt-get install python-usb<br />
|
|
<br />
|
|
# Optional: for extended almanac information:<br />
|
|
sudo apt-get install python-dev<br />
|
|
sudo apt-get install python-pip<br />
|
|
sudo pip install pyephem<br />
|
|
</p>
|
|
</div>
|
|
<div id="prereq-redhat" style="display: none">
|
|
<p class="tty"># Install for Redhat, Centos, Fedora<br />
|
|
#<br />
|
|
# Required packages:<br />
|
|
sudo yum install python-configobj<br />
|
|
sudo yum install python-cheetah<br />
|
|
sudo yum install python-imaging<br />
|
|
<br />
|
|
# If using MySQL:<br />
|
|
sudo yum install python-mysqldb<br />
|
|
sudo yum install python-mysql-client<br />
|
|
<br />
|
|
# Install serial or USB, depending on hardware.<br />
|
|
# Consult "<a href="usersguide.htm#Supported_hardware">Supported Hardware</a>"
|
|
in the User's Guide.<br />
|
|
sudo yum install pyserial<br />
|
|
sudo yum install pyusb<br />
|
|
<br />
|
|
# Optional: for extended almanac information:<br />
|
|
sudo yum install pyephem<br />
|
|
</p>
|
|
</div>
|
|
<div id="prereq-suse" style="display: none">
|
|
<p class="tty" style="margin-top: 20px"># Install
|
|
for SuSE<br />
|
|
#<br />
|
|
# Required packages:<br />
|
|
sudo yast -i gcc<br />
|
|
sudo yast -i python-configobj<br />
|
|
sudo yast -i python-imaging<br />
|
|
sudo yast -i python-devel<br />
|
|
sudo yast -i setuptools<br />
|
|
<br />
|
|
# Install pip<br />
|
|
sudo pip install Cheetah<br />
|
|
<br />
|
|
# Install serial or USB, depending on hardware.<br />
|
|
# Consult "<a href="usersguide.htm#Supported_hardware">Supported Hardware</a>"
|
|
in the User's Guide.<br />
|
|
sudo yast -i pyserial<br />
|
|
sudo yast -i pyusb<br />
|
|
<br />
|
|
# Optional: for extended almanac information:<br />
|
|
sudo pip install pyephem<br />
|
|
</p>
|
|
</div>
|
|
<div id="prereq-pip" style="display: none">
|
|
<p class="tty"># Install using Python setup tool
|
|
(pip)<br />
|
|
#<br />
|
|
# Required packages:<br />
|
|
sudo pip install configobj<br />
|
|
sudo pip install Cheetah<br />
|
|
sudo pip install pil<br />
|
|
<br />
|
|
# Install serial or USB, depending on hardware.<br />
|
|
# Consult "<a href="usersguide.htm#Supported_hardware">Supported Hardware</a>"
|
|
in the User's Guide.<br />
|
|
sudo pip install pyserial<br />
|
|
sudo pip install pyusb<br />
|
|
<br />
|
|
# Optional: for extended almanac information:<br />
|
|
sudo pip install pyephem<br />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<h3>Download</h3>
|
|
<p>Download the source archive <span class="code">weewx-X.Y.Z.tar.gz</span> from
|
|
<a href="http://sourceforge.net/projects/weewx/files">Sourceforge</a> </p>
|
|
<h3>Install weewx</h3>
|
|
<p>Expand the source archive: </p>
|
|
<p class="tty">tar xvf weewx-X.Y.Z.tar.gz </p>
|
|
<p>Change directory: </p>
|
|
<p class="tty">cd weewx-X.Y.Z </p>
|
|
<p>Then build and install: </p>
|
|
<p class="tty">./setup.py build<br />
|
|
sudo ./setup.py install </p>
|
|
<h3>Configure</h3>
|
|
<p>Edit the configuration file <span class="code">/home/weewx/weewx.conf</span>.
|
|
Set at least the following: </p>
|
|
<ul>
|
|
<li>location</li>
|
|
<li>latitude</li>
|
|
<li>longitude</li>
|
|
<li>altitude</li>
|
|
<li>station_type</li>
|
|
</ul>
|
|
Also set any parameters specific to the station, such as the <span class="code">
|
|
port</span> for stations connected via serial port.<p>If you have a weather station from the Davis Vantage series, many of the configuration
|
|
data will be downloaded from your hardware, including altitude, archive interval,
|
|
and the start of your rain year. If you have not set these, you can either do so
|
|
by following the instructions in the manual that came with your weather station,
|
|
or by using the configuration utility <span class="code">config_vp.py</span>, which
|
|
is included with <span class="code">weewx</span>. To see how to run
|
|
<span class="code">config_vp.py</span>: </p>
|
|
<p class="tty"># This works only for Davis Vantage weather stations!<br />
|
|
cd /home/weewx<br />
|
|
./bin/config_vp.py weewx.conf --help<br />
|
|
</p>
|
|
<h3>Run</h3>
|
|
<p>Run the main program from the command line: </p>
|
|
<p class="tty">cd /home/weewx<br />
|
|
./bin/weewxd.py weewx.conf<br />
|
|
</p>
|
|
<p>You can also run <span class="code">weewx</span> as a daemon, which will automatically
|
|
start when the computer starts: </p>
|
|
<div class="tabs">
|
|
<div id="startup-tab-debian" class="tab selected" onclick="showpanel('debian')">
|
|
Debian <img class="thumbnail" src="logo-debian.png" />
|
|
<img class="thumbnail" src="logo-ubuntu.png" alt="Ubuntu logo"/>
|
|
<img class="thumbnail" src="logo-mint.png" alt="Mint logo"/></div>
|
|
<div id="startup-tab-redhat" class="tab" onclick="showpanel('redhat')">
|
|
Redhat <img class="thumbnail" src="logo-redhat.png" alt="Redhat logo"/>
|
|
<img class="thumbnail" src="logo-centos.png" alt="Centos logo"/>
|
|
<img class="thumbnail" src="logo-fedora.png" alt="Fedora logo"/></div>
|
|
<div id="startup-tab-suse" class="tab" onclick="showpanel('suse')">
|
|
SuSE <img class="thumbnail" src="logo-suse.png" alt="SuSE logo"/></div>
|
|
</div>
|
|
<div id="startup" style="clear: both">
|
|
<div id="startup-debian">
|
|
<p class="tty">cd /home/weewx<br />
|
|
sudo cp util/init.d/weewx.debian /etc/init.d/weewx<br />
|
|
sudo chmod +x /etc/init.d/weewx<br />
|
|
sudo update-rc.d weewx defaults 98<br />
|
|
sudo /etc/init.d/weewx start<br />
|
|
</p>
|
|
</div>
|
|
<div id="startup-redhat" style="display: none">
|
|
<p class="tty">cd /home/weewx<br />
|
|
sudo cp util/init.d/weewx.redhat /etc/init.d/weewx<br />
|
|
sudo chmod +x /etc/init.d/weewx<br />
|
|
sudo chkconfig weewx on<br />
|
|
sudo /etc/init.d/weewx start<br />
|
|
</p>
|
|
</div>
|
|
<div id="startup-suse" style="display: none">
|
|
<p class="tty">cd /home/weewx<br />
|
|
sudo cp util/init.d/weewx.suse /etc/init.d/weewx<br />
|
|
sudo chmod +x /etc/init.d/weewx<br />
|
|
sudo chkconfig weewx on<br />
|
|
sudo /etc/init.d/weewx start<br />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<h3>Verify</h3>
|
|
<p>After 5 minutes, open the station web page in a web browser:</p>
|
|
<p class="tty"><a href="file:///home/weewx/public_html/index.html">file:///home/weewx/public_html/index.html</a></p>
|
|
<p>You should see the default weewx page with your station information and data.</p>
|
|
<h3>Status</h3>
|
|
<p>Look in the system log for messages from <span class="code">weewx</span>. For
|
|
example, with Debian systems:</p>
|
|
<p class="tty">tail -f /var/log/syslog </p>
|
|
<h3>Customize</h3>
|
|
<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>
|
|
<h3>Uninstall</h3>
|
|
<p>To uninstall, simply delete the directory <span class="code">/home/weewx</span>.
|
|
This will delete weewx, configuration files, and data. </p>
|
|
<p class="tty">sudo rm -r /home/weewx<br />
|
|
sudo rm /etc/init.d/weewx<br />
|
|
</p>
|
|
<p class="copyright">© <a href="copyright.htm">Copyright</a> Tom Keffer </p>
|
|
|
|
</body>
|
|
|
|
</html>
|