--- /dev/null
+usb-wde1 tools
+--------------
+Tools to collect and analyze data from the USB-WDE1 weather receiver from ELV.de
+
+
+idea
+----
+1. pipe each received line to a command
+2. command splits up line into variables
+3. add variable data to rrdtool
+4. repeat
+
+
+idea: cat socat output to "read"
+
+
+
+Test it:
+$ php lines-to-stdout.php | ./work-with-lines.sh
+
+
+
+
+RRDtool database setup
+----------------------
+EXAMPLE
+ rrdtool create temperature.rrd --step 300 \
+ DS:temp:GAUGE:600:-273:5000 \
+ RRA:AVERAGE:0.5:1:1200 \
+ RRA:MIN:0.5:12:2400 \
+ RRA:MAX:0.5:12:2400 \
+ RRA:AVERAGE:0.5:12:2400
+
+ This sets up an RRD called temperature.rrd which accepts one temperature value every 300 seconds. If no new data is supplied for more than 600 seconds, the temperature becomes *UNKNOWN*. The minimum acceptable value is -273 and the maximum is 5'000.
+
+ A few archive areas are also defined. The first stores the temperatures supplied for 100 hours (1'200 * 300 seconds = 100 hours). The second RRA stores the minimum temperature recorded over every hour (12 * 300 seconds = 1 hour), for 100 days (2'400 hours). The third and the fourth RRA's do the same for the maximum and average temperature, respectively.
--- /dev/null
+#!/bin/sh
+# data will be collected ~ every 3 minutes (150s)
+# after 600s (10min) data are "unknown"
+# archives:
+# - store avg temperature on every data point for 1day (576*150s)
+#
+# - store avg temperature every 10 minutes for 1 week (6*24*7 = 1008)
+# - store min temperature -"-
+# - store max temperature -"-
+#
+# - store avg temperature every day for 10 years
+
+for i in 1..8
+rrdtool create sensor-$1.rrd --step 150 \
+ DS:temp:GAUGE:600:-273:5000 \
+ DS:humidity:GAUGE:600:0:100 \
+ RRA:AVERAGE:0.5:1:576 \
+ RRA:AVERAGE:0.5:4:1008 \
+ RRA:MIN:0.5:4:1008 \
+ RRA:MAX:0.5:4:1008 \
+ RRA:AVERAGE:0.5:576:3650
--- /dev/null
+<?php
+
+$n = 0;
+while ($n < 4) {
+ echo $n++ . ';col2;col3;col4' . "\n";
+ sleep(1);
+}
+
+?>
\ No newline at end of file
--- /dev/null
+line1
+line2
+line3
+a
+b
+c
--- /dev/null
+#!/bin/sh
+
+#split words by semicolons
+IFS=";"
+
+#Beispielausgabe USB-WDE1:
+# $1;1;;13,8;22,7;22,6;17,8;22,2;21,2;22,9;;59;35;38;49;38;40;35;;;;;;;0
+# Doku des Formats in 92030_USB_WDE1_V1.0_UM.pdf bei elv.de verfügbar
+
+#Variablenamen:
+# t1-t8: Temperatur in °C der Sensoren 1-8
+# f1-f8: Feuchtegrad in % der Sensoren 1-8
+# tc: Temperatur Kombinsensor in °C
+# fc: Feuchtegrad Kombinsensor in %
+# wg: Windgeschwindigkeit in km/h
+# ns: Niederschlag (Wippenschläge)
+# regen: Regen 1=ja, 0=nein
+while read -r startzeichen zustand zeitstempel\
+ t1 t2 t3 t4 t5 t6 t7 t8\
+ f1 f2 f3 f4 f5 f6 f7 f8\
+ tc fc wg ns regen
+do
+ echo "line:"
+ echo 1: $one , 2: $two, 3: $three, 4: $four
+done
+echo "done with everything"