|
Welcome to the Hardware Interfacing Project (HIP) Weather
Page at Earlham College. We collect, archive and publish weather
data on the web using only open
source software, including the
Linux operating system.
This project was originally supported by Earlham's
Ford/Knight Fund and Computing Services.

Weather on the roof of Dennis Hall at: 2008-12-04 23:20:00-05
- Outside Temperature: -7.7 C ( 18 F)
- Wind Speed: 11.0 m/s (24.61 mph)
- Wind Direction: W
- Barometer: 29.41 inches
- Humidity: 84 %
- Daily Rain: 0.02 cm
- Total Rain: 14.83 cm
- Wind Chill: -18 C ( 0 F)
- Dew Point: -10 C ( 14 F)
- Barometric Trend: Steady

Weather Links

Hardware
Out weather station is a Davis Instruments Weather
Monitor II equipped with the WeatherLink RS232 serial interface,
rain collector, external temperature/humidity sensor, and a
solar radiation sensor. We gather data from the station with a
dedicated PC running Red Hat Linux 6.X. The PC is an old 166 MHz
Pentium donated to us by Infocom, a local ISP.

Software
The software consists of three modules.
- Weather Station Interface
We gather the raw data and calibrate it on a PC interfaced to the
weather station using C code, the tarball with the files is called
getWeather.tar. The
Serial-Programming-HOWTO for Linux was a big help.
- Database
We use a PostgreSQL
database on the CS department web server. We wrote
getWeather.pl, a
Perl
script that runs getWeather.c remotely on the weather station
PC and uses the PostgreSQL perl module (Pg.pm available
on CPAN) to insert
data into the database. We use the cron facility to update
take data with getWeather.pl every 15 minutes.
- Web Interface
We wrote a CGI interface to the database called
currentWeather.cgi that uses the Pg module to pull the most
recent data from the database. The weather data at the top of this
page is displayed using currentWeather.cgi. (Our next project is to
display archived data.)
- Glue
We make the following available as examples of _one way_ to do this.
Since these scripts depend on lots of other technologies they are
very sensitive to a particular system environment. Your milage may
vary.

Davis provides documentation and sample C code for accessing
their WeatherLink hardware. We found it useful. Here are local
copies:
- techref.txt - This file contains a technical
description of the RS232 interface. It describes the primitive commands
upon which all higher level functionality must be built. It also
contains may examples of "C" code fragments to illustrate how the
commands are used. In addition, this file contains tables of the station
and link memory addresses.
- appendix.txt - This file contains
descriptions of coded numerical and bit-mapped values.
- faq.txt - This file contains short answers to
may commonly asked questions.
- commands.c - This source was included to give
you a source code reference of the commands in action.
- serial.c - Example "C" interface to the chip.
- serial.h - Header file for serial.c functions.
- ascii.c - Converts a binary weather data file
to ascii form.
- ccitt.h - Tables used for the CRC checksum
calculation.
- thitable.h - A table for calculating
Temperature-Humidity Index from temperature and humidity data.
|