It is also possible to read version and status information from the weather station, and the te923con application gives access to this data as well. It is formatted the same way as the weather data, and so was also trivial to process in PHP. I wrote a script that gets the station and sensor status, and sends a notification email if one of the sensors has a low battery. That script is also included in the te923 zip file. Again, I know my PHP skills are weak, so if you have improvements I’d be interested in them.
I scheduled it to run once a day at midnight:
0 0 * * * sleep 30;php te923Status.php <notify email address>
The 30 second sleep is intended to offset the status check from the normal weather data check that happens exactly on the minute.
Debian out of the box doesn’t relay mail to external domains, so I had to do another tweak here. To enable forwarding, I reconfigured exim according to http://pkg-exim4.alioth.debian.org/README/README.Debian.etch.html.
It’s not really the proper way to create a real relay server, but since I’m behind a firewall and only using the server for this purpose, I didn’t feel it necessary to do more. But the email does look suspicious to the receiving mail system, so if you send to an address outside your domain (like gmail, for example), the mail is likely to be determined as spam. You’ll need to create whatever filters necessary at the recipient account to avoid this.
And that’s it so far. I expect I’ll delve into RRDTool and RRDWeather now to see if I can create graphs of readings Weather Underground does not (like humidity, for example).
Interesting thread! I was a subcontractor for Davis before working at Vstr/Evo/Dance and worked on hardware and embedded software for one of their first low-power wireless links and associated receiver/display and repeater stations. Part of my compensation was a Davis weather setup that is still working in my backyard, although looking a bit (ironically) weather beaten. The hardware included a serial link, but we never got a requirement to support it in code. The wireless protocol was interesting since it had to deal with unreliable links.
I’ve been thinking of upgrading to one of these fancy new weather stations, but have a sentimental attachment to the boxes with my code running inside.
Hi
Thanks for your info and your PHP scripts. I got my Ventus W831 working properly now.
It is hosted at my house via ADSL. If the usage is going to be high I will have to host it somewhere else.
Nico
Just want to add that the $id variable in your 99-te923.rules file does not work for me. Had to hard-code the value like 3-1:1.0. Now I just need to use the same USB port all the time.
I am running Debian (Lenny).
Nico
Hi Nico, thanks for commenting. I am unsure why $id did not work for you since I am also running Deb Lenny. My old server was in the process of dying (it was a recycled machine with a number of issues), so I recently moved the station to a new server, and believe it has worked for me.
That said, on the old server I found that occasionally the usbhid module would rebind to the weather station device, so I took to adding a script to root’s crontab to check for this and unbind if necessary, and in that script the device id is hardcoded. Checking the ‘man udev’ page, maybe $id is not the value to use. I will try to figure it out at some point, but if you do, please post back.