Raspbian Bookworm
HA Core 2924.9.3
Frontend 20240909.1
Switchbot Integration (not sure how to get the version)
Pi Model 3B (yes old but perfectly suitable for running HA - apart from BLE!)
Rather frustrating this,
I have a number of Switchbot BLE Meter Plus devices that keep going offline/disabled in HA yet they are still working and can be detected by my Windows 10 PC and read using SW so the issue is Power supply, Pi hardware, Raspbian, bluetooth, HA or Switchbot integration. I have no idea where to start.
So when I power on the Pi, all is fine. After a couple of days maybe a day, the devices go “offline” in HA in that they are available but not being updated, disable, or both.
My competence is limited, but I have figured out that I can use the command line for lmited debug…
If I run hcitool -i hci0 lescan I get an inpout/output error
If I run hciconfig hci0 down then hciconfig hci up then hcitool -i hci0 lescan then I see the list of MAC addresses, some of the sensors in HA come back online although some of those are disabled and I have to reenable them in the integration. The system now works, for day or two, then I have to repeat.
Can I automate this up/down every day to reset bluetooth, or better, is it possible to work out what is going on and fix the root cause?
No I have not seen widespread BLE issues reported since September (your version) but…
(and I totally know it’s not what you want to hear)
given memory consumption patterns on versions of HA since last February - I strongly believe your statement is barely correct anymore. I’ve seen TONS of reports that can be anecdotally attributed to low memory conditions causing issues. …Like you see on ALL Pi3 and early Pi4.(basically the 1GB RAM setups)
That’s not particularly nice statement. allow me to reciprocate…
I’m reasonably competent as a software developer … written device drivers for Linux and Xwindow apps… I fully understand the operating system underneath home assistant and all the various concepts and nuances. from a strictly software context of course. I’m confident the issue is hardware … potentially interference or perhaps flaky Bluetooth chips in this particular model of pie. I guess this is what I’m looking for some anecdotal support. and I remain unconvinced this is a homeassistant or an integration issue having looked at the source code, in the context of comparisons with OS reported statistics.
Your assertion is less than barely correct! Low memory is not a problem so the TONS of reports you have read and attributed through detail analysis of course to low memory (by the way that must have took you several months and years) are not something I recognise . looking into the statistics reported in the live /sys file system I disagree with your statement.
however I’m not a hardware engineer and I guess this is what I’m trying to elicit some further comment on… but thanks anyway
For other more serious commenters I would be interested to hear about perceptions on potential 2.4 Wi-Fi band interference I’m going to use some external USB dongles or equipment.
EDIT
I ANSWER MY OWN QUESTION I DON’T THINK THIS IS HOME ASSISTANT PROBLEM …IT’S MORE OF A PI HARDWARE ISSUE
You can feel free to disagree. I’m not trying to be nice I’m trying to be honest.
Ive been on this community site every single day for four years.
Dev. Ok cool. Here’s what’s up.
Approximately last June we started seeing people put up a lot of strange issues that usually are attributed to long slow memory leaks.
What I strongly suspect is going on is.
They changed memory handling for the databases in Feb to fix a lot of long running efficiency and stability issues. Trade off is memory. There are git notes from that time about same. And this is when they made the decision to not support pi 2.anymore (note supported install doesn’t list it anymore and there’s a dev note on low mem pi on the installation page)
Same machine post Feb running a build post 2024.2 has approximately 1/3 more memory use by default.
Next enter any memory leak. Not necessarily BT any. (we never see memory leaks in HA, sarcastically he laughs…)
So what I’m more than 70% sure you’re fighting is a memory leak in an unrelated component causing memory pressure in an already compressed memory condition. If reboot clears it and it takes a few days to surface its that or you’re hitting some oddball routine once in a forever to lock it up. My money is on memory.
So start there and have fun troubleshooting, or don’t. Troubleshooting isn’t about nice it’s about following what the data is telling you and application of known conditions. You are in a low memory condition from boot.
I am sure this is a Pi3 issue not HA but just checking…
My bluetooth works perfectly then fails after a few days.
Logging into raspbian and trying to reset the hci0 device does nothing, the device isnt seen. A whole raft of online guides about reinstalling pi-bluetooth and other stuff just doesnt fix the problem.
The only fix is a reboot, then it works again - for a few days.
Is this a common problem and would a USB bluetooth dongle fix the issue and if so what is the name of a well considered robust USB dongle product please?
is that the diagnosed fault or ra guess? i ask because I’m using the pifactory supply unit and do not get any under voltage errors from the kernel.
what is your analysis based on please?
There have been a number of zwave usb issues with PI that were the result of undervoltage. Since you seem to be having a hardware or kernel device issue it is a possibility.
Multiple threads about how the Pi power bus works max power is usb amperage and too many devices cause issues.
Use a powered usb hub to prevent that issue.
Also things you may run into. Relative load on a pi3 can cause other random issues. Depends on. How much load you actually have on the box. Builds since last Feb have increased memory utilization.
Id try powered usb hub first. It’s the cheapest and easiest. But I don’t think it’s that.
PeteRage just mentioned Z-Wave as an example.
All RPis have a hardware design that cause issues with power, because the input power circuit is so limited in its effectiveness that it can actually not power both the RPi and a basic USB setup.
Two radio sticks can be enough to push it over the limit, so you will always see powered USB hubs being suggested as the first step to solve this situations.
You might have been running the set up for a longer period without issue, but HA grows and require more power (so tend the users HA setup also to do. ), and electric circuits also get worn so they require more power to achieve the same as before.
With normal computers the design is oft with a good surplus of power, so you do not experience that wear. With RPi you do eventually.
Electronic components is chemistry and chemistry gets affected by adding power to it.
When choosing electronic components you look at tolerance and reliability for those parts.
Most designers only look at those values for the production time, but they change over time.
Designers can ignore the change over time by choosing to have a big enough tolerance in their design and choose components with reliance that give them room to drift.