As part of the fun of interfacing things, I have ported some PHP code and a couple of shell scripts to drive an Ultimeter 800 weather station off a RaspPi.
I previously ran this on an NSLU2 unit, but this is smaller, uses less current and offers the ability for a proper console.
I have only just started running this on the Pi, but the results are visible from findu.com here:
http://www.findu.com/cgi-bin/wxpage.cgi?call=DW2662
The details of the system are as follows.
- *Using Earlier Raspberry Pi Model B with 4Gb SD card and Debian
*Weather station is a serial-based Ultimeter 800, made by Peet Brothers
*The serial to USB converter is a standard PL2302 device (details from dmesg in a minute)
*PHP script to pull the data from the unit of /dev/USB0
*Shell script to set the serial speed correctly
*Writes to a local file and then uploads to CWOP (optional)
So you can check what I am using, the output from dmesg for the serial to USB is as follows
Code: Select all
usb 1-1.3: new full speed USB device number 5 using dwc_otg
usb 1-1.3: New USB device found, idVendor=067b, idProduct=2303
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.3: Product: USB-Serial Controller D
usb 1-1.3: Manufacturer: Prolific Technology Inc.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for pl2303
pl2303 1-1.3:1.0: pl2303 converter detected
usb 1-1.3: pl2303 converter now attached to ttyUSB0
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
Code: Select all
#!/bin/sh
HOMELOC=/home/pi/cgi-bin
$HOMELOC/setserial.sh
# Carry out specific functions when asked to by the system
case "$1" in
cwop)
echo "Running ultimeter 800 to cwop"
/usr/bin/php $HOMELOC/wx-silent.php cwop >> $HOMELOC/wx.log
;;
*)
echo "Running ultimeter 800 locally"
/usr/bin/php $HOMELOC/wx-silent.php >> $HOMELOC/wx.log
;;
esac
Code: Select all
#!/bin/sh
stty -F /dev/ttyUSB0 ispeed 2400
stty -F /dev/ttyUSB0 ospeed 2400
stty -F /dev/ttyUSB0
Code: Select all
1,11,21,31,41,51 * * * * /home/pi/cgi-bin/u800_cwop_update.sh
For this to work, ensure you change the CWOP ID in the PHP script (search and you will find it), and also edit your latitude/longitude as well (in the function "FormatAPRSData()").
Offered without warranty but I hope of use out there.
Feedback welcome.
Darren