-
Notifications
You must be signed in to change notification settings - Fork 26
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
"Error: Failed to discover services and characteristics: DISCONNECTED" on Raspberry Pi 4 B #3
Comments
Thank you for your feedback. I checked the source code of the I replaced the |
Thank you for your quick response. I think the reliability has improved but I think the issue lies elsewhere. Initial connection errors occur in both examples, but the Python example seems to always complete the commands:
This leads me to believe there might some event handling difference in noble. I believe the major issue is with the hardware and Raspian though, the interference between Wi-Fi and Bluetooth seems to be common. Most of the errors occur while Homebridge is running using the Wi-Fi. At times Homebridge needs to be quit because the messages from |
The If you want to move the arm repeatedly, it is strongly recommended to call the const Switchbot = require('node-switchbot');
const switchbot = new Switchbot();
(async () => {
try {
const deviceList = await switchbot.discover({ model: 'H', quick: true });
const device = deviceList[0];
await device.connect();
await device.turnOn();
await switchbot.wait(5000);
await device.turnOff();
await switchbot.wait(5000);
await device.turnOn();
await switchbot.wait(5000);
await device.disconnect();
} catch(e) {
console.log(e);
}
process.exit();
})(); See the description of the methods in the README.md for more details. |
The following code runs without issue on macOS but on a Raspberry Pi 4 B running Raspbian Buster Lite (2020-02-05) the code usually fails after 1 or more commands:
The hcidump.log log shows the output from
sudo hcidump -t -x
when an exception was raised when running the finaldevice.turnOn
command.The issue is perhaps related to noble as other tools like
gatttool
do not appear to be affected. In my testing the issue can be mitigated somewhat by replacing calls todiscoverAllServicesAndCharacteristics
with discoverServices.The text was updated successfully, but these errors were encountered: