Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fetch data from USB-WDE1 receiver and write it to RRDTool database
#!/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
@tihomircolev

This comment has been minimized.

Copy link

tihomircolev commented Jul 18, 2015

I think you have a mistake in line 15 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.