Project : linux APRS weather station
I have a lacrosse WS-2300-11 weather station. I run linux AX25 with ldsped. At first, I thought of incorporating it into ldsped. But since it's not the main goal of ldsped and since *nix is about many little programs doing what they can best, I ended up with only a simple script. ON7LDS. |
1. Prerequisites
To start, we need a working weather data collecting program. On my linux system, wview is running.
2. wview Wview saves its data in a sqlite database. But it is able to save the collected data in an archive text file.
The APRS protocol reference specifies the weather reports. There are different possibilities (raw, positionless, complete with or without timestamp, ...)
(contents)
4. The script : Collecting the data I'm using a shell script to collect and format the data : The ldsped config file already holds your postition in nearly the right format. I only have to set the right APRS symbol. I don't like substitution patterns with lots of / and \ but I know no other quick solution, so : grep trafficpos /etc/ax25/ldsped.conf | awk '{print $2}' | sed s/?/_/ | sed s/\\\\/\\//)Read the last line of the wview archive data file into a variable : DATUM=$(date +%Y-%m-%d) Then extract the data from the DATA variable. Next is the code for de wind direction (9 th position in the DATA array). First, three zeros are prepended. Then, the last 3 characters are taken. This way, we always have a 3 position string with prepended zeroes. WDIR="000"${DATA[9]} The same for all needed data, recalculated when neccesary. Next is the temperature (position 2) which has to be in degrees Farenheit while my weather station gives me degrees Celcius. We need an integer, so the 0.5 is added to round the floating point result to an integer. TEMP=${DATA[2]} Finally, all data is put together and the length is checked.
The script is then invoked by a second script, pausing 900 seconds each time. (contents) |