Files
weewx/docs/usersguide.htm
2014-01-29 20:12:33 +00:00

3279 lines
160 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>weewx: User's Guide</title>
<link href="weewx_docs.css" rel="stylesheet" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.toc-1.1.4.min.js" type="text/javascript"></script>
<script>
function showtab(tab,id) {
document.getElementById(tab+'-deb').style.display = 'none';
document.getElementById(tab+'-rpm').style.display = 'none';
document.getElementById(tab+'-setup').style.display = 'none';
document.getElementById(tab+'-'+id).style.display = 'block';
document.getElementById(tab+'-tab-deb').className = 'tab';
document.getElementById(tab+'-tab-rpm').className = 'tab';
document.getElementById(tab+'-tab-setup').className = 'tab';
document.getElementById(tab+'-tab-'+id).className = 'tab selected';
}
</script>
</head>
<body>
<a href='http://weewx.com'>
<img src='logo-weewx.png' class='logo' align='right' />
</a>
<h1 class="title">User's Guide to the weewx Weather System<br />
<span class='version'>
Version: 2.6.0a6
</span>
</h1>
<p>
This is the complete guide to installing and configuring <span class="code">weewx</span>.
</p>
<h1>Table of Contents</h1>
<div id="toc"></div>
<div id="technical_content">
<h1 id="about">About <span class="code">weewx</span></h1>
<p><span class="code"><a href="http://www.weewx.com">weewx</a></span> is
software, written in <a href="http://www.python.org">Python</a>, that
interacts with a weather station to produce plots, reports, and HTML
pages. It can optionally upload the reports to a remote Web server as
well as publish to weather services such as
<a href="http://www.wunderground.com">WeatherUnderground</a> or
<a href="http://www.pwsweather.com/">PWSweather.com</a>.</p>
<p>Initial development began in the winter of 2008-2009, with the first
release in 2009. The SourceForge project was registered in October of
2009.</p>
<p><span class="code">weewx</span> is small, with under 10,000 lines of
code, and well-documented, with over 6,000 lines of comments.</p>
<h1 id="hardware">Supported Hardware</h1>
<p>
Many types of station hardware are supported. In addition to hardware
support, <span class="code">weewx</span> comes with a software
simulator, useful for testing and evaluation.
</p>
<p>The following table enumerates many of the weather stations that
are known to work with <span class='code'>weewx</span>. If your
station is not in the table, check the pictures at the
<a href="http://weewx.com/hardware.html">supported hardware page</a> -
it could be a variation of one of the supported models. You can also
check the <a href="http://weewx.com/hwcmp.html">station comparison</a>
table.
</p>
<p>The maturity column indicates the degree of confidence in the
driver. For stations marked "<span class="code">Tested</span>",
the station is routinely tested as part of the release process
and should work as documented. For stations not marked at all,
they are "known to work" using the indicated driver, but are not
routinely tested. For stations marked
"<span class="code">Experimental</span>", we are still working
on the driver. There can be problems.
</p>
<table class="indent">
<tr>
<td><strong>Vendor</strong></td>
<td><strong>Model</strong></td>
<td><strong>Link</strong></td>
<td><strong>Required<br/>Package</strong></td>
<td><strong>Station<br/>Driver</strong></td>
<td><strong>Maturity</strong></td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Aercus</td>
<td>WS2083</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WS3083</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="4">Ambient Weather</td>
<td>WS1090</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>WS2080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>WS2080A</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>WS2090</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Cresta</td>
<td>WRX815</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>PWS720</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight" rowspan="3">Davis</td>
<td>VantagePro2</td>
<td>Serial or USB</td>
<td class="code">pyserial</td>
<td>Vantage<sup><a href='#vantage'>1</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>VantagePro2</td>
<td>WeatherLink IP</td>
<td class="code">&nbsp;</td>
<td>Vantage<sup><a href='#vantage'>1</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>VantageVue</td>
<td>Serial or USB</td>
<td class="code">pyserial</td>
<td>Vantage<sup><a href='#vantage'>1</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Elecsa</td>
<td>6975</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>6976</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="11">Fine Offset</td>
<td>WH1080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH1081</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH1091</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH1090</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WS1080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WA2080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WA2081</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH2080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH2081</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH3080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WH3081</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="5">Hideki</td>
<td>DV928</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>TE821</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>TE827</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>TE831</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>TE923</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight">Huger</td>
<td>WM918</td>
<td>Serial</td>
<td class="code">pyserial</td>
<td>WMR9x8<sup><a href='#wmr9x8'>4</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight">IROX</td>
<td>Pro X</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight" rowspan="3">La Crosse</td>
<td>C86234</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WS28xx<sup><a href='#ws28xx'>7</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>WS-23XX</td>
<td>Serial</td>
<td class="code">pyserial</td>
<td>WS23xx<sup><a href='#ws23xx'>6</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>WS-28XX</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WS28xx<sup><a href='#ws28xx'>7</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Maplin</td>
<td>N96GY</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>N96FY</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="3">Meade</td>
<td>TE923W</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>TE923W-M</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>TE924W</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight">Mebus</td>
<td>TE923</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight">National Geographic</td>
<td>265</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="9">Oregon Scientific</td>
<td>WMR88</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR100<sup><a href='#wmr100'>2</a></sup></td>
<td></td>
</tr>
<tr>
<td>WMR100</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR100<sup><a href='#wmr100'>2</a></sup></td>
<td></td>
</tr>
<tr>
<td>WMR100N</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR100<sup><a href='#wmr100'>2</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>WMR180</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR100<sup><a href='#wmr100'>2</a></sup></td>
<td></td>
</tr>
<tr>
<td>WMRS200</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR100<sup><a href='#wmr100'>2</a></sup></td>
<td></td>
</tr>
<tr>
<td>WMR200</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR200<sup><a href="#wmr200">3</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>WMR918</td>
<td>Serial</td>
<td class="code">pyserial</td>
<td>WMR9x8<sup><a href='#wmr9x8'>4</a></sup></td>
<td></td>
</tr>
<tr>
<td>WMR928N</td>
<td>Serial</td>
<td class="code">pyserial</td>
<td>WMR9x8<sup><a href='#wmr9x8'>4</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td>WMR968</td>
<td>Serial</td>
<td class="code">pyserial</td>
<td>WMR9x8<sup><a href='#wmr9x8'>4</a></sup></td>
<td>Tested</td>
</tr>
<tr>
<td class="text_highlight" rowspan="3">Radio Shack</td>
<td>63-256</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR100<sup><a href='#wmr100'>2</a></sup></td>
<td></td>
</tr>
<tr>
<td>WX200</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WMR200<sup><a href="#wmr200">3</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>63-1016</td>
<td>Serial</td>
<td class="code">pyserial</td>
<td>WMR9x8<sup><a href='#wmr9x8'>4</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Sinometer</td>
<td>WS1080 / WS1081</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WS3100 / WS3101</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan='2'>TechnoLine</td>
<td>WS-2300</td>
<td>USB</td>
<td class="code">pyserial</td>
<td>WS23xx<sup><a href='#ws23xx'>6</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>WS-2350</td>
<td>USB</td>
<td class="code">pyserial</td>
<td>WS23xx<sup><a href='#ws23xx'>6</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight" rowspan='5'>TFA</td>
<td>Matrix</td>
<td>USB</td>
<td class="code">pyserial</td>
<td>WS23xx<sup><a href='#ws23xx'>6</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>Nexus</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>Opus</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WS28xx<sup><a href='#ws28xx'>7</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>Primus</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>WS28xx<sup><a href='#ws28xx'>7</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>Sinus</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td class="text_highlight">Tycon</td>
<td>TP1080WC</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Watson</td>
<td>W-8681</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td>WX-2008</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight">Velleman</td>
<td>WS3080</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>FineOffsetUSB<sup><a href='#fousb'>5</a></sup></td>
<td></td>
</tr>
<tr>
<td class="text_highlight" rowspan="2">Ventus</td>
<td>W831</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
<tr>
<td>W928</td>
<td>USB</td>
<td class="code">pyusb</td>
<td>TE923<sup><a href='#te923'>8</a></sup></td>
<td>Experimental</td>
</tr>
</table>
<ol>
<li><a id="vantage">Davis &quot;Vantage&quot; series</a> of weather
stations, including the
<a href="http://www.davisnet.com/weather/products/vantage-pro-professional-weather-stations.asp">VantagePro2</a>&trade; and
<a href="http://www.vantagevue.com/">VantageVue</a>&trade;,
using serial, USB, or
<a href="http://www.davisnet.com/weather/products/weather_product.asp?pnum=06555">WeatherLinkIP</a>&trade;
connections. Both the &quot;Rev A&quot; (firmware dated before
22 April 2002) and &quot;Rev B&quot; versions are supported.
</li>
<li><a id="wmr100">Oregon Scientific WMR-100 stations.</a> Tested on the
<a href="http://us.oregonscientific.com/cat-Weather-sub-Professional-Weather-Stations-prod-Pro-Wireless-Weather-Station.html">Oregon Scientific WMR100N</a>.</li>
<li><a id="wmr200">Oregon Scientific WMR-200 stations.</a> Tested on the
<a href="http://www.oregonscientificstore.com/Oregon-Scientific-WMR200-Bundle-Complete-Weather-Bundle.data">Oregon Scientific WMR200</a>.
</li>
<li><a id="wmr9x8">Oregon Scientific WMR-9x8 stations.</a> Tested on the
<a href="http://www.oregonscientificstore.com/oregon_scientific/product.asp?itmky=659831">Oregon Scientific WMR968</a>.
</li>
<li><a id="fousb">Fine Offset 10xx, 20xx, and 30xx stations.</a>
Tested on the
<a href="http://www.ambientweather.com/amws2080.html">Ambient Weather WS2080</a>.
</li>
<li><a id="ws23xx">La Crosse WS-23xx stations.</a> Tested on the
<a href="http://lacrossetechnologies.com/2317/">La Crosse 2317</a>.
</li>
<li><a id="ws28xx">La Crosse WS-28xx stations.</a> Tested on the
<a href="http://lacrossetechnologies.com/2814/">La Crosse C86234</a>.
</li>
<li><a id="te923">Hideki Professional Weather Stations.</a> Tested on the
<a href="http://www.ambientweather.com/hotewiwest.html">Meade TE923</a>.
</li>
</ol>
<h1 id="prerequisites">System Requirements</h1>
<p>I run <span class="code">weewx</span> on a 500MHz system with an AMD
Geode processor and 512 MB of memory. Configured this way, it
consumes about 5% of the CPU and about 50MB of total memory. </p>
<p>On a Marvel 500MHz ARM CPU with 512MB RAM, <span class="code">weewx</span> uses 63MB virtual and
40MB real memory when configured to generate 3 different standard
reports. The CPU use is typically less than 0.5%, maxxing out at
90% for less than a minute every 5 minutes when <span class="code">weewx</span> generates
reports.</p>
<h2>Time</h2>
<p> You should run a <a href="http://www.ntp.org/">NTP</a> daemon on your
server to ensure that it is synchronized with the correct time. Doing so
will greatly reduce errors, especially if you send data to services such
as the Weather Underground. </p>
<p>The time on the VantagePro is automatically synchronized with the
<span class="code">weewx</span> server nominally every four hours
(changeable by the user).</p>
<h2>Python</h2>
<p>Python 2.5, 2.6, or 2.7 is required. Python 3 will not work.</p>
<h1 id="installing">Installing <span class="code">weewx</span></h1>
<h2>Required skills</h2>
<p>
In the world of open-source hobbyist software,
<span class="code"> weewx</span> is pretty easy to install and
configure. There are not many package dependencies, the
configuration is simple, and this guide includes extensive
instructions.
There are thousands of people who have successfully done an
install. However, there is no "point-and-click" interface, so
you have to do some manual configuring.
</p>
<p>You should have the following skills:</p>
<ul>
<li>The patience to read and follow this guide;</li>
<li>Willingness and ability to edit a configuration file;</li>
<li>Some familiarity with Linux or other Unix derivatives;</li>
<li>Ability to do simple Unix tasks such as changing file
permissions and running commands;</li>
<li>No programming experience is necessary unless you wish
to extend weewx. In this case, you should have some
familiarity with Python.</li>
</ul>
<p>If you get stuck, there is a very active <a href="https://groups.google.com/forum/#!forum/weewx-user">User's Group</a> to
help, but please at least try to solve the problem yourself before posting.
</p>
<h2>Installation methods</h2>
<p>
<span class='code'>weewx</span> can be installed using the standard
Python utility <span class='code'>setup.py</span> or it can be installed
from a DEB or RPM package.
</p>
<p>
Installation using <span class="code">setup.py</span> is the recommended
method for those who plan to write custom services and reports for
<span class='code'>weewx</span>.
It will put everything in a single directory, making it easy to modify.
If the user installing <span class='code'>weewx</span> has permission
to write to the directory, root privileges will not be required to
install, run, or modify <span class='code'>weewx</span>.
</p>
<p>
By contrast, the package approach is somewhat simpler, but it requires
root privileges and will install the bits and pieces of
<span class="code">weewx</span> in standard operating system
locations across the file system instead of in a single directory. The net effect is that
configuration files, templates, and code will all be installed in
separate locations, most of which will require root privileges to
modify.</p>
<p>
Here is a summary of the layout for the different install methods, along
with the symbolic names used for each role. These names are used
throughout the documentation. </p>
<div class='tabs' style='padding-top:1em'>
<div id='layout-tab-deb' class='tab selected' onclick="showtab('layout','deb')">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='layout-tab-rpm' class='tab' onclick="showtab('layout','rpm')">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='layout-tab-setup' class='tab' onclick="showtab('layout','setup')">setup.py</div>
</div>
<div id='layout' style='clear:both; width: 60%;'>
<div id='layout-deb'>
<table class='locations' width='100%'>
<tr class='selected'>
<td colspan='3' class='locations_banner'>Application layout for install using DEB package</td>
</tr>
<tr>
<td><strong>Role</strong></td>
<td><strong>Symbolic Name</strong></td>
<td><strong>Nominal Location</strong></td>
</tr>
<tr>
<td>Executables</td>
<td class="symcode">$BIN_ROOT</td>
<td class='tty'>/usr/share/weewx/</td>
</tr>
<tr>
<td>Configuration directory</td>
<td class="symcode">$CONFIG_ROOT</td>
<td class='tty'>/etc/weewx/</td>
</tr>
<tr>
<td>Skins and templates</td>
<td class="symcode">$SKIN_ROOT</td>
<td class='tty'>/etc/weewx/skins/</td>
</tr>
<tr>
<td>Sqlite databases</td>
<td class="symcode">$SQLITE_ROOT</td>
<td class='tty'>/var/lib/weewx/</td>
</tr>
<tr>
<td>Web pages and images</td>
<td class="symcode">$HTML_ROOT</td>
<td class='tty'>/var/www/weewx/</td>
</tr>
<tr>
<td>Documentation</td>
<td class="symcode">$DOC_ROOT</td>
<td class='tty'>/usr/share/doc/weewx/</td>
</tr>
<tr>
<td>PID file</td>
<td class="symcode"></td>
<td class='tty'>/var/run/weewx.pid</td>
</tr>
<tr>
<td>Log file</td>
<td class="symcode"></td>
<td class='tty'>/var/log/syslog</td>
</tr>
</table>
</div>
<div id='layout-rpm' style='display:none'>
<table class='locations' width='100%'>
<tr class='selected'>
<td colspan='3' class='locations_banner'>Application layout for install using RPM package</td>
</tr>
<tr>
<td><strong>Role</strong></td>
<td><strong>Symbolic Name</strong></td>
<td><strong>Nominal Location</strong></td>
</tr>
<tr>
<td>Executables</td>
<td class="symcode">$BIN_ROOT</td>
<td class='tty'>/usr/share/weewx/</td>
</tr>
<tr>
<td>Configuration directory</td>
<td class="symcode">$CONFIG_ROOT</td>
<td class='tty'>/etc/weewx</td>
</tr>
<tr>
<td>Skins and templates</td>
<td class="symcode">$SKIN_ROOT</td>
<td class='tty'>/etc/weewx/skins/</td>
</tr>
<tr>
<td>Sqlite databases</td>
<td class="symcode">$SQLITE_ROOT</td>
<td class='tty'>/var/lib/weewx/</td>
</tr>
<tr>
<td>Web pages and images</td>
<td class="symcode">$HTML_ROOT</td>
<td class='tty'>/var/www/html/weewx/</td>
</tr>
<tr>
<td>Documentation</td>
<td class="symcode">$DOC_ROOT</td>
<td class='tty'>/usr/share/doc/weewx-x.y.z/</td>
</tr>
<tr>
<td>PID file</td>
<td class="symcode"></td>
<td class='tty'>/var/run/weewx.pid</td>
</tr>
<tr>
<td>Log file</td>
<td class="symcode"></td>
<td class='tty'>/var/log/messages</td>
</tr>
</table>
</div>
<div id='layout-setup' style='display:none'>
<table class='locations' width='100%'>
<tr class='selected'>
<td colspan='3' class='locations_banner'>Application layout for install using <span class='code'>setup.py</span></td>
</tr>
<tr>
<td><strong>Role</strong></td>
<td><strong>Symbolic Name</strong></td>
<td><strong>Nominal Location</strong></td>
</tr>
<tr>
<td><span class='code'>weewx</span> root directory</td>
<td class="symcode">$WEEWX_ROOT</td>
<td class="tty">/home/weewx</td>
</tr>
<tr>
<td>Executables</td>
<td class="symcode">$BIN_ROOT</td>
<td class='tty'>/home/weewx/bin/</td>
</tr>
<tr>
<td>Configuration directory</td>
<td class="symcode">$CONFIG_ROOT</td>
<td class='tty'>/home/weewx/</td>
</tr>
<tr>
<td>Skins and templates</td>
<td class="symcode">$SKIN_ROOT</td>
<td class='tty'>/home/weewx/skins/</td>
</tr>
<tr>
<td>Sqlite databases</td>
<td class="symcode">$SQLITE_ROOT</td>
<td class='tty'>/home/weewx/archive</td>
</tr>
<tr>
<td>Web pages and images</td>
<td class="symcode">$HTML_ROOT</td>
<td class='tty'>/home/weewx/public_html/</td>
</tr>
<tr>
<td>Documentation</td>
<td class="symcode">$DOC_ROOT</td>
<td class='tty'>/home/weewx/docs/</td>
</tr>
<tr>
<td>PID file</td>
<td class="symcode"></td>
<td class='tty'>/var/run/weewx.pid</td>
</tr>
<tr>
<td>Log file</td>
<td class="symcode"></td>
<td class='tty'>/var/log/syslog</td>
</tr>
</table>
</div>
</div>
<br/>
<h2><a href='debian.htm'>Installing from DEB package</a></h2>
<p>For Debian, Ubuntu, Mint operating systems, follow the instruction in
<a href='debian.htm'>Installation on Debian Linux systems</a>.</p>
<h2><a href='redhat.htm'>Installing from Redhat RPM package</a></h2>
<p>For Redhat, CentOS, Fedora operating systems, follow the instructions in
<a href='redhat.htm'>Installation on Redhat Linux systems</a>.</p>
<h2><a href='suse.htm'>Installing from SuSE RPM package</a></h2>
<p>For SuSE and OpenSUSE, follow the instructions in
<a href='suse.htm'>Installation on SuSE Linux systems</a>.</p>
<h2><a href='setup.htm'>Installing using the Python tool setup.py</a></h2>
<p>For all operating systems, follow the instructions in
<a href='setup.htm'>Installation using
<span class="code">setup.py</span></a>.</p>
<h1 id="configuring">Configuring <span class="code">weewx</span></h1>
<p>This section covers configuring <span class="code">weewx</span>,
in particular the configuration files
<span class="code">weewx.conf</span> and
<span class="code">skin.conf</span>. </p>
<p>Station specific information is set in the configuration file
<span class="symcode">$CONFIG_ROOT</span><span class="code"><em>/weewx.conf</em></span>.
(There is another configuration file <span class="code">skin.conf</span>
for presentation-specific options, which is described in the
<a href="customizing.htm">Customizing Guide</a> under section <em>
<a href="customizing.htm#standard_skin">Reference: The
standard skin configuration file</a></em>.) </p>
<p>Most of the important options are up near the top of the file. They are
all documented in this section, although you can safely ignore most of
them. The truly important ones, the ones you are likely to have to
customize for your station, are
<span class="config_important">highlighted</span>.
</p>
<p>Default values are provided for many of them, meaning that if they are
not listed in the configuration file <em>at all</em>,
<span class="code">weewx</span> will pick sensible values. When the
documentation below gives a &quot;default value&quot; this is what it
means. However, all options have been given values in the configuration
file that ships with <span class="code">weewx</span>, so you can see
what they look like. The value given in this shipped configuration
file is not necessarily the same as the &quot;default value&quot;. </p>
<p>What follows is organized by the different sections of the
configuration file. </p>
<h2>General</h2>
<p>The options declared at the top are not actually part of any section.</p>
<p class="config_option">debug </p>
<p>Set to 1 to have the program perform extra debug checks, as well as
emit extra information in the log file. Otherwise, set to 0. Default
is 0 (no debug).
</p>
<p class="config_option">WEEWX_ROOT </p>
<p>Set to the root directory of the <span class="code">weewx</span> file
hierarchy for this station. Normally, this is set automatically by the
installation process. Required. No default.
</p>
<p class="config_option">socket_timeout </p>
<p>Set to how long to wait before declaring a socket time out. This is
used when using FTP to send data to a web server or when sending data
to the Weather Underground. Twenty (20) seconds is reasonable. Default
is 20. </p>
<h2 class="config_section">[Station]</h2>
<p>This section covers options relating to your weather station setup. </p>
<p class="config_important">location </p>
<p>The station location should be a UTF-8 string that describes the
geography of where your weather station is located. Required.
No default.</p>
<pre class="tty">location = A small ranch in Kentucky</pre>
<p class="config_important">latitude <br />
longitude </p>
<p>The lat/lon should be set in decimal degrees, negative for southern and
western hemispheres, respectively. Required. No default. </p>
<pre class="tty">latitude = 38.8977
longitude = -77.0366</pre>
<p class="config_option"><span class="config_important">altitude</span></p>
<p>Normally the station altitude is downloaded from your hardware, but not
all stations support this. Set to the altitude of the station and the
unit used for the altitude. Example: </p>
<pre class="tty">altitude = 700, foot</pre>
<p>An example in meters:</p>
<pre class="tty">altitude = 220, meter</pre>
<p class="config_option">rain_year_start
</p>
<p>Normally the start of the rain year is downloaded from your hardware,
but not all stations support this. Set to the start of your rain year,
for example, 10, if your rain year starts in October (as mine does).
Default is 1. </p>
<pre class="tty">rain_year_start = 1</pre>
<p class="config_option">week_start </p>
<p>Start of the week. 0=Monday, 1= Tuesday, ... , 6 = Sunday. Default is 6 (Sunday)
</p>
<pre class="tty">week_start = 0</pre>
<p class="config_important">station_type </p>
<p>Set to the type of hardware you are using.</p>
<pre class="tty">station_type = Simulator</pre>
<p>Valid options include:</p>
<table class="indent">
<tr>
<td class="code">Vantage</td>
<td>Davis Vantage weather stations</td>
</tr>
<tr>
<td class="code">WMR100</td>
<td>Oregon Scientific WMR100 series stations</td>
</tr>
<tr>
<td class="code">WMR200</td>
<td>Oregon Scientific WMR200 series stations</td>
</tr>
<tr>
<td class="code">WMR9x8</td>
<td>Oregon Scientific WMR-918/968 series stations</td>
</tr>
<tr>
<td class="code">FineOffsetUSB</td>
<td>Fine Offset 10xx, 20xx, and 30xx stations</td>
</tr>
<tr>
<td class="code">WS23xx</td>
<td>La Crosse 23xx stations</td>
</tr>
<tr>
<td class="code">WS28xx</td>
<td>La Crosse 28xx stations</td>
</tr>
<tr>
<td class="code">TE923</td>
<td>Hideki TE923 stations</td>
</tr>
</table>
<p id="station_url" class="config_option"><span class="config_important">station_url</span></p>
<p>If you have a website, you may optionally specify an URL for
its HTML server. It will be included in the RSS file generated
by weewx and, if you choose to opt into the <a href="#station_registry">station
registry</a>, it will also be included in the
<a href="http://weewx.com/stations.html">map of weewx stations</a>.</p>
<p>Example (this is mine):</p>
<pre class="tty">station_url = http://www.threefools.org</pre>
<h3 class="config_section">[Vantage]</h3>
<p>This section is for options relating to the Davis Vantage series of hardware
(<em>VantagePro, VantagePro2</em> or <em>VantageVue</em>).</p>
<p class="config_important">type </p>
<p>Set to either <span class="code">serial</span>, for a serial or USB
connection to the VantagePro (by far the most common), or to
<span class="code">ethernet</span> for the WeatherLinkIP. No default.</p>
<p class="config_important">port </p>
<p>If you chose <span class="code">serial</span>, for <span class='code'>type</span>,
then set to the serial port name used by the station. For example,
<span class="code">/dev/ttyUSB0</span> is a common location for USB
ports, <span class="code">/dev/ttyS0</span> for serial ports. Otherwise,
not required. No default. </p>
<p class="config_important">host </p>
<p>If you chose <span class="code">ethernet</span>, then specify either
the IP address (<em>e.g.</em>, <span class="code">192.168.0.1</span>)
or hostname (<em>e.g.</em>, <span class="code">console.mydomain.com</span>)
to the console. Otherwise, not required. No default. </p>
<p class="config_option">baudrate </p>
<p>Set to the baudrate of the station. The default is 19200. </p>
<p class="config_option">tcp_port </p>
<p>The port where WeatherLinkIP will be listening. Default is 22222.
</p>
<p class="config_option">tcp_send_delay </p>
<p>How long to block after sending a socket packet to the WeatherLinkIP.
Default is 1 second. </p>
<p class="config_option">iss_id </p>
<p>Set to the ID number of the Integrated Sensor Suite (ISS). This is used
in the formula to calculate reception quality for wireless stations.
Default is 1. </p>
<p class="config_option">timeout </p>
<p>How many seconds to wait for a response from the station before giving
up. Default is 5 seconds. </p>
<p class="config_option">wait_before_retry </p>
<p>How many seconds to wait before retrying. Unless you have a good reason
to change it, this value should be left at the default, as it is long
enough for the station to offer new data, but not so long as to go into
a new loop packet (which arrive every 2 seconds). Default is 1.2
seconds. </p>
<p class="config_option">max_tries </p>
<p>How many times to try again before giving up. Default is 4. </p>
<h3 class="config_section">[WMR100]</h3>
<p>This section is for options relating to the Oregon Scientific WMR100
series of weather stations with USB connectors.</p>
<p class="config_important">model</p>
<p>Set to the station model. For example, WMR100 or WMRS200.</p>
<p class="config_option">stale_wind</p>
<p>How long a wind record can be used to calculate wind chill (in seconds).
Default is 30.</p>
<h3 class="config_section">[WMR200]</h3>
<p>This section is for options relating to the Oregon Scientific WMR200
series of weather stations with USB connectors.</p>
<p class="config_important">model</p>
<p>Set to the station model. For example, WMR200 or WMR200A.</p>
<p class="config_option">use_pc_time</p>
<p>If True, use the computer time, otherwise use the station time. Default
is False.</p>
<p class="config_option">sensor_status</p>
<p>If True, emit sensor faults and failures to log. Default is True.</p>
<p class="config_option">erase_archive</p>
<p>If True, erase station archive on startup. Default is False.</p>
<h3 class="config_section">[WMR9x8]</h3>
<p>This section is for options relating to the Oregon Scientific WMR-918/968
series of weather stations with serial connectors.</p>
<p class="config_important">type</p>
<p>For the moment, only <span class="code">serial</span> is supported.</p>
<p class="config_important">port </p>
<p>Along with the <span class="code">serial</span> option above, you
must set the serial port name used by the station. For example,
<span class="code">/dev/ttyUSB0</span> is a common location for USB
ports, <span class="code">/dev/ttyS0</span> for serial ports.
No default. </p>
<p class="config_important">model</p>
<p>Set to the station model. For example, WMR968 or WMR918.</p>
<h3 class="config_section">[FineOffsetUSB]</h3>
<p>This section is for options relating to the Fine Offset series of
weather stations with USB connectors.</p>
<p class="config_important">model</p>
<p>Set to the station model. For example, WH1080, WS2080, WH3081, etc. </p>
<p class='config_option'>pressure_offset</p>
<p>
The offset, in millibars, that is applied to values from the
station sensor. This offset is applied to the station pressure
<i>before</i> calculating barometer and altimeter sea level pressures.
Only the raw station pressure is recorded to the database, not the
station pressure with offset applied. Default is None.
</p>
<p class='config_option'>polling_mode</p>
<p>One of <span class='code'>PERIODIC</span> or
<span class='code'>ADAPTIVE</span>. In
<span class='code'>PERIODIC</span> mode,
<span class='code'>weewx</span> queries the console at regular intervals
determined by the <span class='code'>polling_interval</span>.
In <span class='code'>ADAPTIVE</span> mode,
<span class='code'>weewx</span> attempts to query the
console at times when it is not reading data from the sensors or writing
data to memory. The default is <span class='code'>PERIODIC</span>.</p>
<p class='config_option'>polling_interval</p>
<p>The frequency, in seconds, at which <span class='code'>weewx</span> will
poll the console for data. Default is 60. This setting applies only
when the <span class='code'>polling_mode</span> is
<span class='code'>PERIODIC</span>.</p>
<h3 class="config_section">[WS23xx]</h3>
<p>This section is for options relating to the La Crosse WS-23xx series of
weather stations.</p>
<p class="config_important">port</p>
<p>The serial port, e.g., <span class='code'>/dev/ttyS0</span>. When using
a USB-Serial converter, the port will be something like
<span class='code'>/dev/ttyUSB0</span>. Default is
<span class='code'>/dev/ttyUSB0</span></p>
<p class="config_important">model</p>
<p>Set to the station model. For example, WS-2315, LaCrosse WS2317,
etc. Default is "LaCrosse WS23xx".</p>
<p class='config_option'>pressure_offset</p>
<p>
The offset, in millibars, that is applied to values from the
station sensor. This offset is applied to the station pressure
<i>before</i> calculating barometer and altimeter sea level pressures.
Only the raw station pressure is recorded to the database, not the
station pressure with offset applied. Default is None.
</p>
<p class='config_option'>polling_interval</p>
<p>The <span class="code">polling_interval</span> determines how often
<span class="code">weewx</span> will query the station for data. If no
<span class="code">polling_interval</span> is specified (the default),
<span class="code">weewx</span> will automatically use a polling interval
based on the type of connection between the station and the sensors
(wired or wireless). When connected with a wire, the console updates
sensor data every 8 seconds. When connected wirelessly, the console
updates from 16 to 128 seconds, depending on sensor activity.
</p>
<h3 class='config_section'>[WS28xx]</h3>
<p>This section is for options relating to the La Crosse WS-28xx series of
weather stations.</p>
<p class="config_important">transceiver_frequency</p>
<p>Radio frequency to use between USB transceiver and console. Specify
either US or EU. US uses 915 MHz, EU uses 868.3 MHz. Default is US.
</p>
<p class="config_important">model</p>
<p>Set to the station model. For example, LaCrosse WS2810, TFA Primus,
etc. Default is "LaCrosse WS28xx".</p>
<p class='config_option'>pressure_offset</p>
<p>
The offset, in millibars, that is applied to values from the
station sensor. This offset is applied to the station pressure
<i>before</i> calculating barometer and altimeter sea level pressures.
Only the raw station pressure is recorded to the database, not the
station pressure with offset applied. Default is None.
</p>
<h3 class="config_section">[TE923]</h3>
<p>This section is for options relating to the Hideki TE923 series of
weather stations.</p>
<p class="config_important">model</p>
<p>Set to the station model. For example, Meade TE923W or TFA Nexus.
Default is "TE923".</p>
<p class="config_option">sensor_map</p>
<p>This option defines the mapping between temperature/humidity values in
the database and the remote sensors. Up to 5 remote sensors are
supported. A switch on each sensor determines which of 5 channels that
sensor will use. For example, if the switch on the sensor is set to 3,
the temperature from that sensor will be t_3 and the humidity from that
sensor will be h_3.
</p>
<p>The default mapping is:
</p>
<pre class="tty">[[sensor_map]]
outTemp = t_1
outHumidity = h_1
extraTemp1 = t_2
extraHumid1 = h_2
extraTemp2 = t_3
extraHumid2 = h_3
extraTemp3 = t_4
extraHumid3 = h_4
extraTemp4 = t_5
extraHumid4 = h_5</pre>
<p class="config_option">battery_map</p>
<p>This option defines the mapping between battery status values in
the database and the remote sensors. The default mapping is:
</p>
<pre class="tty">[[battery_map]]
txBatteryStatus = batteryUV
windBatteryStatus = batteryWind
rainBatteryStatus = batteryRain
outTempBatteryStatus = battery1
extraBatteryStatus1 = battery2
extraBatteryStatus2 = battery3
extraBatteryStatus3 = battery4
extraBatteryStatus4 = battery5</pre>
<h3 class="config_section">[Simulator]</h3>
<p>This section is for options relating to the software weather station simulator
that comes with <span class="code">weewx</span>.</p>
<p class="config_option">loop_interval</p>
<p>The time (in seconds) between emitting loop packets. Default is 2.5</p>
<p class="config_option">mode</p>
<p>One of either <span class='code'>simulator</span> or <span class='code'>generator</span>. Default is <span class='code'>simulator</span>.</p>
<table class="indent">
<tr>
<td class="code">simulator</td>
<td>Real-time simulator. It will sleep between emitting packets.</td>
</tr>
<tr>
<td class="code">generator</td>
<td>Emit packets as fast as it can. Useful for testing.</td>
</tr>
</table>
<p class="config_option">start</p>
<p>The start time for the generator in the format <span class="code">YYYY-MM-DD
hh:mm</span>. Optional. Default is the present time.</p>
<h2 class="config_section">[StdRESTful]</h2>
<p>This section is for configuring the <span class="code">StdRESTful</span>
service, which uploads to simple
<a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a>
servers such as the <a href="http://www.wunderground.com/">Weather Underground</a>,
<a href="http://www.pwsweather.com/">PWSweather.com</a>, or
<a href="http://www.wxqa.com/">CWOP</a>. </p>
<h3 class="config_section" id="station_registry">[[StationRegistry]]</h3>
<p> A registry of <span class="code">weewx</span> weather stations
is maintained at <span class="code">weewx.com</span>. Stations are
displayed on a map and a list at
<a href="http://weewx.com/stations.html">http://weewx.com/stations.html</a>
</p>
<p>How does the registry work? Individual weather stations
periodically contact the registry. Each station provides a URL to
identify itself, plus other information such as the station type and
<span class="code">weewx</span> version. The registry does not keep
track of meteorological data; no information about the weather is sent
to the registry.</p>
<p>To add your station to this list, you must do two things:</p>
<ol>
<li>Enable the StationRegistry in <span class="code">weewx.conf</span>
by setting the option <span class="code">register_this_station</span>
to <span class="code">True</span>. Your station will contact the
registry once per week. If your station does not contact the
registry for about a month, it will be removed from the list.
</li>
<li>Provide a <span class="code">station_url</span>, either in section
<a href="#station_url"><span class='code'>[Station]</span></a>, or
in the <span class='code'>[[StationRegistry]]</span> section.
</li>
</ol>
<p>The <span class='code'>station_url</span> is used to uniquely identify
each station, so choose it carefully before you set
<span class='code'>register_this_station</span> to
<span class='code'>True</span>.</p>
<pre class="tty">[StdRestful]
[[StationRegistry]]
register_this_station = True</pre>
<p class="config_important">register_this_station</p>
<p>Set this to <span class="code">True</span> to register the weather station.</p>
<p class="config_option">description</p>
<p>
A description of the station. If no description is specified, the
<span class="config_option">location</span> from the <span
class="code">[Station]</span> section will be used.
</p>
<p class="config_option">station_url</p>
<p>
The URL to the weather station. If no URL is specified, the <span
class="config_option">station_url</span> from the <span
class="code">[Station]</span> section will be used.
</p>
<h3 class="config_section">[[Wunderground]]</h3>
<p>
<span class="code">Weewx</span> can send your current data to the
<a href="http://www.wunderground.com/">Weather Underground</a>. If
you do not wish to do this, leave the option
<span class='code'>station</span> commented.
</p>
<pre class="tty">[StdRestful]
[[Wunderground]]
station = 12345678 # Replace with your station number
password = xxxxx # Replace with your password
rapidfire = False</pre>
<p class="config_important">station</p>
<p>
Set to your Weather Underground station ID (<em>e.g.</em>, <span
class="code">KORHOODR3</span>). Required.
</p>
<p class="config_important">password</p>
<p>Set to your Weather Underground password. Required.</p>
<p class="config_option">rapidfire</p>
<p>
Set to <span class="code">True</span> to have <span class="code">weewx</span>
post using the <a href="http://www.wunderground.com/weatherstation/rapidfirehelp.asp">Weather Underground's "Rapidfire" protocol</a>.
This will send a post to the
WU site with every LOOP packet, which can be as often as every 2.5
seconds in the case of the Vantage instruments. Optional. Default
is <span class="code">False</span>.
</p>
<p class="config_option">archive_post</p>
<p>
This option tells <span class="code">weewx</span> to post on every
archive record, which is the normal "PWS" mode for the Weather
Underground. Because they prefer that you either use their
"Rapidfire" protocol, or their PWS mode, but not both, the default
for this option is the opposite for whatever you choose above for
option <span class="code">rapidfire</span>. However, if for some
reason you want to do both, then you may set both options to <span
class="code">True</span>.
</p>
<h3 class="config_section">[[PWSweather]]</h3>
<p><span class="code">Weewx </span>can send your current data to the
<a href="http://www.pwsweather.com/">PWSweather.com</a> service. If you
do not wish to do this, leave the option
<span class='code'>station</span> commented.</p>
<pre class="tty">[StdRestful]
[[PWSweather]]
station = 12345678 # Replace with your station number
password = xxxxx # Replace with your password</pre>
<p class="config_important">station </p>
<p>Set to your PWSweather station ID. Required. </p>
<p class="config_important">password </p>
<p>Set to your PWSweather password. Required. </p>
<h3 class="config_section">[[CWOP]]</h3>
<p><span class="code">Weewx</span> can send your data to the
<a href="http://www.wxqa.com/">Citizen Weather Observer Program</a>. If
you do not wish to do this, leave the <span class="code">station</span>
commented. </p>
<pre class="tty">[StdRestful]
[[CWOP]]
station = 12345678 # Replace with your station number
passcode = xxxxx # Replace with your passcode (APRS stations only)
post_interval = 600</pre>
<p class="config_important">station </p>
<p>Set to your CWOP station ID (<em>e.g.</em>, <span class="code">CW1234</span>). Required.
</p>
<p class="config_important">passcode </p>
<p>This is used for APRS (amateur radio) stations only. Set to the
passcode given to you by the CWOP operators. Otherwise, leave this
option commented. Required for APRS stations, ignored for others.</p>
<p class="config_option">post_interval </p>
<p>The interval in seconds between posts. Because CWOP is heavily used, the
operators discourage very frequent posts. Every 5 minutes (300 seconds)
is fine, but they prefer every 10 minutes (600 s) or even longer. Setting
this value to zero will cause every archive record to be posted.
Optional. Default is zero.</p>
<p class="config_option">stale </p>
<p>How old a record can be before it will not be used for a catch up. CWOP
does not use the timestamp on a posted record. Instead, they use the wall
clock time that it came in. This means that if your station is off the
air for a long period of time, then <span class="code">weewx</span>
attempts a catch up, old data could be interpreted as the current
conditions. Optional. Default is 1800 seconds.</p>
<h3 class="config_section">[[WOW]]</h3>
<p class="config_section"><span class="code">Weewx</span> can send your
current data to the <a href="http://wow.metoffice.gov.uk/">British
Weather Observations Website (WOW)</a> service. If you do not wish
to do this, leave the <span class='code'>station</span> option
commented.</p>
<pre class="tty">[StdRestful]
[[WOW]]
station = 12345678 # Replace with your site ID
password = xxxxx # Replace with your site authentication key</pre>
<p class="config_important">station</p>
<p>Set to your WOW station ID. Required.</p>
<p class="config_important">password</p>
<p>Set to your WOW password. Required.</p>
<h3 class="config_section">[[AWEKAS]]</h3>
<p class="config_section"><span class="code">Weewx</span> can send your
current data to the <a href="http://www.awekas.at/">Automatisches
Wetterkarten System</a> (AWEKAS). If you do not wish
to do this, leave the <span class='code'>username</span> option
commented.</p>
<pre class="tty">[StdRestful]
[[AWEKAS]]
username = joeuser # Replace with your awekas username
password = xxxxx # Replace with your awekas password</pre>
<p class="config_important">username</p>
<p>Set to your AWEKAS username. Required.</p>
<p class="config_important">password</p>
<p>Set to your AWEKAS password. Required.</p>
<p class="config_option">language</p>
<p>Set to your preferred language. Default is <span class='code'>en</span>.</p>
<h2 class="config_section">[StdReport]</h2>
<p>This section is for configuring the <span class="code">StdReport</span> service,
which controls which reports are to be generated. While it can be highly customized
for your individual situation, this documentation describes the section as shipped
in the standard distribution. </p>
<p>Each report is represented by a sub-section, marked with double brackets
(<em>e.g.</em>, <span class="code">[[MyReport]]</span>). Any options for the
report should be placed under it. The standard report service will go through
the sections, running each report in order. Hence, normally the report
<span class="code">[[StandardReport]]</span> will be run first, then report
<span class="code">[[FTP]]</span> (which actually optionally uploads the results
to a remote web server). Details for how to customize reports are in the section
<em><a href="customizing.htm#reports">Opportunities
for customizing reports</a></em>, in the
<a href="customizing.htm">Customizing Guide</a>.
</p>
<p class="config_option">SKIN_ROOT </p>
<p>The directory where the skins live. A relative path is relative to
<span class="symcode">$WEEWX_ROOT</span>.</p>
<p class="config_option">HTML_ROOT </p>
<p>The target directory for the generated files. A relative path is
relative to <span class="symcode">$WEEWX_ROOT</span>. Generated
files and images will be put here. </p>
<h3 class="config_section">[[StandardReport]]</h3>
<p>This is the standard report that will be run on every archiving interval.
It uses the skin &quot;<span class="code">Standard</span>&quot;, which generates
four HTML pages (&quot;day&quot;, &quot;week&quot;, &quot;month&quot;, and &quot;year&quot;
observations), plot graphs for same, an RSS feed, and NOAA monthly and yearly
reports. Unless changed otherwise, it uses US Customary Units and puts the results
in <span class="code">public_html</span> and subdirectory <span class="code">
public_html/NOAA</span>. </p>
<h3 class="config_section">[[FTP]]</h3>
<p>While this &quot;report&quot; does not actually generate anything, it
uses the report machinery to upload files from directory <span class="symcode">
$HTML_ROOT</span> to a remote webserver. It does an incremental update,
that is, it only FTPs any files that have changed, saving the outgoing bandwidth
of your Internet connection. </p>
<p>If you do not use such a server, comment out the first four options below.
</p>
<p class="config_important">user </p>
<p>Set to the username you use for your FTP connection to your web server. Required.
No default. </p>
<p class="config_important">password </p>
<p>Set to the password you use for your FTP connection to your web server. Required.
No default. </p>
<p class="config_important">server </p>
<p>Set to the name of your web server (<em>e.g.</em>, <span class="code">www.threefools.org</span>,
in my case). Required. No default </p>
<p class="config_important">path </p>
<p>Set to the path where the weather data will be stored on your webserver (<em>e.g.</em>, <span class="code">/weather</span>).
NB: some FTP servers require a leading slash (&#39;<span class="code">/</span>&#39;),
some do not. Required. No default. </p>
<p class="config_option">port</p>
<p>Set to the port ID of your FTP server. Default is <span class="code">21</span>.</p>
<p class="config_option">passive</p>
<p>Set to 1 if you wish to use the more modern, FTP passive mode, 0 if you wish
to use active mode. Passive mode generally works better through firewalls, but
not all FTP servers do a good job of supporting it. See
<a href="http://slacksite.com/other/ftp.html">Active FTP vs. Passive FTP, a
Definitive Explanation</a> for a good explanation of the difference. Default
is 1 (passive mode). </p>
<p class="config_option">max_tries </p>
<p><span class="code">Weewx</span> will try up to this many times to FTP a file
up to your server before giving up. Default is 3. </p>
<h3 class="config_section">[[RSYNC]]</h3>
<p>While this &quot;report&quot; does not actually generate anything, it
uses the report machinery to upload files from directory <span class="symcode">
$HTML_ROOT</span> to a remote webserver. It does an incremental update,
that is, it only synchronizes those files that have changed, saving the outgoing
bandwidth of your Internet connection. </p>
<p>If you do not use such a server, comment out the options below. </p>
<p class="config_important">server </p>
<p>Set to the name of your web server (<em>e.g.</em>,
<a href="http://www.threefools.org">www.threefools.org</a>, in my case). Required.
No default </p>
<p class="config_important">user </p>
<p>Set to the ssh username you use for your rsync connection to your web server.
The local user that <span class="code">weewx</span> runs as must have passwordless ssh configured for
user@server. Required. No default. </p>
<p class="config_important">path </p>
<p>Set to the path where the weather data will be stored on your webserver (<em>e.g.</em>, <span class="code">/weather</span>).
Required. No default. </p>
<p class="config_important">delete </p>
<p>Files that don't exist in the local report are removed from the remote location.
<em>USE WITH CAUTION:</em> If you make a mistake in setting the
<span class="code">path</span>, this can cause unexpected files to be deleted
on the remote server. Valid values are 1 to enable and 0 to disable. Required.
Default is 0.</p>
<h2 class="config_section" id="StdConvert">[StdConvert]</h2>
<p>This section is for configuring the <span class="code">StdConvert</span>
service. This service acts as a filter, converting the unit system coming off
your hardware to a target output unit system. Everything that follows, including
the archiving service, will use the target unit system. Hence, your data
will be stored using your chosen unit system. </p>
<p><em>Once chosen, it cannot be changed!</em> Weewx does not allow you to mix
unit systems within the databases. You must chose one or the other and then
stick with it. This means that users coming from wview (which uses US Customary)
should not change the default setting. Having said this, there is a way of reconfiguring
the database to use another unit system. See the section
<a href="customizing.htm#Changing_the_unit_system">Changing the unit system</a>
in the Customizing Guide.</p>
<p>Note that whatever you choose here, it does not affect your options for the
unit system to be used for <i>reporting</i>. Because of this, unless you
have a special purpose application, there is really no good reason to change
from the default, which is <span class="code">US</span>. </p>
<p class="warning"><strong>Warning!</strong><br />
If, despite these precautions, you do
decide to change to Metric, be sure to read the sections <span class="code">
<a href="#StdCalibrate">[StdCalibrate]</a></span> and <span class="code">
<a href="#StdQC">[StdQC]</a></span> below, and change the units there as well!</p>
<p class="config_option">target_unit</p>
<p>Set to either <span class="code">US</span>, <span class="code">METRICWX</span>,
or <span class="code">METRIC</span>. The difference between
<span class="code">METRICWX</span>, and <span class="code">METRIC</span> is that
the former uses <span class="code">mm</span> instead of <span class="code">cm</span>
for rain, and <span class="code">m/s</span> instead of
<span class="code">km/hr</span> for wind speed. See the Appendix <a href="customizing.htm#units">
Units</a> in the Customizing Guide for the exact differences beween
these three choices.
Default is <span class="code">US</span>.</p>
<h2 class="config_section" id="StdCalibrate">[StdCalibrate]</h2>
<p>This section is for configuring the <span class="code">StdCalibrate</span>
service. This service offers an opportunity to correct for any calibration errors
in your instruments. It is very general and flexible. </p>
<p>Because this service is normally run after <span class="code">StdConvert</span>,
the units to be used should be the same as the target unit system chosen in
<a href="#StdConvert"><span class="code">StdConvert</span></a> above. It is
also important that this service be run before the archiving service
<span class="code">StdArchive</span>, so that it is the corrected data that
are stored. </p>
<h3 class="config_section">[[Corrections]]</h3>
<p>In this section you list all <em>correction expressions</em>. For example,
say that you know your outside thermometer reads high by 0.2&deg;F. You could add
the expression: </p>
<p class='tty'>outTemp = outTemp - 0.2</p>
<p>Perhaps you need a linear correction around a reference temperature of 68&deg;F:
</p>
<p class='tty'>outTemp = outTemp + (outTemp-68) * 0.02</p>
<p>It is even possible to do corrections involving more than one variable. Suppose
you have a temperature sensitive barometer: </p>
<p class='tty'>barometer = barometer + (outTemp-32) * 0.0091</p>
<p>All correction expressions are run in the order given. </p>
<p>Both LOOP data and archive data will be corrected. </p>
<p>If you are using a Davis Vantage instrument and all you require is a simple
correction offset, this can also be done in the hardware. See your manual for
instructions. </p>
<h2 class="config_section" id="StdQC">[StdQC]</h2>
<p>This section is for configuring the <span class="code">StdQC</span> service.
This service offers a very simple <em>Quality Control</em> that only checks
that values are within a minimum and maximum range.</p>
<p>Because this service is normally run after <span class="code">StdConvert</span>,
the units to be used should be the same as the target unit system chosen in
<a href="#StdConvert"><span class="code">StdConvert</span></a>. It is also
important that it be run after the calibration service, <span class="code">StdCalibrate
</span>and before the archiving service <span class="code">StdArchive</span>,
so that it is the calibrated and corrected data that are stored. </p>
<h3 class="config_section">[[MinMax]]</h3>
<p>In this section you list the observation types you wish to have checked,
along with their minimum and maximum values. If not specified, the units
should are in <em>the same unit system as specified in section
<span class="code"><a href="#StdConvert">StdConvert</a></span></em>.
</p>
<p>For example, </p>
<pre class="tty">[[MinMax]]
outTemp = -40, 120
barometer = 28, 32.5
outHumidity = 0, 100 </pre>
<p>With <span class='code'>target_unit = US</span> (the default), if a
temperature should fall outside of the inclusive
range -40 &deg;F through 120 &deg;F, then it will be set to the null
value, <span class="code">None</span>, and ignored. In a similar manner,
the acceptable values for barometric pressure would be 28 through 32.5
inHg, for humidity 0 through 100%. </p>
<p>You can also specify units.</p>
<p>For example, </p>
<pre class="tty">[[MinMax]]
outTemp = -40, 60, degree_C
barometer = 28, 32.5, inHg</pre>
<p>In this example, if a temperature should fall outside of the inclusive
range -40 &deg;C through 60 &deg;C, then it will be set to the null
value, <span class="code">None</span>, and ignored. In a similar manner,
the acceptable values for barometric pressure would be 28 through 32.5
inHg. Since the units are specified, these values apply no matter what
the <span class='code'>target_unit</span>.</p>
<p>Both LOOP and archive data will be checked. </p>
<p>Knowing the details of how your hardware encodes data helps to minimize
the number of observations that need to be checked. For example, the VP2
devotes only one unsigned byte to storing wind speed, and even then
<span class="code">0xff</span> is devoted to a bad value, so the only
possible values that could appear are 0 through 126 mph, a reasonable
range. So, for the VP2, there is no real point in checking wind speed.
</p>
<h2 class="config_section" id="StdArchive">[StdArchive]</h2>
<p>This section is for configuring <span class="code">StdArchive</span>, the
service that stores data in the databases. Options allow choosing which database
to use for archiving and statistics.</p>
<p class="config_option">archive_database</p>
<p>The database to be used to store the archive data. This should match a section
given in the section <span class="code"><a href="#Databases">[Databases]</a></span>
below. Normally, this is set to <span class="code">archive_sqlite</span>. If
you are using MySQL, you will want to change this to <span class="code">
archive_mysql</span>.</p>
<p class="config_option">stats_database</p>
<p>The database to be used to store the statistical data. This should match
a section given in the section <span class="code"><a href="#Databases">[Databases]</a></span>
below. Normally, this is set to <span class="code">stats_sqlite</span>. If
you are using MySQL, you will want to change this to <span class="code">
stats_mysql</span>.</p>
<p class="config_option">archive_delay </p>
<p>How long to wait in seconds after the top of an archiving interval before
fetching new data off the station. For example, if your archive interval is
5 minutes and archive_delay is set to 15, then the data will be fetched at 00:00:15,
00:05:15, 00:10:15, etc. This delay is to give the station a few seconds to
archive the data internally, and in case your server has any other tasks to
do at the top of the minute. Default is 15 seconds. </p>
<p class="config_option" id="record_generation">record_generation</p>
<p>Set to whether records should be downloaded off the hardware (recommended),
or generated in software. If set to '<span class="code">hardware</span>', then
<span class="code">weewx</span> tries to download archive records from your
station. However, not all types of stations support this, in which case
<span class="code">weewx</span> falls back to software generation. A setting
of '<span class="code">hardware</span>' will work for most users. A notable
exception is <a href="http://www.wxforum.net/index.php?topic=10315.0">users
who have cobbled together homebrew serial interfaces</a> for the Vantage stations
that do not include memory for a logger. These users should set this option
to '<span class="code">software</span>', forcing software record generation.
Default is <span class="code">hardware</span>.</p>
<p class="config_option">loop_hilo</p>
<p>Set to <span class="code">True</span> to have LOOP data and archive
data to be used for high / low statistics. Set to <span class="code">False</span>
to have only archive data used. If your sensor emits lots of spiky data,
setting to <span class="code">False</span> may help. Default is
<span class="code">True</span>.</p>
<p class="config_option">archive_schema</p>
<p>This is used only when the archive database is first created. Thereafter,
it is downloaded from the database. It should point to a Python list
containing the archive database schema. The default is <span class="code">
user.schemas.defaultArchiveSchema</span>.</p>
<p class="config_option">stats_schema</p>
<p>This is used only when the stats database is first created. Thereafter,
it is downloaded from the database. It should point to a Python list
containing the stats database schema. The default is <span class="code">
user.schemas.defaultStatsSchema</span>.</p>
<h2 class="config_section">[StdTimeSynch]</h2>
<p>This section is for configuring <span class="code">StdTymeSynch</span>, a
service that can synchronize the onboard clock of station with your computer.
Not all weather station hardware supports this.</p>
<p class="config_option">clock_check</p>
<p>How often to check the clock on the weather station in seconds. Default is
14,400 seconds (every 4 hours)</p>
<p class="config_option">max_drift</p>
<p>The maximum amount of clock drift to tolerate, in seconds, before resetting
the clock. Default is 5.</p>
<h2 class="config_section" id="Databases">[Databases]</h2>
<p>This section lists actual database bindings. The name of each database is
given in double brackets below (for example, <span class="code">[[archive_sqlite]]</span>).
The details of the binding follow. You are free to add new bindings.</p>
<p>Note that if you choose the <a href="http://www.mysql.com/">MySQL</a> database
it is assumed that you know how to administer it. In particular, you will have
to set up a user with appropriate privileges to create and update the named
databases.</p>
<h3 class="config_section">[[archive_sqlite]]</h3>
<p>This definition uses the <a href="http://sqlite.org/">sqlite</a> database
engine to store archive data. It is open-source, simple, lightweight, highly
portable, and memory efficient. For most purposes it serves nicely.</p>
<p class="config_option">database</p>
<p>The path to the archive sqlite file. A relative path is relative to
<span class="symcode">$SQLITE_ROOT</span>. Required.</p>
<h3 class="config_section">[[stats_sqlite]]</h3>
<p>This definition uses the <a href="http://sqlite.org/">sqlite</a> database
engine to store the statistical data. It is open-source, simple, lightweight,
highly portable, and memory efficient. For most purposes it serves nicely.</p>
<p class="config_option">database</p>
<p>The path to the stats sqlite file. A relative path is relative to
<span class="symcode">$SQLITE_ROOT</span>. Required.</p>
<h3 class="config_section">[[archive_mysql]]</h3>
<p>This definition uses the MySQL database engine to store archive data.
It is free, highly-scalable, but more complicated to administer. </p>
<p class="config_option">host</p>
<p>The host the archive database is located on. Default is <span class="code">localhost</span>.</p>
<p class="config_option">user</p>
<p>The user name to be used to log into the server. Required.</p>
<p class="config_option">password</p>
<p>The password. Required.</p>
<p class="config_option">database</p>
<p>The name of the archive database inside the server. Required.</p>
<h3 class="config_section">[[stats_mysql]]</h3>
<p>This uses the MySQL database engine to store statistical data.
It is free, highly-scalable, but more complicated to administer. </p>
<p class="config_option">host</p>
<p>The host the stats database is located on. Default is <span class="code">localhost</span>.</p>
<p class="config_option">user</p>
<p>The user name to be used to log into the server. Required.</p>
<p class="config_option">password</p>
<p>The password. Required.</p>
<p class="config_option">database</p>
<p>The name of the statistical database inside the server. Required.</p>
<h2 class="config_section">[Engines]</h2>
<p>This section is used to configure the internal service engine in
<span class="code">weewx</span>. It is for advanced customization. Details on
how to do this can be found in the section <em>
<a href="customizing.htm#service_engine">Customizing the
weewx service engine</a></em> of the <a href="customizing.htm">Customizing Guide</a>. </p>
<h3 class="config_section">[[WxEngine]]</h3>
<p>
This section is for options used by the internal <span
class="code">weewx</span> service engine.
</p>
<p>
Internally, <span class="code">weewx</span> consists of many <em>services</em>,
each responsible for some aspect of the program's functionality.
After an event happens, such as
the arrival of a new LOOP packet, any interested service gets a
chance to do some useful work on the event. For example, a service
might manipulate the packet, print it out, store it in a database,
etc. This section controls which services are loaded and in what
order they get their opportunity to do that work. Before <span
class="code">weewx</span> v2.6, this section held one, looong
option called <span class="code">service_list</span>, which held
the names of all the services that should be run. Since then, this
list has been broken down into five, smaller, lists, given below.
They are run in the order given below.
</p>
<p class="config_option" id="prep_services">prep_services</p>
<p>
These services get called before any others. They are typically
used to prepare the console. For example, the service <span
class="code">weewx.wxengine.StdTimeSynch</span>, which is
responsible for making sure the console's clock is up to date, is
a member of this group.
</p>
<p class="config_option" id="process_services">process_services</p>
<p>Services in this group tend to process any incoming data.
They typically do things like quality control, or unit conversion,
or sensor calibration.</p>
<p class="config_option" id="archive_services">archive_services</p>
<p>Once data have been processed, services in this group archive
them.</p>
<p class="config_option" id="restful_services">restful_services</p>
<p>RESTful services, such as the Weather Underground, or CWOP,
are in this group. They need processed data that have been
archived, hence they are run after the preceeding groups.</p>
<p class="config_option" id="report_services">report_services</p>
<p>The various reporting services run in this group, including
the standard reporting engine.</p>
<p>For reference, here is the standard set of services that are
run with the default distribution.</p>
<pre class="tty">
prep_services = weewx.wxengine.StdTimeSynch
process_services = weewx.wxengine.StdConvert, weewx.wxengine.StdCalibrate, weewx.wxengine.StdQC
archive_services = weewx.wxengine.StdArchive
restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.restx.StdPWSweather, weewx.restx.StdCWOP, weewx.restx.StdWOW
report_services = weewx.wxengine.StdPrint, weewx.wxengine.StdReport
</pre>
<p>If you're the type who cleans out your car's trunk after every use,
you can leave some of these services out if you do not need
them. However, this will only make a slight difference in execution
speed and memory use.</p>
<h1 id="configuring_hardware">Configuring Station Hardware</h1>
<p>This section describes how to configure some of the more popular station hardware, using
configuration utilities supplied with weewx. Directions follow for<p>
<ul>
<li><a href="#wee_config_vantage">Davis Vantage stations</a></li>
<li><a href="#wee_config_fousb">Fine Offset stations</a></li>
<li><a href="#wee_config_ws23xx">La Crosse WS23xx stations</a></li>
<li><a href="#wee_config_ws28xx">La Crosse WS28xx stations</a></li>
</ul>
<h2 id="wee_config_vantage">Davis Vantage</h2>
<p>Weewx comes with a configuration utlity, <span class="code">wee_config_vantage</span>,
that can set many of the on-board EEPROM constants in the Davis Vantage stations,
such as its archive interval, altitude, rain bucket type, <em>etc.</em> </p>
<p>Run it with <span class="code">--help</span> as an option to see its usage: </p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --help </pre>
<p>This will print out something like:</p>
<pre class="tty">Usage: wee_config_vantage: [config_file] [--help] [--info] [--clear]
[--set-interval=SECONDS] [--set-altitude=FEET] [--set-barometer=inHg]
[--set-bucket=CODE] [--set-rain-year-start=MM]
[--set-time] [--set-dst=[AUTO|ON|OFF]]
[--set-tz-code=TZCODE] [--set-tz-offset=HHMM]
[--set-lamp=[ON|OFF]] [--dump] [--logger_summary=FILE] [--start | --stop]
Configures the Davis Vantage weather station.
Options:
-h, --help show this help message and exit
--config=FILE use configuration file FILE
--info To print configuration, reception, and barometer
calibration information about your weather station.
--clear To clear the memory of your weather station.
--set-interval=SECONDS
Sets the archive interval to the specified number of
seconds. Valid values are 60, 300, 600, 900, 1800,
3600, or 7200.
--set-altitude=FEET Sets the altitude of the station to the specified
number of feet.
--set-barometer=inHg Sets the barometer reading of the station to a known
correct value in inches of mercury. Specify 0 (zero)
to have the console pick a sensible value.
--set-bucket=CODE Set the type of rain bucket. Specify '0' for 0.01
inches; '1' for 0.2 MM; '2' for 0.1 MM
--set-rain-year-start=MM
Set the rain year start (1=Jan, 2=Feb, etc.).
--set-time Set the onboard clock to the current time.
--set-dst=AUTO|ON|OFF
Set DST to 'ON', 'OFF', or 'AUTO'
--set-tz-code=TZCODE Set timezone code to TZCODE. See your Vantage manual
for valid codes.
--set-tz-offset=HHMM Set timezone offset to HHMM. E.g. '-0800' for U.S.
Pacific Time.
--set-lamp=ON|OFF Turn the console lamp 'ON' or 'OFF'.
--start Start the logger.
--stop Stop the logger.
--dump Dump all data to the archive. NB: This may result in
many duplicate primary key errors.
--logger-summary=FILE
Save diagnostic summary to FILE (for debugging the
logger).
Mutating actions will request confirmation before proceeding.
</pre>
<p>It is useful to run it with the <span class="code">--info</span> option to
see what the current EEPROM settings are on your station: </p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --info </pre>
<p>This will print out something like: </p>
<pre class="tty">Using configuration file /home/weewx/weewx.conf.
Querying...
Davis Vantage EEPROM settings:
CONSOLE TYPE: VantagePro2
CONSOLE FIRMWARE:
Date: Nov 28 2005
Version: &lt;Unavailable&gt;
CONSOLE SETTINGS:
<span class="highlight"> Archive interval: 300 (seconds)
Altitude: 700 (foot)</span>
Wind cup type: large
<span class="highlight"> Rain bucket type: 0.01 inches
Rain year start: 10
Onboard time: 2013-07-10 10:08:41</span>
CONSOLE DISPLAY UNITS:
Barometer: mbar
Temperature: degree_F
Rain: inch
Wind: knot
CONSOLE STATION INFO:
Latitude (onboard): 45.7
Longitude (onboard): -121.6
<span class="highlight"> Use manual or auto DST? AUTO
DST setting: N/A
Use GMT offset or zone code? ZONE_CODE
Time zone code: 4
GMT offset: N/A</span>
RECEPTION STATS:
Total packets received: 11105
Total packets missed: 3092
Number of resynchronizations: 2
Longest good stretch: 50
Number of CRC errors: 1836
BAROMETER CALIBRATION DATA:
<span class="highlight"> Current barometer reading: 29.932 inHg
Altitude: 700 feet</span>
Dew point: 56 F
Virtual temperature: 73 F
Humidity correction factor: 30
Correction ratio: 1.025
Correction constant: +0.027 inHg
Gain: -1.000
Offset: -1.000</pre>
<p>Note that the console version number is available only on consoles with firmware
dates after about 2006.</p>
<p><span class="highlight">Highlighted</span> values can be changed.</p>
<p>For example, to change the archive interval to 10 minutes (600 seconds):</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --set-interval=600</pre>
<p>To set the time zone code to Central European Time (code 20):</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --set-tz-code=20</pre>
<p class="warning">You can set either the time zone code <em>or</em> the
time zone offset, but not both. </p>
<p>Other parameters can be set in a similar manner.</p>
<h3>Archive Interval</h3>
<p>Valid archive intervals are 60, 300, 600, 900, 1800, 3600, and 7200. However,
if you are ftp&#39;ing lots of files to a server, setting it to 60 seconds may
not give enough time to have them all uploaded before the next archive record
is due. If this is the case, you should pick an archive interval of at least
300 seconds, or trim the number of files you are using. </p>
<p>I have found that a five minute (300 seconds) archive interval works well
for the Vantage stations. Because of the large amount of onboard memory they carry,
going to a larger interval does not have any real advantages. </p>
<p><em>Choose your archiving interval carefully! </em>Once chosen, it cannot
be changed without messing up your statistics (highs and lows will be OK, but
averages and rms wind speed will be wrong). </p>
<h3>Rain bucket type</h3>
<p>Normally, this is set by Davis, but if you have replaced your bucket with
a different kind, you might want to reconfigure. For example, to change to a
0.1MM bucket (bucket code &quot;2&quot;), use the following:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --set-bucket=2</pre>
<h3>Dumping the logger memory</h3>
<p>Generally, <span class="code">weewx</span> downloads only new archive
records from the on-board logger in the Vantage. However, occasionally the
memory in the Vantage will get corrupted, making this impossible. See the
troubleshooting section below <em>"<a href="#html_generated_but_not_updated">Weewx
generates HTML pages, but it does not update them</a></em>". The
fix involves clearing the memory but, unfortunately, this means you may
lose any data which might have accumulated in the logger memory, but not
yet downloaded. By using the <span class="code">--dump</span> command
before clearing the memory, you might be able to save these data. </p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --dump</pre>
<p>This will dump all data archived in the Vantage memory directly to the
database, without regard to whether or not they have been seen before.
Because the command dumps <em>all</em> data, it may result in many
duplicate primary key errors. These can be ignored.</p>
<h2 id="wee_config_fousb">Fine Offset</h2>
<p>The configuration utility <span class='code'>wee_config_fousb</span> is
designed to diagnose and configure Fine Offset stations.</p>
<p>Run it with <span class='code'>--help</span> as an option to see its usage:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --help </pre>
<p>This will print out something like:</p>
<p class='tty'>Usage: wee_config_fousb [config_file] [options] [--help]
Configuration utility for Fine Offset weather stations.
Options:
-h, --help show this help message and exit
--config=FILE use configuration file FILE
--info display weather station configuration
--check-pressures query station for pressure sensor data
--check-units compare raw and converted LOOP packets
--check-usb test the quality of the USB connection
--check-fixed-block monitor the contents of the fixed block
--fixed-block display the contents of the fixed block
--live display live readings from the station
--logged display logged readings from the station
--history-since=N display records since N minutes ago
--history=N display N records
--format=FORMAT format for output, one of raw, table, or dict
--set-clock set station clock to computer time
--set-pressure=P set relative pressure to P hPa (mbar)
--set-interval=N set logging interval to N minutes
--clear-memory clear station memory
--slp=SLP calculate pressure offset from sea level pressure SLP
-y answer yes to every prompt
--debug display diagnostic information while running
Mutating actions will request confirmation before proceeding.</p>
<p>Display the station settings with the <span class='code'>--info</span>
option.</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --info </pre>
<p>This will result in something like this:</p>
<pre class='tty'>Fine Offset station settings:
local time: 2013.02.11 18:34:28 CET
polling_mode: ADAPTIVE
abs_pressure: 933.3
current_pos: 592
data_changed: 0
<span class="highlight"> data_count: 22</span>
date_time: 2007-01-01 22:49
hum_in_offset: 18722
hum_out_offset: 257
id: None
lux_wm2_coeff: 0
magic_1: 0x55
magic_2: 0xaa
model: None
rain_coef: None
<span class="highlight"> read_period: 30</span>
<span class="highlight"> rel_pressure: 1014.8</span>
temp_in_offset: 1792
temp_out_offset: 0
timezone: 0
unknown_01: 0
unknown_18: 0
version: 255
wind_coef: None
wind_mult: 0</pre>
<p><span class="highlight">Highlighted&nbsp;</span> values can be modified with the <span class='code'>wee_config_fousb</span> utility.</p>
<h3>Changing the archive interval</h3>
<p>Fine Offset stations ship from the factory with an archive interval
(read_period) of 30 minutes (1800 seconds). To change the station's
interval to 5 minutes, do the following:</p>
<p class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --set-interval=5</p>
<p><em>Choose your archiving interval carefully! </em>Once chosen, it
cannot be changed without messing up your statistics (highs and lows
will be OK, but averages and rms wind speed will be wrong). </p>
<h3>Calibrating the pressure sensor</h3>
<p>The pressure sensor in the Fine Offset stations measures absolute, or gauge pressure.
The absolute pressure may be off a bit when the station is at sea level (1 to 10 millibars),
but it will definitely be way off when the station is above sea level (as much as hundreds of millibars).
<span class='code'>Weewx</span> will compensate for the effects of altitude, but to do so,
it needs not only the altitude, but a calibrated station pressure.</p>
<p>To calibrate the pressure sensor, specify a <span class='code'>pressure_offset</span>, in millibars, in <span class='code'>weewx.conf</span>. If you do not know what the offset should be, use the <span class='code'>wee_config_fousb</span>
utility to calculate this offset given the station altitude and a valid
sea-level pressure from a nearby known-correct station.</p>
<p>For example, if the sea level pressure from a verified source is 1003.048 hPa, the following example will calculate the offset then ask whether to insert it into <span class='code'>weewx.conf</span>. It uses the altitude specified in <span class='code'>weewx.conf</span> and the station pressure and temperature.</p>
<p class='tty'><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --slp=1003.048</p>
<p>The output will look something like this:</p>
<p class='tty'>Querying the station...
Pressure offset is None
Set pressure offset to 1.247000 hPa (y/n)? y
Pressure offset is now 1.247000</p>
<p>To convert inHg to hPa (mbar), multiply by 33.86389</p>
<p>To display sensor, relative, and calculated pressures:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --check-pressures</pre>
<p>Note that <span class='code'>weewx</span> does not use the <i>relative pressure</i> displayed on the Fine Offset console.</p>
<h3>Dumping the console memory</h3>
<p>Fine Offset stations store records in a circular buffer &mdash; once the buffer fills, the oldest records are replaced by newer records. The 1080 and 2080 consoles store up to 4080 records. The 3080 consoles store up to 3264 records. The <span class='code'>data_count</span> indicates how many records are in memory. The <span class='code'>read_period</span> indicates the number of minutes between records. <span class='code'>wee_config_fousb</span> can display these records in space-delimited, raw bytes, or dictionary format.</p>
<p>For example, to display the most recent 30 records from the console memory:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --history=30</pre>
<p>To clear the console memory:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --clear-memory</pre>
<h3>Checking the USB quality</h3>
<p>Use the <span class='code'>wee_config_fousb</span> utility to test the quality of the USB connection between computer and console. Poor quality USB cables, under-powered USB hubs, and other devices on the bus can interfere with communication.</p>
<p>To test the quality of the USB connection to the console:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_fousb --check-usb</pre>
<p>Let the utility run for at least a few minutes, or possibly an hour or two. It is not unusual to see a few bad reads in an hour, but if you see many bad reads within a few minutes, consider replacing the USB cable, USB hub, or removing other devices from the bus.</p>
<h3>Polling interval</h3>
<p>When reading 'live' data, <span class='code'>weewx</span> can read as fast as possible, or at a user-defined period. This is controlled by the <span class='code'>polling_mode</span> parameter.
</p>
<table class='indent'>
<tr>
<td width='15%'>Mode</td>
<td width='30%'><span class='code'>weewx.conf</span></td>
<td>Notes</td>
</tr>
<tr>
<td>ADAPTIVE</td>
<td>
<p class='tty' style='margin:0'>[FineOffsetUSB]
polling_mode = ADAPTIVE</p>
</td>
<td>
<p>In this mode, <span class='code'>weewx</span> reads data from the station as often as possible, but at intervals that avoid communication between the console and the sensors. Nominally this results in reading data every 48 seconds.</p>
</td>
</tr>
<tr>
<td>PERIODIC</td>
<td>
<p class='tty' style='margin:0'>[FineOffsetUSB]
polling_mode = PERIODIC
polling_interval = 60</p>
</td>
<td>
<p>In this mode, <span class='code'>weewx</span> reads data from the station every <span class='code'>polling_interval</span> seconds.</p>
<p>The console reads the sensors every 48 seconds (60 seconds for UV), so setting the <span class='code'>polling_interval</span> to a value less than 48 will result in duplicate readings.</p>
</td>
</tr>
</table>
<h3>Catchup</h3>
<p>When <span class='code'>weewx</span> starts up it will attempt to download all records from the console since the last record in the archive database.
</p>
<h3>Station characteristics</h3>
<ul>
<li>The 10xx and 20xx stations can save up to 4080 historical readings.
That is about 85 days of data with the default recording interval of
30 minutes, or about 14 days with a recording interval of 5 minutes.
</li>
<li>The 30xx stations can save up to 3264 historical readings.</li>
<li>The station reads data from the sensors every 48 seconds.</li>
<li>The 30xx stations read UV data every 60 seconds.</li>
</ul>
<h2 id="wee_config_ws23xx">La Crosse WS23xx</h2>
<p>The configuration utility <span class='code'>wee_config_ws23xx</span> is
designed to diagnose and configure WS23xx stations.</p>
<p>Run it with <span class='code'>--help</span> as an option to see its usage:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_ws23xx --help </pre>
<p>This will print out something like:</p>
<pre class='tty'>Usage: wee_config_ws23xx [config_file] [options] [--debug]
Configuration utility for WS-23xx weather stations.
Options:
-h, --help show this help message and exit
--config=FILE configuration file
--info display weather station configuration
--current get the current weather conditions
--history-since=N display history records since N minutes ago
--history=N display N history records
--set-time set the station clock to the current time
--set-interval=N set the station archive interval to N minutes
--clear-memory clear station memory
-y answer yes to every prompt
--debug display diagnostic information while running
Mutating actions will request confirmation before proceeding.</pre>
<p>Display the station settings with the <span class='code'>--info</span>
option.</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_ws23xx --info </pre>
<p>This will result in something like this:</p>
<pre class='tty'>Driver version 0.6
Querying the station for the configuration...
buzzer: 0
connection time till connect: 1.5
connection type: 15
dew point: 8.88
dew point max: 18.26
dew point max alarm: 20.0
dew point max alarm active: 0
dew point max alarm set: 0
dew point max when: 978565200.0
dew point min: -2.88
dew point min alarm: 0.0
dew point min alarm active: 0
dew point min alarm set: 0
dew point min when: 978757260.0
forecast: 0
history interval: 5.0
history last record pointer: 8.0
history last sample when: 1385564760.0
history number of records: 175.0
history time till sample: 5.0
icon alarm active: 0
in humidity: 48.0
...</pre>
<h3>Changing the archive interval</h3>
<p>WS23xx stations ship from the factory with an archive interval of 60
minutes (3600 seconds). To change the station's interval to 5 minutes,
do the following:</p>
<p class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_ws23xx --set-interval=5</p>
<p><em>Choose your archiving interval carefully! </em>Once chosen, it
cannot be changed without messing up your statistics (highs and lows
will be OK, but averages and rms wind speed will be wrong). </p>
<h3>Dumping the console memory</h3>
<p>WS23xx stations store records in a circular buffer - once the
buffer fills, the oldest records are replaced by newer records. The
console stores up to 175 records.
The <span class='code'>history number of records</span> indicates how
many records are in memory. The
<span class='code'>history interval</span> indicates the number of
minutes between records.</p>
<p>For example, to display the latest 30 records from the console memory:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_ws23xx --history=30</pre>
<p>To clear the console memory:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_ws23xx --clear-memory</pre>
<h3>Catchup</h3>
<p>When <span class='code'>weewx</span> starts up it will attempt to
download all records from the console since the last record in the
archive database.
</p>
<h3>Station characteristics</h3>
<ul>
<li>The station does not record wind gust or wind gust direction.</li>
<li>The station has 175 history records. That is just over 7 days
of data with the default history recording interval of 60 minutes,
or about 14 hours with a recording interval of 5 minutes.</li>
<li>Changing the recording interval will clear the station memory.</li>
<li>The station calculates windchill and dewpoint. The WS23xx driver
includes options to calculate windchill and dewpoint in <span class="code">weewx</span>, since
the hardware algorithms may be antiquated.</li>
<li>The hardware interface is a serial port, but USB-serial converters
can be used with computers that have no serial port. Beware that
not every type of USB-serial converter will work. Converters based
on ATEN UC-232A chipset are known to work.</li>
</ul>
<h2 id="wee_config_ws28xx">La Crosse WS28xx</h2>
<p>The configuration utility <span class='code'>wee_config_ws28xx</span> is
designed to diagnose and configure WS28xx stations.</p>
<p>Run it with <span class='code'>--help</span> as an option to see its usage:</p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_ws28xx --help </pre>
<p>This will print out something like:</p>
<pre class='tty'>Usage: wee_config_ws28xx [config_file] [options] [--debug]
Configuration utility for WS-28xx weather stations.
Options:
-h, --help show this help message and exit
--config=FILE configuration file
<span class='highlight'> --check-transceiver</span> check USB transceiver
--pair pair the USB transceiver with a station console
<span class='highlight'> --info</span> display weather station configuration
<span class='highlight'> --current</span> get the current weather conditions
--history-since=N display history records since N minutes ago
--history=N display N history records
--format=FORMAT format for history, one of raw, table, or dict
--maxtries=MAXTRIES maximum number of retries, 0 indicates no max
--debug display diagnostic information while running
Mutating actions will request confirmation before proceeding.</pre>
<p>The WS28xx driver is still in active development; only the
<span class='highlight'>&nbsp;highlighted&nbsp;</span> options
are working.</p>
<h3>Pairing</h3>
<p>The console and transceiver must be paired. Pairing ensures that your
transceiver is talking to your console, not your neighbor's console.
Pairing should only have to be done once. You might have to pair again
after power cycling the console, for example when you replace the
batteries.</p>
<p>There are two ways to pair the console and the transceiver:</p>
<ol>
<li><strong>The Weewx way.</strong> With <span class="code">weewx</span> running, press and hold
the [v] button on the console until you see 'PC' in the display. If
the console pairs with the transceiver, 'PC' will go away within a
second or two.</li>
<li><strong>The HeavyWeather way.</strong> Follow the pairing
instructions that came with the station. You will have to run
HeavyWeather on a windows computer with the USB transceiver. After
HeavyWeather indicates the devices are paired, put the USB transceiver
in your <span class="code">weewx</span> computer and start weewx. Do not power cycle the
station console or you will have to start over.</li>
</ol>
<p>If the console does not pair, you will see messages in the log such as
this:</p>
<pre class='tty'>ws28xx: RFComm: message from console contains unknown device ID (id=165a resp=80 req=6)</pre>
<p>Either approach to pairing may require multiple attempts.</p>
<h3>Synchronizing</h3>
<p>The transceiver and console must be synchronized in order to
communicate. Synchronization will happen automatically at the top of
each hour, or you can force synchronization by pressing the [SET] button
momentarily. Do not press and hold the [SET] button - that
modifies the console alarms.</p>
<p>When the transceiver and console are synchronized, you will see lots of
'<span class="code">ws28xx: RFComm</span>' messages in the log when <span class="code">debug=1</span>. When the devices are
not synchronized, you will see messages like this about every 10
minutes:</p>
<pre class='tty'>Nov 7 19:12:17 raspi weewx[2335]: ws28xx: MainThread: no contact with console</pre>
<p>If you see this, or if you see an extended gap in the weather data
in the <span class="code">weewx</span> plots, press momentarily the [SET] button, or wait until
the top of the hour.</p>
<p>When the transceiver has not received new data for awhile, you will see
messages like this in the log:</p>
<pre class='tty'>Nov 7 19:12:17 raspi weewx[2335]: ws28xx: MainThread: no new weather data</pre>
<p>If you see 'no new weather data' messages with the
'no contact with console' messages,
it simply means that the transceiver has not been able to synchronize
with the console. If you see only the 'no new weather data' messages,
then the sensors are not communicating with the console, or the console
may be defective.</p>
<h3>Alarms</h3>
<p>Be sure to turn off all alarms in the console. When an alarm goes off,
communication with the transceiver stops. It is better to create alarms
in weewx, and the <span class="code">weewx</span> alarms can do much more than the console alarms
anyway.</p>
<h1 id="configuring_mysql">Configuring MySQL</h1>
<p>This section applies only for those using MySQL.</p>
<p>Assuming that you want to use the default database configuration, your
<span class="code"><a href="#Databases">[Databases]</a></span> section
should
look something like this:</p>
<pre class="tty">[Databases]
[[archive_mysql]]
host = localhost
user = weewx
password = weewx
database = weewx
driver = weedb.mysql
[[stats_mysql]]
host = localhost
user = weewx
password = weewx
database = stats
driver = weedb.mysql</pre>
<p>This assumes user '<span class="code">weewx</span>' would have password '<span class="code">weewx</span>'.
Adjust as necessary.</p>
<p>If you wish, databases '<span class="code">weewx</span>' and '<span class="code">stats</span>'
can be combined into one database, although this will make it harder to drop
the latter should you need to rebuild the stats database at a later time.</p>
<p>You will need to give the necessary permissions for databases '<span class="code">weewx</span>'
and '<span class="code">stats</span>' to whatever MySQL user you choose, by
default, user '<span class="code">weewx</span>'. Here are the necessary minimum
permissions:</p>
<pre class="tty">mysql&gt; CREATE USER 'weewx'@'localhost' IDENTIFIED BY 'weewx';
mysql&gt; GRANT select, update, create, delete, insert ON weewx.* TO weewx@localhost;
mysql&gt; GRANT select, update, create, delete, insert ON stats.* TO weewx@localhost;</pre>
<p>In addition to configuring MySQL, you will also need to indicate to
<span class="code">weewx</span> that you intend to use the configured
database. See section <span class="code"><a href="#StdArchive">
[StdArchive]</a></span> for details.</p>
<h1 id="running">Running <span class="code">weewx</span></h1>
<p><span class="code">Weewx</span> can be run either from the command line (useful
for diagnostic purposes because it will print out a summary of every LOOP data),
or as a daemon. When first trying <span class="code">weewx</span>, it is
probably best to run it from the command line because you will be able to see
command line diagnostics, as well as log messages. </p>
<h2>Running from the command line</h2>
<p><span class="code">Weewx</span> can easily be run from the command line.
Start by making sure you have appropriate permissions to the serial port your
weather station uses. For example, if you are using a plain old serial port:
</p>
<pre class="tty">sudo chmod 666 /dev/ttyS0 </pre>
<p>Then run the main program, <span class="code">weewxd</span>, giving
the configuration file as its only parameter: </p>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/weewxd <span class="symcode">$CONFIG_ROOT</span>/weewx.conf</pre>
<p>It should start by downloading any data stored in your weather station into
the archive database. As the Davis VantagePro can store a couple thousand archive
records internally, this could take a minute or two. I have found this process
particularly slow on SuSE for some reason. </p>
<p><span class="code">Weewx</span> will then start monitoring LOOP data, printing
a short version of the received data on standard output, about once every two
seconds. </p>
<p>You can tell a running instance of <span class="code">weewx</span> to reread
its configuration file by sending it the <span class="code">HUP</span> signal.
First run <span class="code">ps</span> to find out the Process ID (PID) number
of the instance, then send it the <span class="code">HUP</span> signal: </p>
<pre class="tty">ps -a # Note the PID of the weewxd process
kill -HUP <em>pid</em> # Send it a HUP signal</pre>
<p>Note that this <em>only</em> rereads the configuration file. It will not
reload any code.</p>
<h2>Running as a daemon</h2>
<p>For unattended operations it is best to have <span class="code">weewx</span>
run as a daemon, started automatically when the server is rebooted. </p>
<p>If you use a packaged install from a DEB or RPM distribution, this is
done automatically. You can ignore this section.</p>
<p>Start by selecting the appropriate run script. They can be found under
<span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/</span>. </p>
<table class="locations center" style="width: 90%">
<tr>
<td >Debian/Ubuntu/Mint:</td>
<td class='tty'><span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/weewx.debian</span></td>
</tr>
<tr>
<td >Redhat/CentOS/Mint:</td>
<td class='tty'><span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/weewx.redhat</span></td>
</tr>
<tr>
<td style="width: 25%">SuSE:</td>
<td class='tty'><span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/weewx.suse</span></td>
</tr>
</table>
<p>Check the chosen script to make sure the variable <span class="code">WEEWX_ROOT</span>
has been set to the proper root directory for your
<span class="code">weewx</span> installation (it should have been set to the correct value automatically
by the install process, but it is worth checking). </p>
<p>Copy it to the proper location for your system: </p>
<table class="locations center" style="width: 90%">
<tr>
<td>Debian/Ubuntu/Mint:</td>
<td class='tty'>cp <span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/weewx.debian /etc/init.d/weewx</span></td>
</tr>
<tr>
<td>Redhat/CentOS/Fedora:</td>
<td class='tty'>cp <span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/weewx.redhat /etc/rc.d/init.d/weewx</span></td>
</tr>
<tr>
<td style="width: 25%">SuSE:</td>
<td class='tty'>cp <span class="symcode">$WEEWX_ROOT</span><span class="code">/util/init.d/weewx.suse /etc/init.d/weewx</span></td>
</tr>
</table>
<p>Make sure the script is executable: </p>
<table class="locations center" style="width: 90%">
<tr>
<td >Debian/Ubuntu/Mint:</td>
<td class='tty'>chmod +x /etc/init.d/weewx</td>
</tr>
<tr>
<td >Redhat/CentOS/Fedora:</td>
<td class='tty'>chmod +x /etc/init.d/rc.d/weewx</td>
</tr>
<tr>
<td style="width: 25%">SuSE:</td>
<td class='tty'>chmod +x /etc/init.d/weewx</td>
</tr>
</table>
<p>Create symbolic links in the run level directories: </p>
<table class="locations center" style="width: 90%">
<tr>
<td >Debian/Ubuntu/Mint:</td>
<td class='tty'>update-rc.d weewx defaults 98</td>
</tr>
<tr>
<td >Redhat/CentOS/Fedora:</td>
<td class='tty'>chkconfig weewx on</td>
</tr>
<tr>
<td style="width: 25%">SuSE:</td>
<td class='tty'>/usr/lib/lsb/install_initd /etc/init.d/weewx</td>
</tr>
</table>
<p><span class="code">Weewx</span> will now start automatically whenever your
system is booted. You can also manually start, stop, and restart the
<span class="code">weewx</span> daemon: </p>
<pre class="tty">sudo /etc/init.d/weewx start
sudo /etc/init.d/weewx stop
sudo /etc/init.d/weewx restart</pre>
<p>By default, the scripts are designed to have <span class="code">weewx</span>
run at run levels 2, 3, 4 and 5. Incidentally, a nice tool for setting run levels
with Debian (Ubuntu, Mint) systems is
<a href="http://sysv-rc-conf.sourceforge.net/">sysv-rc-conf</a>. It uses a curses
interface to allow you to change easily which run level any of your daemons
runs at. There is a similar tool on SuSE. From the start menu run the YAST Control
Center, then look for Systems Services (Runlevel). Pick &quot;Expert&quot; mode
to see the run levels. </p>
<p>You can also tell <span class="code">weewx</span> to reread its configuration
file without stopping by using the &#39;reload&#39; option: </p>
<pre class="tty">sudo /etc/init.d/weewx reload </pre>
<h1 id="monitoring">Monitoring <span class="code">weewx</span></h1>
<p><span class="code">Weewx</span> logs many events to the system log.
On Debian systems, this is <span class="code">/var/log/syslog</span>,
on SuSE, <span class="code">/var/log/messages</span>. Your system may
use yet another place. When troubleshooting the system, be sure to check
it! </p>
<p class='tty'>tail -f /var/log/syslog</p>
<p>Set the debug option in <span class='code'>weewx.conf</span> to
generate many more checks and output more information. This can be
useful for diagnosing problems and debugging.</p>
<p class='tty'>debug = 1</p>
<h1 id="wview_compatibility">Compatibility with <span class="code">wview</span></h1>
<h2>sqlite3</h2>
<p>The sqlite3 archive database used by <span class="code">weewx</span>
(nominally, <span class="code">weewx.sdb</span>) is completely
compatible with the database used by
<a href="http://www.wviewweather.com">wview</a> (usually called
<span class="code">wview-archive.sdb</span>), at least as of wview
Version 5.2.X. The schema and its semantics is identical. However, the
statistical file <span class="code">stats.sdb</span> is different, and
must be rebuilt. This will be done automatically on startup by
<span class="code">weewx</span>.
</p>
<p>If you have data from <span class='code'>wview</span>, you can
'import' them into <span class='code'>weewx</span> by simply copying the
sqlite database
file. Assuming that the <span class='code'>wview</span> data are in file <span class='code'>/var/wview/archive/wview-archive.sdb</span>,</p>
<p class='tty'>sudo /etc/init.d/weewx stop
cd <span class="symcode">$SQLITE_ROOT</span>
rm stats.sdb
mv weewx.sdb weewx.sdb.bak
cp /var/wview/archive/wview-archive.sdb weewx.sdb
sudo /etc/init.d/weewx start</p>
<p>When <span class='code'>weewx</span> starts it will generate a new
<span class='code'>stats.sdb</span> file. This could take awhile if the
<span class='code'>wview</span> archive contains more than a month or
two of data.</p>
<p>On my modest 500 MHz <a href="http://www.fit-pc.com/">fit-PC Slim</a>
with 512 MB of memory it took a little over 4 minutes for a year and a
half (25 MB) of data.</p>
<h2>MySQL</h2>
<p>The MySQL archive database used by wview is "almost" compatible with
<span class="code">weewx</span>. The one difference is that in wview, the column '<span class="code">interval</span>'
is named '<span class="code">arcInt</span>' (presumably because
<span class="code">interval</span> is a keyword in MySQL, although it can
still be used by surrounding the word with backquotes). </p>
<p>To change the column name to what <span class="code">weewx</span> uses, namely <span class="code">interval</span>,
use the utility <span class="code">mysql</span> and issue the command:</p>
<pre class="tty">ALTER TABLE <em>your-wview-archive-name</em> CHANGE arcInt `interval` INTEGER NOT NULL; </pre>
<p>where <span class="code"><em>your-wview-archive-name</em></span> is the
name of your wview archive database. Note that the word <span class="code">
interval</span> is surrounded by backquotes.</p>
<p>Then in the <span class="code">[Databases]</span> section of
<span class="code">weewx.conf</span>, replace the name of the database
with whatever your installation of wview used <span class="code"><em>your-wview-archive-name</em></span>:</p>
<pre class="tty">[[archive_mysql]]
&nbsp; host = ...
&nbsp; user = ...
&nbsp; database = <em>your-wview-archive-name</em>
...</pre>
<h1 id="integrating_with_webserver">Integrating <span class='code'>weewx</span> with a web server</h1>
<h2>If the server is on the same machine</h2>
<p>The reports generated by <span class='code'>weewx</span> can be
served by a web server running on the same computer as
<span class='code'>weewx</span>. Here's how.</p>
<p>First, install a web server on the computer on which
<span class='code'>weewx</span> is running. For example, on Debian
systems:</p>
<p class='tty'>sudo apt-get install apache2</p>
<p>Then, if <span class='code'>weewx</span> was installed from DEB or RPM
package, simply enter the <span class='code'>weewx</span> URL in a web
browser in order to see your webpages.</p>
<p class='tty'>http://localhost/weewx</p>
<p>Alternatively, if <span class='code'>weewx</span> was installed using
<span class='code'>setup.py</span>, copy the Apache configuration
snippet that comes with <span class="code">weewx</span> to the apache configuration directory, then restart
Apache:</p>
<p class='tty'>sudo cp util/apache/conf.d/weewx.conf /etc/apache2/conf.d
sudo /etc/init.d/apache2 restart</p>
<p>Be sure that the path in the Apache configuration snippet matches the <span class='code'>HTML_ROOT</span> defined in the
<span class='code'>weewx</span> configuration file.</p>
<p class='tty'>Alias /weewx <strong>/home/weewx/public_html</strong>
&lt;Directory <strong>/home/weewx/public_html</strong>&gt;
Options FollowSymlinks
AllowOverride None
Order allow,deny
Allow from all
&lt;/Directory&gt;</p>
<p>Then open the <span class='code'>weewx</span> URL in a web browser:</p>
<p class='tty'>http://localhost/weewx</p>
<h2>If the server is on a different machine</h2>
<p>Use the FTP or RSYNC 'reports' to upload to a web server. Either of
these will copy everything from the <span class='code'>HTML_ROOT</span>
directory to a location on the remote server on which the web server
is running.</p>
<h1 id="troubleshooting">Troubleshooting</h1>
<p>This section lists some common problems installing and running
<span class="code">weewx</span>. If you are still stuck, be sure to: </p>
<ul>
<li style="margin-bottom:1em">Set the option <span class="code">debug</span> to
<span class="code">1</span> in <span class='code'>weewx.conf</span>.
This will put much more information in the log file, which can
be very useful for troubleshooting and debugging!
<p class='tty' style="margin-top:1em">debug = 1</p>
</li>
<li style="margin-bottom:1em"><a href="#monitoring">Look at the log file</a>. I am always
happy to take questions, but the first thing I will ask you is,
&quot;Did you look at the log file?&quot;
<p class='tty' style="margin-top:1em">tail -f /var/log/messages</p>
</li>
<li style="margin-bottom:1em">Run from the command line. Generally, <span class="code">weewx</span>
will catch and log any unrecoverable exceptions. But if you are getting
strange results, it is worth running from the command line and looking
for any clues.
<p class='tty' style="margin-top:1em"><span class="symcode">$BIN_ROOT</span>/weewxd <span class="symcode">$CONFIG_ROOT</span>/weewx.conf</p>
</li>
</ul>
<h2>Hardware problems</h2>
<h3>Establishing connectivity</h3>
<p>If you are unable to get anything out of <span class="code">weewx</span>, first
check that you have connectivity to your weather station. For the Davis stations,
you can use a terminal emulator (I like <span class="code">minicom</span> because
it can be run from through a simple TTY connection) to run a simple test. Set
it up to communicate using the appropriate port and baudrate. For example</p>
<pre class="tty">minicom -b 19200 -D /dev/ttyUSB0</pre>
<p>Then type in <span class="code">TEST</span>, all in capital letters. It will
not echo the characters. Then hit the <span class="code">&lt;enter&gt;</span>
key. It should echo back <span class="code">TEST</span>.</p>
<p>If this works, then you have established connectivity with the Davis and
the problem must lie elsewhere.</p>
<h3>Tips on making a system reliable</h3>
<p>If you are having problems keeping your weather station up for long
periods of time, here are some tips, in decreasing order of importance:
</p>
<p class='image-right' style='width:205px'>
<a href="ferrites.jpg"><img src="ferrites.jpg" width='200' border='1' alt="Ferrite coils" longdesc="Cable connection looped through a ferrite coil" /></a>
<br/>
<span class='caption'>Ferrite coils on a Davis Envoy. There are two
coils, one on the USB connection (top wire) and one on the power
supply. Both have loops.</span>
</p>
<ul>
<li>Run on dedicated hardware. If you are using the server for other
tasks, particularly as your desktop machine, you will have reliability
problems. If you are using it as a print or network server, you will
probably be OK.
</li>
<li>Run headless. Modern graphical systems are extremely complex. As new
features are added, test suites do not always catch up. Your system
will be much more reliable if you run it without a windowing system (X
Windows, in the case of Linux). </li>
<li>Use an Uninterruptible Power Supply (UPS). The vast majority of power
glitches are very short lived &mdash; just a second or two &mdash; so
you do not need a big one. The 425VA unit I use to protect my fit-PC
cost $55 at Best Buy.</li>
<li>Use a VantagePro console with a serial connection, not a USB
connection. See the next section for details. </li>
<li>If you do use a USB connection, put a ferrite coil on each end of
the cable to your console. If you have enough length and the ferrite
coil is big enough, make a loop so it goes through the coil twice.
</li>
</ul>
<h3>cp2101 converter problems</h3>
<p>The USB converter used in the Davis VantagePro is known to have some &quot;noise&quot;
problems. The symptom is that the Linux kernel will disconnect from your old
USB port claiming &quot;EMI noise&quot;, and reconnect to a new and different
port, where <span class="code">weewx</span> cannot find it. Here is a
typical log output: </p>
<p class='tty'>Nov 29 10:40:21 hummingbird kernel: [6661624.786792] hub 2-0:1.0: port 3 disabled by hub (EMI?), re-enabling...
Nov 29 10:40:21 hummingbird kernel: [6661624.786871] usb 2-3: USB disconnect, address 2
Nov 29 10:40:21 hummingbird kernel: [6661624.795778] cp2101 2-3:1.0: device disconnected
Nov 29 10:40:21 hummingbird weewx[25808]: VantagePro: Max retries exceeded while getting LOOP packets
... (messages elided)
Nov 29 10:40:22 hummingbird kernel: [6661625.352340] cp2101 2-3:1.0: cp2101 converter detected
Nov 29 10:40:22 hummingbird kernel: [6661625.528107] usb 2-3: reset full speed USB device using ohci_hcd and address 3
Nov 29 10:40:22 hummingbird kernel: [6661625.735497] usb 2-3: cp2101 converter now attached to ttyUSB1</p>
<p>In this example, the VantagePro was connected to <span class="code">/dev/ttyUSB0</span>,
but then reconnected to <span class="code">/dev/ttyUSB1</span>. </p>
<p>If you put ferrite coils on the USB connection, you will eliminate 90% of
this problem. I did this about 3 years ago, and have not had a problem since.
</p>
<p>However, there is one final step that you can take to really harden up
your system: install a <span class="code">udev</span> script that will create
a symbolic link to the VantagePro USB port, whatever it might be. With this
approach, if the port jumps from <span class="code">ttyUSB0</span> to
<span class="code">ttyUSB1</span>, the symbolic link will follow it. You just
specify port <span class="code">/dev/vpro</span> in the configuration file
<span class="code">weewx.conf</span> and be done with it. </p>
<h3 id='udev_script'>Installing a udev script</h3>
<p>Use a udev rule to ensure that a USB device always appears at the same
location such as <span class='code'>/dev/vpro</span> instead of
<span class='code'>/dev/ttyUSB2</span></p>
<p>For example, for my VantagePro2 weather station, I have installed a file
<span class="code">/etc/udev/rules.d/vpro.rules</span>
on my fit-PC that looks like this: </p>
<p class='tty'># Automount the VantagePro2 to port /dev/vpro.
# Install in /etc/udev/rules.d/vpro.rules
#
ACTION==&quot;add&quot;, ATTRS{interface}==&quot;CP2102 USB to UART Bridge Controller&quot;, SYMLINK+=&quot;vpro&quot;</p>
<p>This rule says that when the USB port is plugged in (action
<span class="code">add</span>), and it has an attribute with name
<span class="code">interface</span> that is equal to
&quot;<span class="code">CP2102 to UART Bridge Controller</span>&quot;,
then add a symbolic link for its physical port to
<span class="code">/dev/vpro</span>. </p>
<p>Here is a rule that works for my Serial-to-USB cable, made by Prolific
Technology, Inc.:</p>
<p class='tty'># Automount Serial-to-USB cable to port /dev/vpro
# Install in /etc/udev/rules.d/cable.rules
#
ACTION==&quot;add&quot;, ATTRS{product}==&quot;USB-Serial Controller&quot;, SYMLINK+=&quot;vpro&quot;</p>
<p>Your devices may, and probably will, have different identifiers!! I can recommend
this article, &quot;<a href="http://www.reactivated.net/writing_udev_rules.html"><em>Writing
udev rules</em></a>,&quot; for how to find and write an appropriate
<span class="code">udev</span> rule for your controller. (Note, however, that
this article uses the old <span class="code">udevinfo</span> command, rather
than the newer <span class="code">udevadm</span> command.) In particular, run
the command </p>
<p class='tty'># udevadm info --attribute-walk --path $(udevadm info --query=path --name=/dev/ttyUSB0) </p>
<p>where<span class="code"> /dev/ttyUSB0</span> is the port (substitute
your real USB port) the weather station is attached to. It will print
out various identifiers that can be useful in identifying your weather
station to <span class="code">udev</span>.
While the first example script above used a rule that matched attribute
<span class="code">interface</span>, others are possible. For example,
the second example, for the serial-to-USB cable, chose to match the
attribute <span class="code">product</span>. </p>
<p>Once you have installed your <span class="code">udev</span> rule, you
can then set <span class="code">port=/dev/vpro</span> in
<span class="code">weewx.conf</span>, confident that it will always point
to your weather station, no matter which USB port it is actually
attached to! </p>
<p>I have tested this system many times. You can yank the USB port out of the
machine and then plug it back in while also pulling out the network connection
in the middle of an FTP upload: <span class="code">weewx</span> will recover.
</p>
<p>Or, at least, it should! </p>
<h3 id="html_generated_but_not_updated">Weewx generates HTML pages, but it does not update them</h3>
<p>If you are getting a symptom that everything appears normal, that is HTML
is getting generated and getting FTP&#39;d to your webserver <em>(look in the
log to be sure</em>!), but your web pages are not being updated, it could be
because the data on board your console has gotten garbled. The way the Davis
Vantage series works is that the software (<span class="code">weewx</span> in
this case) asks the console for all archive data &quot;since&quot; some time.
The console then downloads the records one at a time. After it gets to the very
last one, the memory wraps around, and the timestamp will suddenly jump backwards
in time a couple weeks &mdash; this how the software knows it has downloaded the last
record and so it stops.</p>
<p>However, if the internal memory gets garbled, the console will immediately
return archives in the past, and so it looks like the timestamps have decreased
in value and so <span class="code">weewx</span> figures that is it: there is
no more data.</p>
<p>I have received reports from a couple of users who have had this problem.
There seems to be two fixes:</p>
<ol>
<li>Unplug the console, take out the batteries, and wait a minute or two.
This will cause the console software to internally reboot. In one case this
has fixed the problem without data loss.</li>
<li>If all else fails, clear the memory of the console using the utility
<span class="code">wee_config_vantage</span>. This may cause loss of data, but
usually works. Adjust paths as necessary:</li>
</ol>
<pre class="tty"><span class="symcode">$BIN_ROOT</span>/wee_config_vantage --clear </pre>
<p>See also the section <em><a href="#Dumping_the_logger_memory">Dumping
the logger memory</a></em>, which may help you avoid data loss.</p>
<h3>3rd party Vantage connectors</h3>
<p>This section is for those who are using a homebrew or 3rd party connector
to a Davis Vantage console that does not contain a logger, such as the
<a href="http://www.wxforum.net/index.php?topic=14063.0">DSI-01 serial interface</a>.
That is, it is a pure serial connection to the console, with no onboard memory.
</p>
<p>For these interfaces, you must set record generation to <em>software</em>.
Without this information, <span class="code">weewx</span> is unable to detect
the absence of onboard memory. If you do not do this, you will get errors that
look like the following in your syslog:</p>
<pre class="tty">Nov 27 20:30:21 raspberrypi weewx[5607]: reportengine: Caught unrecoverable exception in generator weewx.filegenerator.FileGenerator
Nov 27 20:30:21 raspberrypi weewx[5607]: **** 'NoneType' object has no attribute '__getitem__'
Nov 27 20:30:21 raspberrypi weewx[5607]: **** Traceback (most recent call last):
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/reportengine.py", line 132, in run
Nov 27 20:30:21 raspberrypi weewx[5607]: **** obj.start()
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/reportengine.py", line 259, in start
Nov 27 20:30:21 raspberrypi weewx[5607]: **** self.run()
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/filegenerator.py", line 41, in run
Nov 27 20:30:21 raspberrypi weewx[5607]: **** self.setup()
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/filegenerator.py", line 52, in setup
Nov 27 20:30:21 raspberrypi weewx[5607]: **** self.initAlmanac(self.gen_ts)
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/filegenerator.py", line 87, in initAlmanac
Nov 27 20:30:21 raspberrypi weewx[5607]: **** rec = self.getRecord(archivedb, celestial_ts)
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/filegenerator.py", line 115, in getRecord
Nov 27 20:30:21 raspberrypi weewx[5607]: **** record_dict_vt = weewx.units.dictFromStd(record_dict)
Nov 27 20:30:21 raspberrypi weewx[5607]: **** File "/home/weewx/bin/weewx/units.py", line 892, in dictFromStd
Nov 27 20:30:21 raspberrypi weewx[5607]: **** std_unit_system = d['usUnits']
Nov 27 20:30:21 raspberrypi weewx[5607]: **** TypeError: 'NoneType' object has no attribute '__getitem__'
Nov 27 20:30:21 raspberrypi weewx[5607]: **** Generator terminated...
Nov 27 20:30:23 raspberrypi weewx[5607]: genimages: Generated 11 images in 2.53 seconds</pre>
<p>See the section on option <span class="code">
<a href="#record_generation">record_generation</a></span>.</p>
<h3>Raspberry Pi</h3>
<p>Running <span class="code">weewx</span> on a Raspberry Pi has become
very popular. You'll have to look elsewhere for instructions on setting up
your RPi (I don't own one), but there is one very common problem with
them.</p>
<p class="warning">You must run NTP on your RPi, and you must make sure it
starts and updates the time <em>before</em> <span class="code">weewx</span>
runs.</p>
<p>The reason is that the RPi does not have an onboard clock. If you lose
power and, say, an hour later it comes back, your RPi will simply pick up
where it left off — one hour behind. The symptom that something is amiss
is that everything will appear to be running normally, but your webpage
will not get updated (at least, until the length of the power failure has
elapsed).
<a href="https://groups.google.com/forum/#!searchin/weewx-user/clock/weewx-user/tmbrOC6-UiM/1xohs9WUAW8J">
Here's one user's nice analysis of the problem.</a></p>
<p>What this means is that it is not enough to simply run the
<span class="code">weewx</span>
daemon. You need some way of delaying its start until NTP is not only up
and running, but has contacted a time server and corrected the RPi's
clock. </p>
<p>Several users are working on a solution to this problem. Perhaps you'll
be the one to figure it out?!</p>
<h2>Software problems</h2>
<p>This section covers some common software configuration problems.</p>
<h3>Nothing in the log file</h3>
<p>As it is running, <span class='code'>weewx</span> periodically sends
status information, failures, and other things to your system's logging
facility. They typically look something like this:</p>
<pre class='tty'>-DATE- --TIME-- HOST weewx[-PID-]: LOG_MESSAGE
Jan 1 09:46:32 saga weewx[15292]: wxengine: Initializing weewx version 2.5.1
Jan 1 09:46:32 saga weewx[15292]: wxengine: Using Python 2.6.6 (r266:84292, Dec 27 2010, 21:57:32) #012[GCC 4.4.5 20100902 (prerelease)]
Jan 1 09:46:32 saga weewx[15292]: wxengine: pid file is /var/run/weewx.pid</pre>
<p>The location of this logging file varies from system to system,
but it is typically
in <span class="code">/var/log/syslog</span>, or something
similar.</p>
<p>However, some systems default to saving only warning or
critical information, so the '<span class="code">info</span>'
messages from <span class="code">weewx</span> may not appear.
If this happens to you, check your system logging configuration.
On Debian systems, look
in <span class="code">/etc/rsyslog.conf</span>. On Redhat
systems, look in <span class="code">/etc/syslog.conf</span>.</p>
<h3><span class="code">configobj</span> errors</h3>
<p>These are errors in the configuration file. Two are very common.
Incidentally, these errors are far easier to diagnose when
<span class="code">weewx</span> is run from the command line. </p>
<h4><span class="code">configobj.DuplicateError</span> exception</h4>
<p>This error is caused by using an identifier more than once in the
configuration file. For example, you may have inadvertently listed
your FTP server twice:
</p>
<p class='tty'>[Reports]
[[FTP]]
... (details elided)
user = fred
server = ftp.myhost.com
password = mypassword
server = ftp.myhost.com # OOPS! Listed it twice!
path = /weather
... </p>
<p>Generally, if you encounter this error, the log file will give you the
line number it happened in: </p>
<p class='tty'>Apr 24 12:09:15 raven weewx[11480]: wxengine: Error while parsing configuration file /home/weewx/weewx.conf
Apr 24 12:09:15 raven weewx[11480]: wxengine: Unable to initialize main loop:
Apr 24 12:09:15 raven weewx[11480]: **** Duplicate keyword name at line 254.
Apr 24 12:09:15 raven weewx[11480]: **** Exiting. </p>
<h4><span class="code">configobj.NestingError</span> exception</h4>
<p>This is a very similar error, and is caused by a misformed section nesting.
For example: </p>
<p class='tty'>[Reports]
[[FTP]]]
... (details elided)</p>
<p>Note the extra closing bracket on the subsection <span class="code">FTP</span>.
</p>
<h3>No barometer data</h3>
<p>If everything appears normal except that you have no barometer data, the
problem may be a mismatch between the unit system used for service
<span class="code">StdConvert</span> and the unit system used by service
<span class="code">StdQC</span>. For example:</p>
<pre class="tty">[StdConvert]
target_unit = METRIC
...
[StdQC]
[[MinMax]]
barometer = 28, 32.5</pre>
<p>The problem is that you are requiring the barometer data to be between
28 and 32.5, but with the unit system set to
<span class="code">METRIC</span>, the data will be in the range 990 to
1050 or so!</p>
<p>The solution is to change the values to match the units in StdConvert,
or specify the units in MinMax, regardless of the units in StdConvert.
For example:</p>
<pre class="tty">[StdConvert]
target_unit = US
...
[StdQC]
[[MinMax]]
barometer = 950, 1100, mbar</pre>
<h3><span class="code">Cheetah.NameMapper.NotFound</span> errors</h3>
<p>If you get errors of the sort: </p>
<p class='tty'>Apr 12 05:12:32 raven reportengine[3074]: filegenerator: Caught exception &quot;&lt;class &#39;NameMapper.NotFound&#39;&gt;&quot;
Apr 12 05:12:32 raven reportengine[3074]: **** Message: &quot;cannot find &#39;fubar&#39; in template /home/weewx/skins/Standard/index.html.tmpl&quot;
Apr 12 05:12:32 raven reportengine[3074]: **** Ignoring template and continuing.</p>
<p>you have a tag in your template that <span class="code">weewx</span>
does not recognize. In this example, it is the tag
<span class="code">$fubar</span> in the template
<span class="code">/home/weewx/skins/Standard/index.html.tmpl</span>.
</p>
<h3 id='dots_in_plots'>Dots in the plots</h3>
<p>If you see dots instead of lines in the daily plots, you might want to
change the graphing options or adjust the station's archive interval.
<p>In a default configuration, a time period greater than 1% of the
displayed timespan is considered to be a gap in data. So when the
interval between data points is greater than about 10 minutes, the
daily plots show dots instead of connected points. </p>
<p>Change the <a href="customizing.htm#line_gap_fraction"><span class='code'>line_gap_fraction</span></a>
option in <span class="code">skin.conf</span>
to control how much time is considered a break in data.</p>
<p>As for the archive interval, check the log file for an entry like this
soon after <span class='code'>weewx</span> starts up:</p>
<p class='tty'>Dec 30 10:54:17 saga weewx[10035]: wxengine: The archive interval in the configuration file (300) does not match the station hardware interval (1800).
Dec 30 10:54:17 saga weewx[10035]: wxengine: Using archive interval of 1800</p>
<p>In this example, interval in <span class="code">weewx.conf</span> is 5
minutes, but the station interval is 30 minutes. When the interval
in <span class="code">weewx.conf</span> does not match the station's
hardware interval, <span class="code">weewx</span> defers to the
station's interval.</p>
<p>Use the appropriate <a href="#configuring_hardware"><span class="code">wee_config_XXX</span></a> utility to change the station's interval.</p>
<h3 id="many_loop_read_errors">Many LOOP read errors with Davis Vantage</h3>
<p>The symptom is many LOOP errors and unreliable downloading of archive records.
Your log may look like this:
<pre class="tty">
Jan 18 20:38:52 raspberrypi weewx[6024]: VantagePro: Opened up serial port /dev/ttyUSB0, baudrate 19200
Jan 18 20:38:53 raspberrypi weewx[5977]: VantagePro: LOOP #12; read error. Try #1
Jan 18 20:38:53 raspberrypi weewx[5977]: **** Expected to read 99 chars; got 0 instead
Jan 18 20:38:58 raspberrypi weewx[7543]: VantagePro: LOOP #13; read error. Try #1
Jan 18 20:38:58 raspberrypi weewx[7543]: **** Expected to read 99 chars; got 4 instead
Jan 18 20:39:03 raspberrypi weewx[7543]: VantagePro: LOOP #14; read error. Try #2
Jan 18 20:39:03 raspberrypi weewx[7543]: **** Expected to read 99 chars; got 0 instead
Jan 18 20:39:03 raspberrypi weewx[5977]: VantagePro: LOOP #13; read error. Try #2
Jan 18 20:39:03 raspberrypi weewx[5977]: **** Expected to read 99 chars; got 4 instead
Jan 18 20:39:08 raspberrypi weewx[7543]: VantagePro: LOOP #15; read error. Try #3
Jan 18 20:39:08 raspberrypi weewx[7543]: **** Expected to read 99 chars; got 4 instead
Jan 18 20:39:09 raspberrypi weewx[5977]: VantagePro: LOOP #14; read error. Try #3
Jan 18 20:39:09 raspberrypi weewx[5977]: **** Expected to read 99 chars; got 2 instead
Jan 18 20:39:14 raspberrypi weewx[5977]: VantagePro: LOOP #15; read error. Try #4
Jan 18 20:39:14 raspberrypi weewx[5977]: **** Expected to read 99 chars; got 2 instead</pre>
<p>If you look closely at the log above, you'll see that there are
multiple instances of <span class="code">weewx</span> running
simultaneously (process IDs 5977, 6024, and 7543). They are
contending with each other for control of the console, resulting
in missed packets and records.
</p>
<p>The cure is simple: kill all but one of them.</p>
<h3 id='spikes'>Spikes in the graphs</h3>
<p>Occasionally you may see anomalous readings, typically manifested as
spikes in the graphs. The source could be a flaky serial/USB connection,
radio or other interference, a cheap USB-Serial adapter, low-quality
sensors, or simply an anomalous reading.</p>
<p>Sensor quality matters. It is not unusual for some low-end hardware
to report odd sensor readings occasionally (once every few days). Some
sensors, such as solar radiation/UV, have a limited lifespan of about
5 years. The (analog) humidity sensors on older Vantage stations are
known to deteriorate after a few years in wet environments.</p>
<p>If you frequently see anomalous data, first check the hardware.</p>
<p>To keep bad data from the database, add a quality control (QC) rule
such as Min/Max bounds. See the <a href="#StdQC">QC</a> section for
details.</p>
<p>To remove bad data from the database, you will have to do some basic
SQL commands. For example, let's say the station emitted some very
high temperatures and wind speeds for one or two readings. This is
how to remove them:</p>
<ol>
<li>stop <span class='code'>weewx</span></li>
<li>Make a copy of the archive database</li>
<p class='tty'>cp $SQLITE_ROOT/weewx.sdb $SQLITE_ROOT/weewx-YYMMDD.sdb</p>
<li>Verify the bad data exist where you think they exist</li>
<p class='tty'>sqlite3 $SQLITE_ROOT/weewx.sdb
sqlite> select dateTime,outTemp from archive where outTemp > 1000;</p>
<li>See whether the bad temperature and wind data happened at the same time</li>
<p class='tty'>sqlite> select dateTime,outTemp,windSpeed from archive where outTemp > 1000;</p>
<li>Remove the bad data by setting to NULL</li>
<p class='tty'>sqlite> update archive set windSpeed=NULL where outTemp > 1000;
sqlite> update archive set outTemp=NULL where outTemp > 1000;</p>
<li>Delete the statistics database so that <span class='code'>weewx</span> can regenerate it without the anomalies</li>
<li>start <span class='code'>weewx</span></li>
</ol>
<h3>Python 2.5</h3>
<p>Weewx should work with Python version 2.5, but it may take some fiddling
with your environment. Later versions of Python come with pysqlite and
with PIL already installed. You may have to do this yourself. Here is
how to do it with <a href="https://pypi.python.org/pypi/setuptools#python-2-4-and-python-2-5-support">
<span class='code'>easy_install</span></a>, but you may be
able to use <span class='code'>apt-get</span> or other tools, depending on
your operating system.</p>
<pre class="tty">
sudo easy_install pysqlite
sudo easy_install PIL</pre>
<p>Various possible complications:</p>
<ul>
<li>You may have to install the development environment of sqlite in
order to get <span class='code'>pysqlite</span> to install. This worked on my system:
<pre class="tty">
apt-get install libsqlite3-dev</pre>
Then rerun the installation of <span class='code'>pysqlite</span>.
</li>
<li>When you run <span class='code'>weewx</span>, you may get an error that looks like this
<pre class="tty">
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFont.py", line 218, in truetype
return FreeTypeFont(filename, size, index, encoding)
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFont.py", line 134, in __init__
self.font = core.getfont(file, size, index, encoding)
File "/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg/ImageFont.py", line 34, in __getattr__
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed</pre>
This is because your installed version of PIL was compiled without
libfreetype, which is needed for the FreeType fonts used in the
generated images. You can either change the font type (look in
file <span class='code'>skin.conf</span>), or supply the missing library. Note: if you are missing
the freetype library, you may be missing others as well. This is what worked on my system. YMMV.
<pre class="tty">
# Install the Freetype library:
sudo apt-get install libfreetype6-dev
# Make sure it, and the zlib library, are visible to easy_install
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
# Remove the PIL paths
sudo easy_install -m PIL
# Remove PIL itself:
sudo rm -r /usr/lib/python2.5/site-packages/PIL*
# Now rebuild PIL, this time with the right libraries
sudo easy_install PIL
</pre>
You may have to fiddle with the exact path used in the symbolic link. A helpful tool
is the Unix tool "<span class='code'>find</span>". For example, the following
uncovered where my freetype library was hiding:
<pre class="tty">
find /usr/lib -name "libfreetype*" -print</pre>
</li>
</ul>
<h3>FreeBSD</h3>
<p>User Fabian reports that the following had to be done to get the
VantagePro2 working under FreeBSD:</p>
<pre class="tty">I needed the uslcom Driver for the usb/rs232 Adapter used by my vantage. Also I had to reset the memory of the weatherstation.
Loading the Driver:
Put uslcom_load=&quot;YES&quot; in /boot/loader.conf (to load it as module).
Which gives here an output like:
uslcom0: &lt;CP2102 USB to UART Bridge Controller&gt; on usbus1
And put in <span class="code">weewx.conf</span>:
port = /dev/cuaU0</pre>
<h1 id="architecture">Architectural Notes</h1>
<p>This section is not required to get started, but it should help you
understand a bit more about how <span class="code">weewx</span> works. </p>
<h2>Goals</h2>
<p>The primary design goals of <span class="code">weewx </span>are: </p>
<ul>
<li>Architectural simplicity. No semaphores, no named pipes, no inter-process
communications, no complex multi-threading to manage. </li>
<li>Extensibility. Make it easy for the user to add new features or to modify
existing features.</li>
<li>&quot;Fast enough.&quot; In any design decision, architectural simplicity
and elegance trump speed. </li>
<li>One code base. The same code base should be used for all platforms,
all weather stations, all reports, and any combination of features. Ample
configuration and customization options should be provided so the user does not
feel tempted to start hacking code. At worse, the user may have to subclass,
which is much easier to port to newer versions of the code base, than customizing
the base code. </li>
<li>Minimal reliance on external packages, so the user does not have
to go chase them down all over the Web before getting started. </li>
<li>Support only the Davis VantagePro2 initially (that is what I have),
but make no architectural decisions that lock out other stations. </li>
<li>As &quot;pythonic&quot; as I know how to make it. I am a beginner
Python programmer with two decades of experience in C++. I tried hard to
not make the code base look like it was written by a C++ programmer who
stumbled across a Python manual! </li>
</ul>
<h2>Strategies</h2>
<p>To meet these goals, the following strategies were used: </p>
<ul>
<li>A &quot;micro-kernel&quot; design. The <span class="code">weewx</span>
engine actually does very little. Its primary job is to load and run <em>
services</em> at runtime, making it easy for users to add or subtract features.
</li>
<li>A largely stateless design style. For example, many of the processing
routines read the data they need directly from the database, rather than
caching it and sharing with other routines. While this means the same data
may be read multiple times, it also means the only point of possible cache
incoherence is through the database, where transactions are easily controlled.
This greatly reduces the chances of corrupting the data, making it much
easier to understand and modify the code base. </li>
<li>Isolate the data collection and archiving code in a single thread that
is simple enough that it is unlikely to crash. The report processing is
where most mistakes are likely to happen, so isolate that in a separate
thread. If it crashes, it will not affect the main data thread. </li>
<li>A powerful configuration parser,
<a href="http://www.voidspace.org.uk/python/configobj.html">ConfigObj</a>,
by Michael Foord and Nicola Larosa, was chosen to read the configuration
file. This allows many options that might otherwise have to go in the code
to go instead in a configuration file. </li>
<li>A powerful templating engine,
<a href="http://www.cheetahtemplate.org/">Cheetah</a>, was used. This allows
many variables that I may not have thought of to be accessed from within
the HTML templates, without starting to modify the code. </li>
<li>Pure Python. The code base is 100% Python &mdash; no underlying C libraries
need be built to install <span class="code">weewx</span>. This also means
no Makefiles are needed. </li>
</ul>
<p>While <span class="code">weewx</span> is nowhere near as fast at generating
images and HTML as its predecessor, <span class="code">wview</span> (this is
partially because <span class="code">weewx</span> uses fancier fonts and a much more powerful templating
engine), it is fast enough for all platforms but the slowest. I run
it regularly on a 500 MHz machine where generating the 9 images used in the &quot;Current
Conditions&quot; page takes just under 2 seconds (compared with
0.4 seconds for <span class="code">wview</span>). </p>
<p>Unfortunately, the architectural goal of one code base is likely to be broken
with the arrival of Python V3.X. It has so many changes that are not backwards
compatible with V2.X, that a separate code base will most likely be needed.
My intention is to stick with the V2.X versions until V3.X is so widespread
it cannot be ignored, then make a permanent switch. Given the slow adoption
rate of V3.X this is unlikely to happen anytime soon. In any case, I doubt the
transition will affect the average <span class="code">weewx</span> user. </p>
<p>All writes to the databases are protected by transactions. You can kill the
program at any time (either Control-C if run from the command line or &quot;<span class="code">/etc/init.d/weewx
stop</span>&quot; if a daemon) without fear of corrupting the databases. </p>
<p>The code makes ample use of exceptions to insure graceful recovery from problems
such as network outages. It also monitors socket and console timeouts, restarting
whatever it was working on several times before giving up. In the case of an
unrecoverable console error (such as the console not responding at all), the
program waits 60 seconds then restarts the program from the top.</p>
<p>Any &quot;hard&quot; exceptions, that is those that do not involve network
and console timeouts and are most likely due to a logic error, are logged, reraised,
and ultimately cause thread termination. If this happens in the main thread
(not likely due to its simplicity), then this causes program termination. If
it happens in the report processing thread (much more likely), then only the
generation of reports will be affected &mdash; the main thread will continue downloading
data off the instrument and putting them in the database. You can fix the problem
at your leisure, without worrying about losing any data. </p>
<h2>Terminology</h2>
<p>This is a glossary of terminology used throughout the code. </p>
<table style="width: 95%" class='indent'>
<tr>
<td class="text_highlight"><strong>Name</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td class="text_highlight">archive record</td>
<td>A record obtained from the SQL database</td>
</tr>
<tr>
<td class="text_highlight">archive packet</td>
<td>A packet obtained from the store on the weather station. For
example, with a Davis VantagePro, it is obtained using the
<span class="code">DMPAFT</span> command. </td>
</tr>
<tr>
<td class="text_highlight">datetime</td>
<td>An instance of the Python object
<span class="code">datetime.datetime</span>. Variables of type
datetime usually have a suffix <span class="code">_dt</span>.</td>
</tr>
<tr>
<td class="text_highlight">db_dict</td>
<td>A dictionary with all the data necessary to bind to a database.
An example for sqlite would be <span class="code">
{'driver':'db.sqlite',
'root':'/home/weewx',
'database':'archive/weewx.sdb'}</span>,
an example for MySQL would be <span class="code">{
'driver':'db.mysql',
'host':'localhost',
'user':'weewx',
'password':'mypassword',
'database':'weewx'}</span>.</td>
</tr>
<tr>
<td class="text_highlight">epoch time</td>
<td>Sometimes referred to as &quot;unix time,&quot; or &quot;unix
epoch time.&quot; The number of seconds since the epoch, which is
1 Jan 1970 00:00:00 UTC. Hence, it always represents UTC (well...
after adding a few leap seconds. But, close enough). This is the
time used in the databases and appears as type <span class="code">
dateTime</span> in the SQL schema, perhaps an unfortunate name
because of the similarity to the completely unrelated Python type
<span class="code">datetime</span>. Very easy to manipulate, but
it is a big opaque number. </td>
</tr>
<tr>
<td class="text_highlight">loop packet</td>
<td>A packet with the current observations. For example, with a Davis
VantagePro, it is obtained using the <span class="code">LOOP</span>
command. </td>
</tr>
<tr>
<td class="text_highlight">observation&nbsp;type</td>
<td>A type that can be used in the presentations. This is generally
all of the SQL types, plus calculated data (such as
<span class="code">rms</span> or <span class="code">vecavg</span>).</td>
</tr>
<tr>
<td class="text_highlight">packet</td>
<td>Something obtained from the weather station. Frequently uses a
complex internal encoding, so it requires some processing to be
useful.</td>
</tr>
<tr>
<td class="text_highlight">record</td>
<td>Something obtained from the SQL database. </td>
</tr>
<tr>
<td class="text_highlight">SQL type</td>
<td>A type that appears in the SQL database. This usually looks
something like <span class="code">outTemp</span>,
<span class="code">barometer</span>,
<span class="code">extraTemp1</span>,
and so on.</td>
</tr>
<tr>
<td class="text_highlight">time stamp</td>
<td>A variable in unix epoch time. Always in UTC. Variables carrying
a time stamp usually have a suffix
<span class="code">_ts</span>.</td>
</tr>
<tr>
<td class="text_highlight">tuple-time</td>
<td>An instance of the Python object <span class="code">
<a href="http://docs.python.org/2/library/time.html#time.struct_time">
time.struct_time</a></span>. This is a 9-wise tuple that
represent a time. It could be in either local time or UTC, though
usually the former. See module <span class="code">
<a href="http://docs.python.org/2/library/time.html">time</a>
</span> for more information. They are useful because they are a
little closer in format to what the Davis VantagePro uses, although
they still require a bit of processing. Variables carrying tuple
time usually have a suffix <span class="code">_tt</span>.</td>
</tr>
<tr>
<td class="text_highlight">value tuple</td>
<td>A 3-way tuple. First element is a value, second element the unit
type the value is in, the third the unit group. An example would be
<span class="code">(21.2, &#39;degree_C&#39;, &#39;group_temperature&#39;)</span>.</td>
</tr>
</table>
<h2>Units</h2>
<p>In general, there are three different areas where the unit system makes a
difference.: </p>
<ol>
<li>On the weather station. As far as I know, the Davis Vantage series
supports only U.S. Customary units internally. The Oregon Scientific
stations use an odd mix of US and metric. The Fine Offset
stations are metric. The LaCrosse stations are metric. The
Hideki stations are a mix of US and metric. One-wire devices
can be either US or metric.</li>
<li>In the database. Either US or Metric can be used.</li>
<li>In the presentation (i.e., html and image files). </li>
</ol>
<p>The general strategy is that measurements are converted by service
<span class="code">StdConvert</span> as they come off the weather station into
a target unit system, then stored internally in the database. Then, as they
come off the database to be used for a report, they are converted into a target
unit, specified by the skin. </p>
<h2>Value &quot;<span class="code">None</span>&quot;</h2>
<p>The Python special value <span class="code">None</span> is used
throughout to signal a missing data point. All functions expect it. </p>
<p>However, the time value must never be <span class="code">None</span>.
This is because it is used as the primary key in the SQL database. </p>
<h2>Time</h2>
<p><span class="code">Weewx </span>stores all data in UTC (roughly, &quot;Greenwich&quot;
or &quot;Zulu&quot;) time. However, usually one is interested in weather events
in local time and want image and HTML generation to reflect that. Furthermore,
most weather stations are configured in local time. This requires that many
data times be converted back and forth between UTC and local time. To avoid
tripping up over time zones and daylight savings time, <span class="code">weewx</span>
generally uses Python routines to do this conversion. Nowhere in the code base
is there any explicit recognition of DST. Instead, its presence is implicit
in the conversions. At times, this can cause the code to be relatively inefficient.
</p>
<p>For example, if one wanted to plot something every 3 hours in UTC time, it
would be very simple: to get the next plot point, just add 10,800 to the epoch
time: </p>
<pre class="tty">next_ts = last_ts + 10800 </pre>
<p>But, if one wanted to plot something for every 3 hours <em>in local time</em>
(that is, at 0000, 0300, 0600, etc.), despite a possible DST change in the middle,
then things get a bit more complicated. One could modify the above to recognize
whether a DST transition occurs sometime between <span class="code">last_ts</span>
and the next three hours and, if so, make the necessary adjustments. This is
generally what <span class="code">wview</span> does. <span class="code">Weewx
</span>takes a different approach and converts from UTC to local, does the arithmetic,
then converts back. This is inefficient, but bulletproof against changes in
DST algorithms, etc: </p>
<pre class="tty">time_dt = datetime.datetime.fromtimestamp(last_ts)
delta = datetime.timedelta(seconds=10800)
next_dt = time_dt + delta
next_ts = int(time.mktime(next_dt.timetuple()))</pre>
<p>Other time conversion problems are handled in a similar manner. </p>
</div>
<p class='copyright'>
&copy; <a href='copyright.htm'>Copyright</a> Tom Keffer
</p>
<script type="text/javascript">
$('#toc').toc({
exclude : 'h4, h5, h6',
autoId : true,
context : '#technical_content',
numerate: true
});
</script>
</body>
</html>