Index ¦ Archives ¦ Atom

Weather

My weatherstation broke down again :-(, to much rain :-( Look at the humidity! ! View the old graphs.

Weather

Februari 3th, 2009 Weather graphs

I added the weather graphs to the website. On the wl500g the graphs are generated with rrdtool and with lftp the graphs are uploaded to the server every hour.

lftp -c 'open -e "mirror -R $LOCALWEATHERDIR $WEBDIR" sftp://$WEBHOST/'

You can see them at Weather @ HACKLAB

November 5, 2009 WS-2307 weatherstation

Last year my old weatherstation was damaged by a storm. I bought a new ws-2307 weatherstation. It has wireless sensors and a nice lcd display. Of course I hooked it up to the wl500g. I compiled the open2300 weathersoftware on the wl500g itself.On the download page there is a python version. It has less functionality, but is easy to modify.

October 18, 2008 wx200 on the wl500g

Connect your weatherstation (wx200) to the internet using the wl500g router.

Hardware needed

  • wx200 weatherstation
  • usb flashdrive to store the weatherdata (you'll need a wl500gx or a usb hub)
  • usb to serial dongle (pl2303 or generic usb serial adapters are supported)
  • wl500g or wl500gx (with usb) or a serial port

Modules needed

  • Driver for the profilic 2303 (pl2303.o) or other serial converter
  • Serial to USB converter (usbserial.o)

Install with:

ipkg install kmod-usb-serial
ipkg install kmod-usb-serial-pl2303

Programs needed (static compiled)

  • wx200d program
  • wx200 program
  • wxread program (for testing)
  • wx200rrd.sh (script to store data in rrd database and create graphics)
  • Compile wx200d package from openwrt

Optional

With these tools you can create nice weather graphs on your wl500g and upload the data to a 'real' server.

Links

Howto install the weather software

Upload the files to the wl500g. Connect the wx200 with the serial adapter to the wl500g and load the modules.

insmod usbserial.o insmod pl2303.o

Set the execute bit on the program

chmod u+x wxread wx200d wx200

Check if you get a signal of the weatherstation

wxread /dev/usb/tts/0

weird characters are displayed after about 30 seconds, press CTRL-C to stop the program

Start the wx200d program
wx200d -s /dev/usb/tts/0 -w tmp -b

Writes the ascii logs to the /tmp directory, if you don't have enough diskspace and don't want logfiles add

wx200d -s /dev/usb/tts/0 -w tmp -a -b

Put this line in the startup after the usb serial modules are loaded.

Display the current weather
wx200
Howto upload the weather data using cron
  • Install cron, see macsat cron tutorial or openwrt tutorial
  • Display the current weather on one line without units in centigrades and hectopascal and no errors
#!/bin/sh
url="http://yoursite/scriptname"
query="`wx200 -ul --C --hpa -e| awk '{print "temp="$1"&humid="$3"&baro=" $7}'`"
options="-q -O /dev/null"
wget ${options} "${url}?${query}"
Current weather on the wl500g

Get current weather from the wl500g. WARNING! Dont use it on a public server! It's not a secure script!!! If you installed an webserver with cgi, you can link:

ln -s /usr/sbin/wx200 /www/cgi-bin/

And use the http://wl500g/cgi-bin/wx200 to get a simple weather report. You can tweak the arguments http://wl500g/cgi-bin/wx200?-h

Howto create weather graphs

Install rrdtool, see macsat rrdtool tutorial .

I edited the script from the macsat rrdtool tutorial. It creates 2 more graphs for humidity and barometer. The rrd database is about 110K. I placed the file on the ramdisk. (faster read and write, then the flash memory)

Link the images (and or the html pages) in the www directory

ln -s /tmp/*.png /www
ln -s /tmp/*.html /www

Add the script the to crontab

*/5 * * * * /usr/sbin/wx200rrd.sh

Compiling wx200d

If you want to compile wx200d yourself, there is a package in openwrt svn repository

© David Rasch. ipv6 ready http2 ready Built using Pelican. Theme by Giulio Fidente on github.