Part 2 – Put your Lacrosse WS-23xx weather station online

Automated updates from your 23xx to wunderground.com

I have an extra linksys WRT54G (with linux firmware) lying around which I plan to use as an always-on linux box. I have not set this up yet, but I have tested out a simple setup on my desktop Linux box to upload the data from my 2317, which is now accessible by IP (see previous post), to wunderground.com.

1. Create an account at wetherunderground

Weatherunderground is a little hard to navigate. First you need to set up a new acount. I found this link from the front page, through Personal Weather Stations -> Register my Personal Weather Stations. When you have an account, the second link above will become Manage my Personal Weather Stations. You will be able to add a weatherstation. Using your username and password, you will be able to automatically upload your weather with wu2300.

2. Get the Open2300 Software (download)

Open2300 is set of open source utilities for controlling a Lacrosse WS-23xx series weather station. Open2300 contains ~15 applications which all perform a slightly different task related to the weather station, from turning the backlight on to uploading weather details to the web (see user guide). The Open2300 Open2300 unofficial API is a good resource for the 23xx serial port, and Open2300 unofficial memory map is a good reference for how data is arranged in the memory of the 23xx.

After downloading and gunzipping/untarring the source, compiling is simple, as long as you have the standard packages installed for compiling on your Linux Distribution. Simply issue the make command in the source directory.

$ make
gcc -Wall -O3 -DVERSION=\"1.10\" -c -o open2300.o open2300.c
In file included from rw2300.h:15,
from open2300.c:11:
linux2300.h:7:21: error: termios.h: No such file or directory
. . .

Oops, I was missing the libc6-dev package on my Ubuntu Feisty installation. All header files needed by open2300 seem to be in that standard package. Make went off without a hitch after libc6-dev was installed. I have not “installed” the Open2300 aplpications anywhere, preferring to run them from where I compiled them with ./<app>2300. After compilation, you will end up with a number of 2300 applications, each of which is documented on the Open2300 website.

$ ls *2300
bin2300 dump2300 histlog2300 interval2300 log2300 open2300 xml2300
cw2300 fetch2300 history2300 light2300 minmax2300 wu2300

The application I was interested in was wu2300, which will upload my 2317 data to Weatherunderground. I copied the distribution default configuration file (open2300-dist.conf) to open2300.conf (the default the Open2300 apps look for) and edited it for my needs by setting my tty device name and my Weatherunderground username and password(modifications in bold).

. . .
SERIAL_DEVICE <path to your serial device>
. . .
#### WEATHER UNDERGROUND variables (used only by wu2300)
WEATHER_UNDERGROUND_ID <username> # ID received from Weather Underground
WEATHER_UNDERGROUND_PASSWORD <password> # Password for Weather Underground
. . .

At this point, you would have a working Open2300 setup with your 23xx connected to the serial port of your Linux box. However, my goal is to have the 2317 on my home LAN, and access it from any generic Linux box. To do that I either needed to add TCP/IP support to Open2300, or find a utility which would emulate a serial port from a TCP/IP connection. I found the perfect, simple application for that, interceptty.

3. Get interceptty

Interceptty allows you to intercept one serial port, and connect it to another. For my use, I connect the “back-device” to my Serial Device Server’s IP side, and my “front-device” to a tty that Open2300 can access (looks like a file). Interceptty requires the configure script to be run before make. Creating the executables should be straight-forward.

$ sh ./configure
$ make

The interceptty man page is a pretty good place to start to get an idea of how the utility works. In my case, my Serial Device Server is at IP address 192.168.1.140, and its raw connection runs on port 3001. To connect interceptty from the device server to an arbitrarily named file, I use the following command line.

./interceptty @192.168.1.140:3001 <path to your serial device>

Where <path to your serial device> is the same as the path you set up in the open2300.conf configuration file, and can be any legal path to a filename that does not already exist. Now, assuming you have your configuration file correctly set up, and interceptty is working, you should be able to upload your weather station information to Weatherunderground. Keep in mind that it takes Weatherunderground a little time to start displaying the new data.

$ ./wu2300

When the command is issued, you should see output come accross the terminal where interceptty was executed, assuming you didn’t use the -q (quiet) option. This data won’t look like much, but it will tell you that Open2300 is talking to the 23xx over IP. The output might look like this.

. . .
< 0xce
> 0x33 (3)
> 0x18
> 0x05
> 0x00
> 0x1d
< 0x06
> 0x02
. . .

4. Troubleshooting

I have shown how to set up a complete 23xx to Weatherunderground site through an IP network. There are many troubleshooting steps which can be taken along the way that I have not discussed (some of which I have used). Some ideas are:

  • Connect the 23xx to the serial port on your Linux box before setting up interceptty, and issue some of the simpler Open2300 commands, like light2300, to see if it responds.
  • Connect an already working serial device, such as a modem or GPS to the Serial Device Server an try to connect to it from a PC or windows box. You need a telnet application to do this, but you should be able to telnet into the Serial Device Server (on the correct port for your hardware) and issue command to the serial device. If you get your null-modem setup correct, you can even talk to yourself by hooking the serial end of the device server up to your PC serial port. You can then talk from telnet into hyperterm, and vice-versa just by typing.

Leave a Reply