-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command Disallowed 0xc causes a device to become unresponsive #59
Comments
It seems that this could be related to the fact that Rapsberry Pi bluetooth dongle doesn't allow scanning and sending a command at the same time |
It seems like Rapsbian and Pi can only support up to 5 devices (I have 4, with 2 other BTLE Xiomi thermometers). But according to noble/noble#260 it sometimes causes snafu. It seems that errors happen on certain attempts to reconnect. It seems that the problem with the coma-ctrl code is the fact that after an error occurs in
and then the next line happily printts "connected":
Instead it should "sleep" again and try to connect again. |
OK, I think I worked around my problem. Unfortunately, I'm not an Here's the log output of tthe successful reconnect:
And this is the modified connect method of SomaShade.js
(note the |
Ok the above seems to have made the
|
Right, in order to work around this, I am now running
Contents
|
Scanning and sending a command at once shouldn't be an issue since version 1.3.0, but if you have something else using the bluetooth hardware, then it's out of my control. It's been a known issue for noble that other processes using the bluetooth hardware, even other noble processes can see each other's state.
I'm in agreement about this... an error from the connect call should abort the rest, and schedule a re-connect; it definitely reads wrong / as an oversight. That said, I haven't personally experienced any issues like those you've described with 4 soma devices and no other processes using the bluetooth hardware, the somactrl process remains stable for multiple weeks at a time in my home, so... I'm a little hesitant to change anything, especially when I can't reproduce the initial failure -- though I suppose I could try to connect with more bluetooth devices concurrently to reproduce the issue. I have one Xiaomi thermometer, and previously tried using a homebridge plugin to expose it over MQTT but it's unfortunately not within range of my somactrl pi. From what I recall, that homebridge plugin used noble and conducted regular scans. I guess, let's start with... If you disable anything else using the BT hardware, do these issues persist? |
Yes, I have a https://www.home-assistant.io/components/mitemp_bt/ running in the background collecting stuff. So yes, that's where the cross-talk comes through. I put the somactrl on my NAS (with an intel bluetooth) chipset, and it does run more stabily... however it causes kernel panics due to a bluetooth module bug (https://www.spinics.net/lists/linux-bluetooth/msg80212.html) I just bought a CSR8510 chipset BLE 4.0 USB dongle (https://www.amazon.co.uk/dp/B073CF6993/) to move the somactrl to. I assume somactrl will work with |
@andersonshatch Yup, the CSR8510 separate dongle helped a lot (no issues in the last 2 days). Maybe it's worthwhile updating the README to state that running this on a separate bluetooth device from other services is useful as it may cause interference? |
Glad that helped! |
Got two devices set up on Rapsbian 18.04.
After a certain period of time, the following error occurs:
and earlier this happened to the other device:
After that, the particular affected device becomes completely unresponsive and stops reacting to MQTT or HTTP endpoint requests and the somactrl needs to be restarted.
I am not a nodejs wizz, but this seems like a case of a simple exception handling?
The text was updated successfully, but these errors were encountered: