Collecting RuuviTag measurements and displaying them with Grafana


#209

Hi,
so, adding “temperature” in “field(value)” didn’t work.

We showed the project to our teacher and his opinion was that somehow the RuuviCollector isn’t sending data. Now we are trying to build the ruuvicollector again, but now the building is giving errors/failures.

We then tried modifying the values inside ruuvicollector properties file, and with modifying “influxBatchMaxSize=2000” to 1234 and “limitingStrategy.defaultWithMotionSensitivity.threshold=0.05” to 0.06. This got rid of two “failures”. The building worked without properties file, but that didn’t give any data last time so that’s why we are trying to get this to work with the properties file.

Also, continuity to my last problem, hcitool. We noticed/remembered that line "sudo setcap ‘cap_net_raw,cap_net_admin+eip’ which hcidump gave an usage error for setcap.


#210

PasiK

  1. Issue

hcidump |head -30

systemctl status ruuvicollector # NB may show last failure even if ruuvicollector is running OK

systemctl status influxdb

ps -el |grep hci # find all things bluetooth

ps -el |grep Ruuvi

ls -ltra /var/log | tail # show last several most recently updated logs

and copy / paste results here ( Not screen print which omits information)

  1. influxdb takes a while to get ready to accept transactions (especially after a powerfail)
    I have found it helpful to add this to RuuviCollectorStart.sh just before java -jar target/ruuvi-collector-*.jar

for i in 240 220 200 180 160 140 120 100 80 60 40 20
do
logger " ++ RuuviCollector sleeping $i more seconds to give influx a start."
sleep 20
done

  1. To slow down influxdb restarts after failures add this to service section of /etc/systemd/system/influxd.service

RestartSec=600


#211

The following script displays any ruuvi tags with hex values
(There is an occasionally incorrectly formated fmt05 movement & seq# )

hcidump -t --raw |                           #include time stamps
grep --line-buffered --invert-match '\-\-' |               
sed --unbuffered "N ;s/\n//; s/   / /" |
grep --line-buffered '99 04' |
sed --unbuffered "s/04 3E .. 02 01 .. 01 \(..\) \(..\) \(..\) \(..\) \(..\) \(..\)/ \6:\5:\4:\3:\2:\1  /"|    #  pkt:Meta Event/" |
sed --unbuffered "s/1. 02 01 0. 1. FF 99 04//"|
sed --unbuffered "s/10 \(..\) 03 72 75 75 2E 76 69 2F 23 42/TX:\1 https:\/\/ruuvi\/#B/"|
sed --unbuffered "s/10 \(..\) 03 72 75 75 2E 76 69 2F 23 41/TX:\1 https:\/\/ruuvi\/#A/"|
sed --unbuffered "s/52 75 75 76 69 42 6F 6F 74/RuuviBoot\//"|

sed --unbuffered "s/   03 \(..\) /fmt03: \1% /" |
sed --unbuffered "s/fmt03: \(...\) \(..\) \(..\) \(..\) \(..\) \(..\) \(..\) \(..\) \(..\)/fmt03:\1 \2.\3C  \4\5kpa   \6\7x \8\9y03/" |
sed --unbuffered "s/y03 \(..\) \(..\) \(..\) \(..\) 00 00 00 00 ../y \1\2z  \3\4v /"      |

sed --unbuffered "s/   05 \(..\) \(..\) /fmt05: \1\2C /" |
sed --unbuffered "s/fmt05: \(....C\) \(..\) \(..\) \(..\) \(..\) \(..\) \(..\) \(..\) \(..\)/fmt05:\1 \2\3% \4\5kpa   \6\7x \8\9y05/" |
sed --unbuffered "s/y05 \(..\) \(..\) \(..\) \(..\)/y \1\2z  \3\4vTX /"      |
sed --unbuffered "s/vTX  \(..\) \(..\) \(..\) \(..\)/vTX MV:\1 #\2\3 \4/"