Scrin / RuuviCollector

Utility to collect measurements from RuuviTags and store them in InfluxDB
MIT License
125 stars 62 forks source link

RuuviCollector gives up after BT HW error #42

Closed laiti closed 4 years ago

laiti commented 4 years ago

Every time this appears in dmesg, RuuviCollector stops collecting data: [ke marras 27 20:51:50 2019] Bluetooth: hci0: hardware error 0x43. The process itself does not crash, it is still there but nothing appears in logs about the situation.

Scrin commented 4 years ago

What hardware & OS are you using? And when this happens, can you see a hcitool and a hcidump process running in addition to the collector process?

laiti commented 4 years ago

I’m running Raspbian 9.11 on Raspberry Pi 3. The situation is not easy to catch as it happens only once a week or so. But I'll add a process logger to investigate the situation.

laiti commented 4 years ago

Finally catched this one. Here's output from my ruuvi restart script:

[Wed Jan  1 01:55:18 2020] Bluetooth: hci0: hardware error 0x19

ps -fu ruuvi:
UID        PID  PPID  C STIME TTY          TIME CMD
ruuvi    29200     1  0  2019 ?        03:10:46 /usr/bin/java -jar ruuvi-collector-0.2.jar
ruuvi    29218 29200  0  2019 ?        00:00:00 hcitool lescan --duplicates --passive
ruuvi    29220 29200  0  2019 ?        00:35:17 hcidump --raw

HW error, restarting ruuvi.service at Wed Jan  1 01:56:01 EET 2020
Scrin commented 4 years ago

Hmm, so it seems neither hcitool nor hcidump crashes/exits when this happens, which makes it hard to reliably detect this error from within the collector as I don't want to add dependencies to dmesg as normal users can't access it on a properly secured system.. either way that'd be a workaround for a problem somewhere else; the real solution would be figuring out why the bluetooth gets those hardware errors. One possible cause for that is a bad power supply that doesn't supply stable enough voltage, as there's almost no voltage regulation on the RPi itself

laiti commented 4 years ago

Hmm, ok. I could switch to official RP power source and see if this still happens.