mirror of
https://github.com/weewx/weewx.git
synced 2026-04-21 18:17:01 -04:00
Added customization and upgrading directions
This commit is contained in:
177
docs/customizing.htm
Normal file
177
docs/customizing.htm
Normal file
@@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- $Date$ -->
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Upgrading weewx</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12pt Verdana, arial, sans-serif;
|
||||
color: black;
|
||||
}
|
||||
p {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ol {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ul {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
li {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dl {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dt {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dd {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
h1 {
|
||||
font: 18pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
border-bottom: 2px solid black;
|
||||
border-right: 2px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 60pt;
|
||||
}
|
||||
h2 {
|
||||
font: 16pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 30pt;
|
||||
}
|
||||
h3 {
|
||||
font: 15pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
}
|
||||
h4 {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
.code {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
table {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
.indent {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.tty {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
margin-left: 40px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.config_option {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: normal;
|
||||
}
|
||||
.config_section {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
.config_important {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: bold;
|
||||
color: #0000FF;
|
||||
}
|
||||
.bold_n_blue {
|
||||
color: #0000FF;
|
||||
}
|
||||
.style1 {
|
||||
background-color: #E8E8E8;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="title"><span class="style1">Customizing </span>weewx v1.3</h1>
|
||||
<h1>Overview</h1>
|
||||
<p>At a high level, weewx consists of an <em>engine</em> that is responsible for
|
||||
managing a set of <em>services</em>. A service consists of a Python class with a
|
||||
set of member functions. The engine arranges to have appropriate member
|
||||
functions called when specific events happen. For example, when a new LOOP
|
||||
packet arrives, member function <span class="code">processLoopPacket()</span> of
|
||||
all services is called.</p>
|
||||
<p>To customize, you can</p>
|
||||
<ul>
|
||||
<li>Customize a service</li>
|
||||
<li>Add a service</li>
|
||||
<li>Customize the engine</li>
|
||||
</ul>
|
||||
<p>This document describes how to do all three.</p>
|
||||
<p>The default install of <span class="code">weewx</span> includes the following services:</p>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td>Service</td>
|
||||
<td>Function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="code">weewx.wxengine.StdWunderground</span></td>
|
||||
<td>Starts thread to manage WU connection; adds new data to a Queue to
|
||||
be posted to the WU by the thread.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="code">weewx.wxengine.StdCatchUp</span></td>
|
||||
<td>Any data found on the weather station memory but not yet in the
|
||||
archive, is retrieved and put in the archive.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="code">weewx.wxengine.StdTimeSynch</span></td>
|
||||
<td>Arranges to have the clock on the station synchronized at regular
|
||||
intervals.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="code">weewx.wxengine.StdPrint</span></td>
|
||||
<td>Prints out new LOOP and archive packets on the console.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="code">weewx.wxengine.StdProcess</span></td>
|
||||
<td>Launches a new thread to create reports, HTML, and images.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h1>Customizing a Service</h1>
|
||||
<p>The service weewx.wxengine.StdPrint prints out new LOOP and archive packets
|
||||
to the console when they arrive. By default, it prints out time, barometer,
|
||||
outside temperature, wind speed, and wind direction.</p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
2917
docs/readme.htm
2917
docs/readme.htm
File diff suppressed because it is too large
Load Diff
481
docs/sheeva.htm
Executable file → Normal file
481
docs/sheeva.htm
Executable file → Normal file
@@ -1,240 +1,241 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- $Date$ -->
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Porting to the SheevaPlug</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12pt/0 Verdana, arial, sans-serif;
|
||||
color: black;
|
||||
}
|
||||
p {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ol {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ul {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
li {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dl {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dt {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dd {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
h1 {
|
||||
font: 18pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
border-bottom: 2px solid black;
|
||||
border-right: 2px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 60pt;
|
||||
}
|
||||
h2 {
|
||||
font: 16pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 30pt;
|
||||
}
|
||||
h3 {
|
||||
font: 15pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
}
|
||||
h4 {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
.code {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
table {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
.indent {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.tty {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
margin-left: 40px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
}
|
||||
.config_option {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: normal;
|
||||
}
|
||||
.config_section {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
.config_important {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: bold;
|
||||
color: #0000FF;
|
||||
}
|
||||
.bold_n_blue {
|
||||
color: #0000FF;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="title">Notes on porting <span class="code">weewx</span> <br />
|
||||
to the SheevaPlug</h1>
|
||||
<p>The SheevaPlug is a very small, very low-powered general purpose computer.
|
||||
Equipped with a single USB port and a single Ethernet port and a modest amount
|
||||
of memory (512 MB) and storage (512 MB), in many ways it is an ideal server for
|
||||
a weather station. The website <a href="http://www.openplug.org">openplug.org</a>
|
||||
has a good "<a href="http://www.openplug.org/plugwiki/index.php/QuickStart">Quick
|
||||
Start</a>" guide on how to get up and running on the Plug.</p>
|
||||
<p>Porting weewx to it is very straightforward. For the most part, follow the
|
||||
directions
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/New_Plugger_How_To">New
|
||||
Plugger How To</a> in the OpenPlug wiki on how to set up the Plug.</p>
|
||||
<p>When you get to the "Pause for a second" section, you have a choice. You can
|
||||
either continue using the kernel and version of Ubuntu that comes with the Plug
|
||||
"as is",
|
||||
or you can install a newer version. </p>
|
||||
<p>My SheevaPlug came with kernel 2.6.22.18, which does not support the CP2101
|
||||
USB serial device used by the VantagePro, necessitating a kernel upgrade.
|
||||
However, if you have a serial interface to your VantagePro and you are planning on using a USB-to-serial converter, you might
|
||||
well be in luck if your converter uses something that is recognized by the
|
||||
2.6.22.18 kernel. I think it's worth trying the out-of-the-box SheevaPlug before messing around with upgrading the kernel --- you might
|
||||
get lucky. I wasn't. If it doesn't work out, you'll only lose about 30
|
||||
minutes of work.</p>
|
||||
<h2>1. Installing V1.0 Installer</h2>
|
||||
<p>This section assumes that you will need to upgrade your kernel. If you don't,
|
||||
or if you want to give the existing kernel a try, skip it and go on to the next
|
||||
section, <a href="#Installing_weewx">Installing weewx</a>. If things don't work
|
||||
out, you can always come back here.</p>
|
||||
<p>If you need to upgrade your kernel, the easiest way to do so is to use the
|
||||
new V1.0 Installer. <a href="http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer">
|
||||
Instructions can be found here.</a> The readme file that comes with the
|
||||
installer is very confusing. These instructions are much better.</p>
|
||||
<p>One of the first things you will need to do is establish connectivity to the SheevaPlug by using its serial port (instead of via SSH through its Ethernet
|
||||
port). Here are directions for both
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/Setting_up_Serial_Console_Under_Linux">
|
||||
Linux</a> or
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/How-to_setup_PuTTY_for_the_SheevaPlug_on_Windows">
|
||||
Windows</a>. I was able to get both to work. As I understand it, the install
|
||||
process is managed and controlled through this port, although the actual files
|
||||
come off of a USB stick. </p>
|
||||
<p>As per the instructions, download the tarball and extract. </p>
|
||||
<p>Move the following files from subdirectory sheevaplug-installer-<span class="code">v1.0/installer</span>
|
||||
to to the root directory of a FAT 32 USB stick:</p>
|
||||
<p class="tty">initrd</p>
|
||||
<p class="tty">modules.tar.gz</p>
|
||||
<p class="tty">README.txt</p>
|
||||
<p class="tty">rootfs.tar.gz</p>
|
||||
<p class="tty">ubuntu-sheevaplug.sh</p>
|
||||
<p class="tty">uImage</p>
|
||||
<p>Plug the stick into the USB port of the SheevaPlug.</p>
|
||||
<p>I then tried installing the new kernel using a Windows host but had
|
||||
absolutely no luck. After running "<span class="code">runme.exe nand</span>" I
|
||||
would keep gettting the error:</p>
|
||||
<p class="tty">Error: unable to open ftdi device: device not found</p>
|
||||
<p class="tty">Runtime error, file "command.c", line 469:</p>
|
||||
<p class="tty"> **** openocd FAILED</p>
|
||||
<p class="tty"> **** Is the mini USB cable connected?</p>
|
||||
<p class="tty"> **** Try powering down, then replugging the Sheevaplug</p>
|
||||
<p>I tried several different ways, including rebooting with out running putty on the
|
||||
serial port. I also tried, as per
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer#Important_Note_for_Newer_Plugs_.287.2F30.2F09ish.29">
|
||||
these directions</a>, editing the file <span class="code">
|
||||
sheevaplug-installer-v1.0/uboot/openocd/config/interfaces/sheevaplug.cfg</span>.
|
||||
No luck (in fact, when I finally got things working using a Linux host, it was
|
||||
the original settings that did the trick).</p>
|
||||
<p>Here's how to install from a Linux host. From a Ubuntu 9.10 host I installed php:</p>
|
||||
<p class="tty">apt-get install php5-cli</p>
|
||||
<p>Then ran the Linux script</p>
|
||||
<p class="tty">php runme.php nand</p>
|
||||
<p>Got an error: libftdi.so.1 no such file. I installed it:</p>
|
||||
<p class="tty">apt-get install libftdi1</p>
|
||||
<p>Still no luck. Then I unplugged then plugged in USB cable. Tried again.
|
||||
Worked!</p>
|
||||
<p>This put me at kernel 2.6.30.2.</p>
|
||||
<h2><a name="Installing_weewx">2. Installing weewx</a></h2>
|
||||
<p> </p>
|
||||
<p>Now it's just a simple matter of installing weewx, albeit with a few more
|
||||
missing pieces. I did the following installs/configurations to the operating
|
||||
system. You may want to do more, or leave some out. When I was done I had about
|
||||
256 MB of disk space left on the internal flash drive (out of the original 512
|
||||
MB).</p>
|
||||
<p class="tty">apt-get update<br />
|
||||
apt-get dist-upgrade (big one)<br />
|
||||
apt-get autoremove<br />
|
||||
apt-get install wget<br />
|
||||
apt-get install sysv-rc-conf<br />
|
||||
apt-get install nfs-common<br />
|
||||
apt-get install ntp<br />
|
||||
dpkg-reconfigure tzdata</p>
|
||||
<p>I chose to have the directory <span class="code">/home/weewx</span> on a
|
||||
separate SD flash card, formatted with a Linux ext2 file system, which I then
|
||||
plugged into the slot the SheevaPlug offers.</p>
|
||||
<p>To have it mounted automatically on reboot, add the following line to /etc/fstab:</p>
|
||||
<p class="tty">/dev/mmcblk0p1 /home/weewx ext2 defaults 0 1</p>
|
||||
<p>I then went about adding the weewx prerequisites in the normal way (see the
|
||||
weewx
|
||||
<a href="file:///C:/Documents%20and%20Settings/Thomas%20Keffer/My%20Documents/My%20Web%20Sites/weewx/docs/readme.htm">readme</a> file):</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install sqlite3</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-pysqlite2</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-configobj # this installs python-support as well</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-serial</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-cheetah</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-imaging # for PIL; it's not included on
|
||||
the SheevaPlug</p>
|
||||
<p>Weewx then fired up right away. </p>
|
||||
<p>The SheevaPlug is no speed demon, but it's easily fast enough for the job at
|
||||
hand. Downloading the initial two weeks of data from the memory of my VantagePro
|
||||
console took about 10 minutes. After that,file generation went quite fast.
|
||||
Generating 30 images takes about 6.7 seconds, compared to 10.2 seconds on my
|
||||
fit-PC. Generating 4 HTML files takes 1.8 seconds on the Plug vs. 1.9 seconds on
|
||||
the fit-PC.</p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- $Date$ -->
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Porting to the SheevaPlug</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12pt Verdana, arial, sans-serif;
|
||||
color: black;
|
||||
}
|
||||
p {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ol {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ul {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
li {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dl {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dt {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dd {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
h1 {
|
||||
font: 18pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
border-bottom: 2px solid black;
|
||||
border-right: 2px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 60pt;
|
||||
}
|
||||
h2 {
|
||||
font: 16pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 30pt;
|
||||
}
|
||||
h3 {
|
||||
font: 15pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
}
|
||||
h4 {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
.code {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
table {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
.indent {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.tty {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
margin-left: 40px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.config_option {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: normal;
|
||||
}
|
||||
.config_section {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
.config_important {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: bold;
|
||||
color: #0000FF;
|
||||
}
|
||||
.bold_n_blue {
|
||||
color: #0000FF;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="title">Notes on porting <span class="code">weewx</span> <br />
|
||||
to the SheevaPlug</h1>
|
||||
<p>The SheevaPlug is a very small, very low-powered general purpose computer.
|
||||
Equipped with a single USB port and a single Ethernet port and a modest amount
|
||||
of memory (512 MB) and storage (512 MB), in many ways it is an ideal server for
|
||||
a weather station. The website <a href="http://www.openplug.org">openplug.org</a>
|
||||
has a good "<a href="http://www.openplug.org/plugwiki/index.php/QuickStart">Quick
|
||||
Start</a>" guide on how to get up and running on the Plug.</p>
|
||||
<p>Porting weewx to it is very straightforward. For the most part, follow the
|
||||
directions
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/New_Plugger_How_To">New
|
||||
Plugger How To</a> in the OpenPlug wiki on how to set up the Plug.</p>
|
||||
<p>When you get to the "Pause for a second" section, you have a choice. You can
|
||||
either continue using the kernel and version of Ubuntu that comes with the Plug
|
||||
"as is",
|
||||
or you can install a newer version. </p>
|
||||
<p>My SheevaPlug came with kernel 2.6.22.18, which does not support the CP2101
|
||||
USB serial device used by the VantagePro, necessitating a kernel upgrade.
|
||||
However, if you have a serial interface to your VantagePro and you are planning on using a USB-to-serial converter, you might
|
||||
well be in luck if your converter uses something that is recognized by the
|
||||
2.6.22.18 kernel. I think it's worth trying the out-of-the-box SheevaPlug before messing around with upgrading the kernel --- you might
|
||||
get lucky. I wasn't. If it doesn't work out, you'll only lose about 30
|
||||
minutes of work.</p>
|
||||
<h2>1. Installing V1.0 Installer</h2>
|
||||
<p>This section assumes that you will need to upgrade your kernel. If you don't,
|
||||
or if you want to give the existing kernel a try, skip it and go on to the next
|
||||
section, <a href="#Installing_weewx">Installing weewx</a>. If things don't work
|
||||
out, you can always come back here.</p>
|
||||
<p>If you need to upgrade your kernel, the easiest way to do so is to use the
|
||||
new V1.0 Installer. <a href="http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer">
|
||||
Instructions can be found here.</a> The readme file that comes with the
|
||||
installer is very confusing. These instructions are much better.</p>
|
||||
<p>One of the first things you will need to do is establish connectivity to the SheevaPlug by using its serial port (instead of via SSH through its Ethernet
|
||||
port). Here are directions for both
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/Setting_up_Serial_Console_Under_Linux">
|
||||
Linux</a> or
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/How-to_setup_PuTTY_for_the_SheevaPlug_on_Windows">
|
||||
Windows</a>. I was able to get both to work. As I understand it, the install
|
||||
process is managed and controlled through this port, although the actual files
|
||||
come off of a USB stick. </p>
|
||||
<p>As per the instructions, download the tarball and extract. </p>
|
||||
<p>Move the following files from subdirectory sheevaplug-installer-<span class="code">v1.0/installer</span>
|
||||
to to the root directory of a FAT 32 USB stick:</p>
|
||||
<p class="tty">initrd</p>
|
||||
<p class="tty">modules.tar.gz</p>
|
||||
<p class="tty">README.txt</p>
|
||||
<p class="tty">rootfs.tar.gz</p>
|
||||
<p class="tty">ubuntu-sheevaplug.sh</p>
|
||||
<p class="tty">uImage</p>
|
||||
<p>Plug the stick into the USB port of the SheevaPlug.</p>
|
||||
<p>I then tried installing the new kernel using a Windows host but had
|
||||
absolutely no luck. After running "<span class="code">runme.exe nand</span>" I
|
||||
would keep gettting the error:</p>
|
||||
<p class="tty">Error: unable to open ftdi device: device not found</p>
|
||||
<p class="tty">Runtime error, file "command.c", line 469:</p>
|
||||
<p class="tty"> **** openocd FAILED</p>
|
||||
<p class="tty"> **** Is the mini USB cable connected?</p>
|
||||
<p class="tty"> **** Try powering down, then replugging the Sheevaplug</p>
|
||||
<p>I tried several different ways, including rebooting with out running putty on the
|
||||
serial port. I also tried, as per
|
||||
<a href="http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer#Important_Note_for_Newer_Plugs_.287.2F30.2F09ish.29">
|
||||
these directions</a>, editing the file <span class="code">
|
||||
sheevaplug-installer-v1.0/uboot/openocd/config/interfaces/sheevaplug.cfg</span>.
|
||||
No luck (in fact, when I finally got things working using a Linux host, it was
|
||||
the original settings that did the trick).</p>
|
||||
<p>Here's how to install from a Linux host. From a Ubuntu 9.10 host I installed php:</p>
|
||||
<p class="tty">apt-get install php5-cli</p>
|
||||
<p>Then ran the Linux script</p>
|
||||
<p class="tty">php runme.php nand</p>
|
||||
<p>Got an error: libftdi.so.1 no such file. I installed it:</p>
|
||||
<p class="tty">apt-get install libftdi1</p>
|
||||
<p>Still no luck. Then I unplugged then plugged in USB cable. Tried again.
|
||||
Worked!</p>
|
||||
<p>This put me at kernel 2.6.30.2.</p>
|
||||
<h2><a name="Installing_weewx">2. Installing weewx</a></h2>
|
||||
<p> </p>
|
||||
<p>Now it's just a simple matter of installing weewx, albeit with a few more
|
||||
missing pieces. I did the following installs/configurations to the operating
|
||||
system. You may want to do more, or leave some out. When I was done I had about
|
||||
256 MB of disk space left on the internal flash drive (out of the original 512
|
||||
MB).</p>
|
||||
<p class="tty">apt-get update<br />
|
||||
apt-get dist-upgrade (big one)<br />
|
||||
apt-get autoremove<br />
|
||||
apt-get install wget<br />
|
||||
apt-get install sysv-rc-conf<br />
|
||||
apt-get install nfs-common<br />
|
||||
apt-get install ntp<br />
|
||||
dpkg-reconfigure tzdata</p>
|
||||
<p>I chose to have the directory <span class="code">/home/weewx</span> on a
|
||||
separate SD flash card, formatted with a Linux ext2 file system, which I then
|
||||
plugged into the slot the SheevaPlug offers.</p>
|
||||
<p>To have it mounted automatically on reboot, add the following line to /etc/fstab:</p>
|
||||
<p class="tty">/dev/mmcblk0p1 /home/weewx ext2 defaults 0 1</p>
|
||||
<p>I then went about adding the weewx prerequisites in the normal way (see the
|
||||
weewx
|
||||
<a href="file:///C:/Documents%20and%20Settings/Thomas%20Keffer/My%20Documents/My%20Web%20Sites/weewx/docs/readme.htm">readme</a> file):</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install sqlite3</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-pysqlite2</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-configobj # this installs python-support as well</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-serial</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-cheetah</p>
|
||||
<p style="margin-left: .375in; margin-right: 0in; margin-top: 0in; margin-bottom: 0in;" class="tty">
|
||||
apt-get install python-imaging # for PIL; it's not included on
|
||||
the SheevaPlug</p>
|
||||
<p>Weewx then fired up right away. </p>
|
||||
<p>The SheevaPlug is no speed demon, but it's easily fast enough for the job at
|
||||
hand. Downloading the initial two weeks of data from the memory of my VantagePro
|
||||
console took about 10 minutes. After that,file generation went quite fast.
|
||||
Generating 30 images takes about 6.7 seconds, compared to 10.2 seconds on my
|
||||
fit-PC. Generating 4 HTML files takes 1.8 seconds on the Plug vs. 1.9 seconds on
|
||||
the fit-PC.</p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
137
docs/upgrading.htm
Normal file
137
docs/upgrading.htm
Normal file
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- $Date$ -->
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Upgrading weewx</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12pt Verdana, arial, sans-serif;
|
||||
color: black;
|
||||
}
|
||||
p {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ol {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
ul {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
li {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dl {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dt {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
dd {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
}
|
||||
h1 {
|
||||
font: 18pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
border-bottom: 2px solid black;
|
||||
border-right: 2px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 60pt;
|
||||
}
|
||||
h2 {
|
||||
font: 16pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
margin-top: 30pt;
|
||||
}
|
||||
h3 {
|
||||
font: 15pt Verdana,arial,sans-serif;
|
||||
color: teal;
|
||||
border: 1px solid black;
|
||||
background-color: #e8e8e8;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
}
|
||||
h4 {
|
||||
font: 12pt Verdana,arial,sans-serif;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
.code {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
table {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
.indent {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.tty {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
margin-left: 40px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.config_option {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: normal;
|
||||
}
|
||||
.config_section {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
.config_important {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-weight: bold;
|
||||
color: #0000FF;
|
||||
}
|
||||
.bold_n_blue {
|
||||
color: #0000FF;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1 class="title">Upgrading to weewx v1.3</h1>
|
||||
<h1>Version specific directions</h1>
|
||||
<p>What follows are directions for upgrading from specific versions.</p>
|
||||
<h2>V1.2.0 or earlier</h2>
|
||||
<h3>Optional</h3>
|
||||
<p>Option <span class="code">clock_check</span>, previously found in the <span class="code">[VantagePro]</span> section, is now found in the
|
||||
<span class="code">[Station]</span> section. The install program will put a
|
||||
default value in the new place, but it will not delete nor move your old value
|
||||
over. If you have changed this value or if you can't stand the thought of
|
||||
<span class="code">clock_check</span> appearing in two different places, you
|
||||
should delete the old one found under <span class="code">[VantagePro]</span> and
|
||||
make sure the new value, found under <span class="code">[Station]</span> is
|
||||
correct.</p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user