This works great initially, but after a couple of days, Iām no longer recording data. Checking the status of the Grafana server shows the following error: āJan 31 13:25:55 rpri-ruuvi grafana-server[431]: t=2020-01-31T13:25:55-0600 lvl=info msg=āAlert Rule returned no dataā logger=alerting.evalHandler ruleId=1 name=āBattery Voltage (mV) alertā changing state to=no_dataā
Using the Ruuvi app, works fine. Any suggestions on what to do to troubleshoot? Please keep in mind that Iām a newbieā¦
Thereās a growing number of reports about HCITool crashing in Pi installations since summer 2019. Thereās probably some underlying problem with the Raspbian or HCItool, but how to fix it is yet on known. As a workaround you can have a cron job restart the collector.
sudo hciconfig reset # didnāt help in my case on 1/30/20.
My plan, rather than periodically (by cron ) reset/restart,
is to periodically check at lowest level and take corrective action only if failure is present.
At this time that means running hciconfig and checking output and if it times out invoking:
sudo logger -p kern.alert " " ++ rebooting due to HCI hangup "
sudo shutdown --reboot +5m " ++ rebooting due to HCI hangup "
I would love to hear from anyone with a more āgentleā corrective action.
Option #1 : Check output from lowest level device query like hciconfig -a. This normally reports 17 lines. If Bluetooth is hung reports much less.
I seem to have lost the example I created when it hung for me.
Option#2: Check if any data is being processed by background running hcitool lescan which is started by RuuviCollector using hcidump
To Check that RuuviCollector is updating database. For example:
echo "select temperature from ruuvi_measurements where time > now() -2m" |
influx -precision rfc3339 -database ruuvi >temperatureRecent.log
Newbie to both actuallyā¦ I can follow the guides easy enough and know enough to be dangerous. Love learning new stuff and enjoy playing around with this tech.
Is there a way to automatically check these connections via your commands and then issue the restart, based upon a lack of connections? Iāve never built a cron job yet.
There is nothing special about a cron job. Itās just any script which is invoked periodically by the cron daemon. The schedule is managed with crontab -e
See the best documentation (I wrote it! ) crontab
Are you still seeing hangups? If so what are the responses to the checking options I suggested?
The last part of the command >temperatureRecent.log
redirects the standard output (STDOUT) which should contain something like:
name: ruuvi_measurements
time temperature
---- -----------
2020-02-07T15:37:16.29571043Z 18.49
2020-02-07T15:37:21.399290325Z 8.815
If there are no measurements selected the file will be empty - a bad thing!
You can then use grep to find the lines containing a colon (like in the time of the data)
grep ':' temperatureRecent.log
RS=$?
This command saves the return status from the command which will be 0 if it is successful and nonzero if grep is unable to find a : in the file.
You can then use a command like:
if [ $RS -ne 0 ] ; then echo no recent entries in influxdb ; fi
More details about bash if statement are at: bash if
If this is run by cron the output of the echo will be emailed to you. (if you have mail configured).
Iām reviving this topic, as Iām having trouble getting my configuration working. Iām not getting any output to the Grafana report. Please keep in mind that Iām still a newbie to Ruuvi and linux.
Iāve run āhciconfig -aā and receive 15 lines in the response, including:
RX bytes:1594 acl:0 sco:0 events:104 errors:0
TX bytes:5258 acl:0 sco:0 commands:104 errors:0
Running āhcitool lescanā returns several lines such as:
5D:F6:33:4C:AC:5C (unknown)
77:77:0E:1B:47:DA (unknown)
69:2C:96:B6:F4:19 (unknown)
Running āsystemctl status ruuvicollector.serviceā returns the following:
Feb 12 09:00:39 svp-rpi java[469]: 2021-02-12 09:00:39.300 DEBUG [Main] Starting dump with: [hcidump, --raw]
Feb 12 09:00:39 svp-rpi java[469]: 2021-02-12 09:00:39.342 INFO [Main] BLE listener started successfully, waiting for dataā¦
Feb 12 09:00:39 svp-rpi java[469]: If you donāt get any data, check that you are able to run āhcitool lescanā and āhcidump --rawā without issues
Feb 12 09:00:56 svp-rpi java[469]: 2021-02-12 09:00:56.236 INFO [Main] Successfully reading data from hcidump
Feb 12 09:16:45 svp-rpi java[469]: 2021-02-12 09:16:45.160 WARN [Main] Uncaught exception while handling measurements from MAC address ā70722D707673ā, if this repeats and this is not a Ruuvitag, consider blacklisting it
Feb 12 09:16:45 svp-rpi java[469]: java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 4
Feb 12 09:16:45 svp-rpi java[469]: at fi.tkgwf.ruuvi.utils.Utils.getMacFromLine(Utils.java:53)
Feb 12 09:16:45 svp-rpi java[469]: at fi.tkgwf.ruuvi.Main.run(Main.java:98)
Feb 12 09:16:45 svp-rpi java[469]: at fi.tkgwf.ruuvi.Main.main(Main.java:45)
Feb 12 09:16:45 svp-rpi java[469]: 2021-02-12 09:16:45.231 DEBUG [Main] Offending line: > 04 0E 07 01 23 0C 00 00 00 1C
You have some very special weirdness going on.
as mentioned in Nordic DevZone article MACs have high order 2 bits set, i.e. first digit will always be C , D, E or F!
Please run hcitool lescan a little longer and report additional addresses.
Iāve had my tag for about a year and half. Is it possible that the battery is too low? It works on the Ruuvi app and is showing battery voltage of 2.9v.
I donāt know the Mac address, as the mobile app states that RAWv2 mode is required. Iām in the process of upgrading the firmware now, so that Iāll be able to get the MAC.
Guess I knew more technical terms than I thoughtā¦