on Arduino to produce output which is then fed to dsm501.pl.
+Another strage one is audio2influx.sh which doesn't require
+any external hardware but instead report sox info about 1s
+or audio to influxdb. I'm using this to passivly monitor
+fan rotation by connecting it directly to microphone input
+on netbook and adjusting input gain to prevent clipping
+using alsamixer.
+
+To make alsamixer work, I had to remove pulseaudio.
--- /dev/null
+#!/bin/sh
+
+while true ; do
+
+arecord -d 1 -r 96000 /dev/shm/tmp.wav 2>/dev/null
+time=`date +'%s%N'`
+info=`sox /dev/shm/tmp.wav -n stat 2>&1 | grep '[0-9][0-9][0-9]*$' | sed -e 's/[()]//g' -e 's/: */=/' -e 's/ */_/g' | tee /dev/shm/audio | tr '\n' ',' | sed 's/[, ]*$//'`
+curl --silent -XPOST http://10.60.0.92:8086/write?db=rot13 --data-binary "fan,dc=trnjanska $info $time"
+
+done
+++ /dev/null
-#!/bin/sh
-
-while true ; do
-
-arecord -d 1 -r 96000 /dev/shm/tmp.wav 2>/dev/null
-time=`date +'%s%N'`
-info=`sox /dev/shm/tmp.wav -n stat 2>&1 | grep '[0-9][0-9][0-9]*$' | sed -e 's/[()]//g' -e 's/: */=/' -e 's/ */_/g' | tee /dev/shm/audio | tr '\n' ',' | sed 's/[, ]*$//'`
-curl --silent -XPOST http://10.60.0.92:8086/write?db=rot13 --data-binary "fan,dc=trnjanska $info $time"
-
-done
--- /dev/null
+[Unit]
+Description=audio to influx
+
+[Service]
+User=dpavlin
+ExecStart=/home/dpavlin/air-quality/audio2influx.sh
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+++ /dev/null
-[Unit]
-Description=audio to mqtt
-
-[Service]
-User=dpavlin
-ExecStart=/home/dpavlin/air-quality/audio2mqtt.sh
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target