LaCross WS-2310

Weather Station

References:

I have a LaCross WS-2310 Weather Station. It is manufactured by LaCross Technology, but don't expect to find much information on their web site. The only software offered is for Windows; however a Linux clone is available (open2300).

Open2300 is a package of software tools that reads (and writes) data from a Lacrosse WS2300, WS2305, WS2310, or WS2315 Weather Station. It includes tools that save data to logfiles, XML files, and MySQL databases, as well as tools that upload your weather data to Weather Underground or Citizen Weather. You can control the display backlight, reset min/max values, and read and write to any memory location. It includes a function library for your own programs and a number of small PHP programs.

It compiled cleanly on my Debian Etch system and provides a way to access the WS-2310 from the command line.

For example, to obtain the outdoor temperature, I type
$> open2300 0373 r 2
which means starting at address 0373 read (r) 2 bytes (2)
And I get back

Read Commands sent: 82 8E 9E 8E CA
Address: 0374|0373 - Data: 10
Address: 0376|0375 - Data: 23
$>

The WS-2310 has a 4 bit processor so each memory location returns four bits, which is one nibble, or one Hex digit.

What the output is telling you is that: (Ignoring the Read Commands sent line for now)

The WS-2310 is little endian, which means it stores the least sigificant nibble in the lowest memory address. Also, the results are returned as binary coded decimal; or, in other words the hex value of the nibble is the same as the decimal value.

The format of the temperature output is:

Then the whole number is offset by 3010 (Decimal or Base 10)

All we have to do is treat the output as digits (not Hex values) and reverse the order so the result of the above query is 2310. Divide by 100 to get 23.10 and then subtract the offset of 30 to get -6.9° Celcius.

My shell script that handles getting the outside temperature is:
# Outside temperature (F)
b=""
for a in $(open2300 0373 r 2|sed -n /Address:/p|cut -d' ' -f5); do
  b=$a$b
done
to=$(awk "BEGIN {n = $b / 100; n = (n - 30) * 9 / 5 + 32; printf(\"%.1f\",n)}")
echo "Outside temperature is $to° Farenheit" >> $outfile

Because the biggest number that can be contained in 4 BCD digits is 99.99 and the offset is 30, this means the upper limit is 69.99° Celcius (157.8°F) and the lower limit is 00.00 -30 = -30° Celcius (-21.8°F). The operation manual confirms this, although it doesn't explain why.

If you only have to retreive one address, the shell script is simpler:
# Relative humidity (%)
rh=$(open2300 0419 r 1|sed -n /Address:/p|cut -d' ' -f5)
echo "Relative humidity outside is $rh%" >> $outfile

Install MySQL:

	aptitude install mysql-server mysql-client

Install MySQL sources:

	aptitude install libmysqlclient15-dev

Look at the source code (rw2300.c) to see how all the calculations are done

Compiling open2300

The up to date source files are available on Subversion (SVN).

Checking out a local copy is easy.

On Linux these are the steps:

Then read the README to find out how to setup the config file, etc.

Then do make and make install to get everything or just make open2300 to get the open2300 executable which you can then manually move to /usr/local/bin

If you do install as well as make, the binary open2300 will be in /usr/local/bin/open2300/

To keep it up to date svn update


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site
Many thanks to Debra and Ian Murdock for making Debian possible
First created Dec 15, 2008 ~ Last revised April 22, 2009

Valid XHTML 1.0 Strict Valid CSS!