mirror of
https://github.com/weewx/weewx.git
synced 2026-04-18 08:36:54 -04:00
305 lines
12 KiB
HTML
305 lines
12 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">
|
|
<!-- $Id$ -->
|
|
<head>
|
|
<meta content="en-us" http-equiv="Content-Language" />
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
|
<title>Installation using setup.py</title>
|
|
<link href="css/weewx_docs.css" rel="stylesheet" />
|
|
<style type="text/css">
|
|
.os-icons {
|
|
float: right;
|
|
margin-left: 100px;
|
|
}
|
|
.logo {
|
|
width: 60px;
|
|
}
|
|
.tty {
|
|
white-space: pre-line;
|
|
}
|
|
</style>
|
|
<script>
|
|
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>
|
|
</head>
|
|
<body>
|
|
<h1 class="title">weewx: Installation using setup.py</h1>
|
|
<p class='os-icons'>
|
|
<img class='logo' src='logo-linux.png'/>
|
|
<img class='logo' src='logo-debian.png'/>
|
|
<img class='logo' src='logo-ubuntu.png'/>
|
|
<img class='logo' src='logo-mint.png'/><br/>
|
|
<img class='logo' src='logo-redhat.png'/>
|
|
<img class='logo' src='logo-centos.png'/>
|
|
<img class='logo' src='logo-fedora.png'/>
|
|
<img class='logo' src='logo-suse.png'/>
|
|
</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:40%; font-size: 90%">
|
|
<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'>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>
|
|
|
|
<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.</p>
|
|
<p class='tty'>python -V</p>
|
|
<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 <img src='logo-debian.png' class='thumbnail' /> <img src='logo-ubuntu.png' class='thumbnail' /> <img src='logo-mint.png' class='thumbnail' /></div>
|
|
<div id='prereq-tab-redhat' class='tab' onclick="showprereq('redhat')">Redhat <img src='logo-redhat.png' class='thumbnail' /> <img src='logo-centos.png' class='thumbnail' /> <img src='logo-fedora.png' class='thumbnail' /></div>
|
|
<div id='prereq-tab-suse' class='tab' onclick="showprereq('suse')">SuSE <img src='logo-suse.png' class='thumbnail' /></div>
|
|
<div id='prereq-tab-pip' class='tab' onclick="showprereq('pip')">pip</div>
|
|
</div>
|
|
<div id='prereq' style='clear:both'>
|
|
<div id='prereq-debian'>
|
|
<p class='tty'># debian, ubuntu, mint
|
|
|
|
# required packages:
|
|
sudo apt-get install python-configobj
|
|
sudo apt-get install python-cheetah
|
|
sudo apt-get install python-imaging
|
|
|
|
# required if hardware is serial or USB:
|
|
sudo apt-get install python-serial
|
|
sudo apt-get install python-usb
|
|
|
|
# required if using MySQL:
|
|
sudo apt-get install mysql-client
|
|
sudo apt-get install python-mysqldb
|
|
|
|
# required if you are on Raspbian and planning on using FTP:
|
|
sudo apt-get install ftp
|
|
|
|
# optional for extended almanac information:
|
|
sudo apt-get install python-dev
|
|
sudo apt-get install python-pip
|
|
sudo pip install pyephem
|
|
</p>
|
|
</div>
|
|
<div id='prereq-redhat' style='display:none'>
|
|
<p class='tty'># redhat, centos, fedora
|
|
|
|
# required packages:
|
|
sudo yum install python-configobj
|
|
sudo yum install python-cheetah
|
|
sudo yum install python-imaging
|
|
|
|
# required if hardware is serial or USB:
|
|
sudo yum install python-setuptools
|
|
sudo easy_install pyserial
|
|
sudo easy_install pyusb
|
|
|
|
# required if using MySQL:
|
|
sudo yum install mysql-client
|
|
sudo yum install python-mysqldb
|
|
|
|
# optional for extended almanac information:
|
|
sudo yum install pyephem
|
|
</p>
|
|
</div>
|
|
<div id='prereq-suse' style='display:none'>
|
|
<p class='tty'># suse
|
|
# on some SuSE systems, use 'yast -i' instead of 'zypper install'
|
|
|
|
# required packages:
|
|
sudo zypper install python-configobj
|
|
sudo zypper install python-imaging
|
|
sudo zypper install python-Cheetah
|
|
|
|
# required if hardware is serial or USB:
|
|
sudo zypper install python-pyserial
|
|
sudo zypper install pyton-usb
|
|
|
|
# required if using MySQL:
|
|
sudo zypper install mysql-community-server-client
|
|
sudo zypper install python-mysql
|
|
|
|
# optional for extended almanac information:
|
|
sudo zypper install python-devel
|
|
sudo zypper install setuptools
|
|
sudo pip install pyephem
|
|
</p>
|
|
</div>
|
|
<div id='prereq-pip' style='display:none'>
|
|
<p class='tty'># python setup tool (pip)
|
|
|
|
# required packages:
|
|
sudo pip install configobj
|
|
sudo pip install Cheetah
|
|
sudo pip install pil
|
|
|
|
# required if hardware is serial or USB:
|
|
sudo pip install pyserial
|
|
sudo pip install pyusb
|
|
|
|
# optional for extended almanac information:
|
|
sudo pip install pyephem
|
|
</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 <span class='code'>weewx</span></h3>
|
|
<p>Expand the source archive:</p>
|
|
<p class="tty">tar xvfz weewx-X.Y.Z.tar.gz</p>
|
|
<p>Change directory:</p>
|
|
<p class="tty">cd weewx-X.Y.Z</p>
|
|
<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>
|
|
<p class="tty">./setup.py build
|
|
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>
|
|
<p>
|
|
Also set any parameters specific to the station, such as the <span class='code'>port</span> for stations connected via serial port.
|
|
</p>
|
|
|
|
<h3>Run</h3>
|
|
<p>Run the main program from the command line:</p>
|
|
<p class="tty">cd /home/weewx
|
|
./bin/weewxd weewx.conf</p>
|
|
<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='logo-debian.png' class='thumbnail' /> <img src='logo-ubuntu.png' class='thumbnail' /> <img src='logo-mint.png' class='thumbnail' /></div>
|
|
<div id='startup-tab-redhat' class='tab' onclick="showstartup('redhat')">Redhat <img src='logo-redhat.png' class='thumbnail' /> <img src='logo-centos.png' class='thumbnail' /> <img src='logo-fedora.png' class='thumbnail' /></div>
|
|
<div id='startup-tab-suse' class='tab' onclick="showstartup('suse')">SuSE <img src='logo-suse.png' class='thumbnail' /></div>
|
|
</div>
|
|
<div id='startup' style='clear:both'>
|
|
<div id='startup-debian'>
|
|
<p class="tty">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
|
|
</p>
|
|
</div>
|
|
<div id='startup-redhat' style='display:none'>
|
|
<p class="tty">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
|
|
</p>
|
|
</div>
|
|
<div id='startup-suse' style='display:none'>
|
|
<p class="tty">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
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Verify</h3>
|
|
<p>
|
|
After 5 minutes, open the station web page in a web browser. You should see your station information and data.
|
|
</p>
|
|
<p class='tty'><a href="file:///home/weewx/public_html/index.html">file:///home/weewx/public_html/index.html</a></p>
|
|
|
|
<h3>Status</h3>
|
|
<p>
|
|
Look in the system log for messages from <span class='code'>weewx</span>.
|
|
For example, on Debian systems:
|
|
</p>
|
|
<p class='tty'>sudo 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
|
|
sudo rm /etc/init.d/weewx
|
|
</p>
|
|
|
|
<p class='copyright'>
|
|
© <a href='copyright.htm'>Copyright</a> Tom Keffer
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|