Open raphmur opened 1 week ago
I think hcitool is required to reset the adapter but I'm not positive. [edit] I tried to install it but the container image can't find bluez-tools package.
Also... do you have HAOS 12.4 ? Someone reported bluez is stable like it hasn't been in a long time. I wonder if the failure is due to a bad driver.
Could not reset the power state of the Bluetooth adapter hci0 [E4:5F:01:D9:EC:B5] due to timeout after 5 seconds
Can you run the command w/ a 60 seconds timeout and see if it succeed to "reset" the adapter? Unclear what "reset power state" means, perhaps it's a power off / on ?
I wasn't able earlier to find the source for 12.4 that might fix some Bluetooth issue, here it is:
Ok thanks, I'll try
Found an app already in the container to reset the controller, it fails and my guess is that HAOS doesn't give access to the device .. in write mode?! I'm unclear on this, see below the output.
# bluemoon -h
bluemoon - Bluemoon configuration utility
Usage:
bluemoon [options]
Options:
-A, --bdaddr [addr] Set Bluetooth address
-F, --firmware [file] Load firmware
-C, --check <file> Check firmware image
-R, --reset Reset controller
-B, --coldboot Cold boot controller
-E, --exception Trigger exception
-i, --index <num> Use specified controller
-h, --help Show help options
c81b838b-tesla-local-commands:/data# bluemoon -R
Bluemoon configuration utility ver 5.76
Failed to open HCI user channel
c81b838b-tesla-local-commands:/data# bluemoon -B
Bluemoon configuration utility ver 5.76
Failed to open HCI user channel
I am facing this when running the presence detection...:
I think I had two processes using the bluetooth device at the same time. Which failed and caused the bluetooth adapter to crash. Then the main loop hanged waiting for bluetooth feedback.
Any idea? I would suggest to set a timeout in the call to
bluetoothctt
and if this fails more than 3 times: restart the adapter (if possible).@baylanger ?