mirror of
https://github.com/weewx/weewx.git
synced 2026-04-18 00:26:57 -04:00
145 lines
8.4 KiB
HTML
145 lines
8.4 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns: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>weewx: Porting to the SheevaPlug</title>
|
|
<!-- CSS -->
|
|
<link href="weewx_docs.css" rel="stylesheet" />
|
|
</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.plugcomputer.org/Documentation/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.plugcomputer.org/Documentation/howtos/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>
|
|
<h1>1. Installing V1.0 Installer</h1>
|
|
<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. Unfortunately, the readme file that comes with the
|
|
installer is very confusing.
|
|
<a href="http://www.plugcomputer.org/Documentation/howtos/sheevaplug-installer/">
|
|
Much better instructions can be found at this link.</a> </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.plugcomputer.org/Documentation/howtos/serial-terminallinuxprograms/">Linux</a> or
|
|
<a href="http://www.plugcomputer.org/Documentation/howtos/serialterminalwindowsputty/">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 <span class="code">sheevaplug-installer-v1.0/installer</span>
|
|
to to the root directory of a FAT 32 USB stick:</p>
|
|
<p class='tty'>
|
|
initrd<br/>
|
|
modules.tar.gz<br/>
|
|
README.txt<br/>
|
|
rootfs.tar.gz<br/>
|
|
ubuntu-sheevaplug.sh<br/>
|
|
uImage<br/>
|
|
</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<br/>
|
|
Runtime error, file "command.c", line 469:<br/>
|
|
**** openocd FAILED<br/>
|
|
**** Is the mini USB cable connected?<br/>
|
|
**** Try powering down, then replugging the Sheevaplug<br/>
|
|
</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>
|
|
<h1><a name="Installing_weewx">2. Installing weewx</a></h1>
|
|
<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
|
|
<span class="code">weewx</span> <a href="usersguide.htm">User's Guide</a> file):</p>
|
|
|
|
<p class='tty'>
|
|
apt-get install sqlite3<br/>
|
|
apt-get install python-pysqlite2<br/>
|
|
apt-get install python-configobj # this installs python-support as well<br/>
|
|
apt-get install python-serial<br/>
|
|
apt-get install python-cheetah<br/>
|
|
apt-get install python-imaging # for PIL; it's not included on the SheevaPlug<br/>
|
|
</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>
|
|
|
|
<h1>3. Update</h1>
|
|
<p>11/23/2012. I've noticed that a lot of the links in my original notes on the
|
|
SheevaPlug have been abandoned by plugcomputer.org. I've been able to find new
|
|
ones, but the resultant pages don't seem to be maintained. For example, they
|
|
have missing figures.</p>
|
|
|
|
<p class='copyright'>
|
|
© <a href='copyright.htm'>Copyright</a> Tom Keffer
|
|
</p>
|
|
|
|
</body>
|
|
|
|
</html>
|