send serial output to influxdb
[GroveSensor] / influx.sh
diff --git a/influx.sh b/influx.sh
new file mode 100755 (executable)
index 0000000..ce6f761
--- /dev/null
+++ b/influx.sh
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+stty -F /dev/ttyUSB0 ispeed 115200 cs8 -cstopb -parenb -echo igncr
+
+cat /dev/ttyUSB0 | while read line ; do
+       curl -XPOST "http://10.13.37.92:8086/write?consistency=any&db=rot13" --data-binary "grove,dc=trnjanska,host=$(hostname -s) $line"
+done