Home

Latest entries

Connect the environment with pachube

Pachube is a website that connects different sensors to the internet. It has an easy api. A lot of different webapps for graphing the collected data. 

Now my weather data is in the cloud :-).

 



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



Maze generator for the palm

Maze generator for the palm

Goal

The goal of this project is to create a program that generates all kinds mazes with different shapes (square, triangular). The program is written for the Palm, (palm IIIc color). The project is licensed under the GNU GPL.

Screenshots

triangular
triangular

square

Requirements

  • Palm os >=3.0, tested on the Palm IIIc

License

Maze generator for the Palm.

Copyright (C) 2003 David Rasch

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) 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.

Download



Tessellation for the iPhone

I'm programming a new version of Tessellation, this time it runs on the iPhone.

Learning Objective C and the Core Graphics API. And taking screenshots (Command-Shift-4, then space, then click a window)

Tessellation for the iPhone screenshot



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.



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)

Download the static wx200d package .

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

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



arduino on the wl500g

Instructions 

It is really easy to connect the arduino (with an usb connection) to the wl500g.

You need the following packages from openwrt: kmod-usb-serial, kmod-usb-serial-ftdi

Upload the Sketchbook -> Examples -> Communication -> PhysicalPixel onto the arduino on your normal computer.

Connect the arduino to the wl500g and load the modules (usbserial, ftdi_sio)

 It will create a serial port at /dev/usb/tts/0 (could be a different number, use dmesg to see the log)

Turn off the led: 

$ echo L > /dev/usb/tts/0    

 Turn on the led:

$ echo H > /dev/usb/tts/0

or use screen 

$ screen /dev/usb/tts/0 9600

More information: