wx200d - client/server weather data collector for RadioShack WX200

Copyright (C) 1998 Tim Witham <twitham@pcocd2.intel.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

	(see the file COPYING for more details)

Latest official version is available by anonymous ftp at:

		ftp://sunsite.unc.edu/pub/Linux/apps/serialcomm/machines/

The actual latest version should be at my own page at:

		http://www.bobsplace.com/~twitham/wx200d/

See also The Unofficial Radio Shack WX-200 Electronic Weather Station
Support Page:

		http://wx200.planetfall.com/

You may find more information about RadioShack's WX200 device at:

		http://support.tandy.com/support_meters/36757.htm


	SUMMARY:

wx200d is a weather station data collector and server daemon for the
RadioShack WX200 (Cat. No. 63-1015).  wx200d optionally records all
weather data from the WX200 to files each day.  It can compress these
daily files if you have gzip.  It also listens for client connections
and tees the data out to those clients.  Clients (included) can
connect to wx200d from any machine and display the weather data in
real-time.


	NEW for 0.7 (see also the files ChangeLog and TODO):

* .day summary files contain average/low/high by hour

* .mon summary files contain average/low/high by day

* new wxsum creates the above files from .tab files

* new Makefile.data can be cron'd to auto-update all data files

* new wxplot2html can auto-make monthly and today's web pages

* wxplot can now plot .tab, .day and .mon data files

* many 0.6 bugs fixed; see ChangeLog


	INSTALLATION:

* You will need perl, GNU make, gnuplot and ppmtogif (from netpbm) to use
  all the features.  Basic logging doesn't require any of these though.

* edit Makefile and config.h if necessary

* make

* make install

* read all the man pages, starting with wx200d(8).

* link your WX200 serial device to /dev/wx200.  E.g.: `ln -s
  /dev/ttyS0 /dev/wx200'.  Alternatively, you can use `-s /dev/ttyS0'
  every time you run wx200d (where /dev/ttyS0 is the serial device
  your WX200 is connected to).

* configure your system to run `wx200d' at boot time.  Here's how I do
  it in /etc/rc.d/rc.local for example:

	if [ -x /usr/local/etc/wx200/wx200d ]; then
	    echo -n " wx200d"
	    /usr/local/etc/wx200/wx200d
	fi

Just run `wx200d' by hand to get started.

	OPTIONAL (if you want .day and .mon summary files):

* edit Makefile.data if necessary

* make install	(copies Makefile.data to Makefile in your data dir)

* set up a cron job to run make in the data directory early each day:

  05 0 * * * cd /usr/local/etc/wx200/data && make > /dev/null

	OPTIONAL (if you have a web server):

* copy or link wx200 to your web server's CGI bin area

* link the .../data/Makefile to your web server document area

* read top of wxplot2html and create a wxplot2html.conf if you need to

* set up a cron job to run make in the html directory every morning
  and to run wxplot2html late every hour:

  25 0 * * * cd /usr/local/etc/httpd/htdocs/wx200 && make html > /dev/null
  58 * * * * /usr/local/etc/wx200/wxplot2html

* copy wx200.html to your web server's document area and edit

* Let me know if you put your WX200 on the web so I can link to it!


	USAGE / program summaries:

The following programs are currently provided.  These may be improved
and added to later:

* wx200d	The daemon: run this process one time, like at boot time
* wx200		A simple command-line/CGI client that shows all known data
* wxstdout	A client that sends a copy of binary wx200 data to stdout
* wxfilter	filters raw WX200 data on stdin to tab-delimited on stdout
* wxdebug	reads wx200 data from stdin and shows the groups you want
* wxplot	perl(1) script that plots (graphs) tab-delimited data files
  wxsum		perl(1) script that filters .tab to .day or .day to .mon
  wxplot2html	perl(1) script that creates web pages for a month or today
  gnuplot.cmd	obsoleted by wxplot but may be handy if you have no perl(1)
  wxread	reads serial port directly and sends binary data to stdout

* You may use the option `-h' to show command-line options for
programs marked with * above.  Read their man pages for complete
documentation.  Of course the perl scripts can also be read directly.

You may run only one of wx200d or wxread at a time (since only one
process should be reading the serial port).  File locking should be
added to enforce this later.  wxread is only for debugging if you
think wx200d has a problem.


	PLATFORMS:

wx200d was developed specifically for Linux on:

 - Linux kernel 2.0.35
 - Slackware 3.5.0
 - egcs-2.90.29 980515 (egcs-1.0.3 release)
 - 96MB RAM
 - 100 MHz Intel Pentium(R) Processor

wx200d should run on any modern Linux and would probably work on other
unix's too.  See the TODO file for porting hints.


	CREDITS:

Thanks to RadioShack(TM) and AccuWeather(R) for producing a nice and
affordable weather station.  Radio Shack(TM) is a trademark used by
Tandy Corporation.  AccuWeather(R) is a registered trademark of
AccuWeather, Inc.

Thanks to Mike Wingstrom <mikeasl@earthlink.net> for reverse
engineering of the WX200 serial data stream.  And to Glynne Tolar
<glynne@blkbox.com> for additional work and for setting up the very
helpful mailing list and web page.  Without their efforts, this
project would have been much more difficult.  Thanks to Don Dykes
<dykes@pobox.com> for helpful feedback and encouragement.


	DISCLAIMER:

This was written by me on my own time and equipment.  My employer has
absolutely nothing to do with it.  See also the file COPYING.

Please send any comments, bug reports or suggestions to me:

	Tim Witham <twitham@pcocd2.intel.com>
or	Tim Witham <twitham@quiknet.com>
