Created
November 13, 2013 13:47
-
-
Save Tafkas/7449360 to your computer and use it in GitHub Desktop.
Fetch data from USB-WDE1 receiver and write it to RRDTool database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Receive weather data from remote USB WDE1 and store it into database | |
# Loop forever to read data from USB WDE1 | |
socat / dev/ttyUSB0, B9600 STDOUT | \ | |
while read line | |
do | |
if [["$ {line%% *}" == '$ 1']] then | |
# Format data | |
"{? line # 1, 1,} $" tmp = `echo | tr ',' ','`. | |
data = `echo" $ {tmp% N% 0} "| sed 's / :: /: U :/ g' | sed 's / :: /: U :/ g'` | |
data = $ data {%%} | |
# Update rrd | |
rrdtool update temperatures.rrd $ data | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you have a mistake in line 15 :)