X-Git-Url: http://git.rot13.org/?p=GroveSensor;a=blobdiff_plain;f=influx.sh;fp=influx.sh;h=14bd7430ee743c8847d10dc568f1adef51f2d7a3;hp=ae76e62c8d74f60b89e375f31d393d1aa23d613c;hb=b981b4e95e55dc6ad6cd47cc3d209a375156e0cb;hpb=6783d5f9dcacc3badf44435171942bf9d2f235cc diff --git a/influx.sh b/influx.sh index ae76e62..14bd743 100755 --- a/influx.sh +++ b/influx.sh @@ -1,8 +1,10 @@ #!/bin/sh -e -stty -F /dev/ttyUSB0 ispeed 115200 cs8 -cstopb -parenb -echo igncr +serial=/dev/serial/by-path/platform-xhci-hcd.3.auto-usb-0:2:1.0-port0 -cat /dev/ttyUSB0 | while read line ; do +stty -F $serial ispeed 115200 cs8 -cstopb -parenb -echo igncr + +cat $serial | while read line ; do curl --silent -XPOST "http://10.13.37.92:8086/write?consistency=any&db=rot13" --data-binary "grove,dc=trnjanska,host=$(hostname -s) $line" light=$( echo $line | sed -e 's/^.*,light=//' -e 's/,.*$//' ) mosquitto_pub -h rpi2 -t grove/light -m $light