Open TancredeJean opened 2 months ago
Does this charcateristic actually support notifications? You can tell by running the service explorer example.
And I would suggest logging Bluetooth packets (see troubleshooting page in the docs) to see what the device is actually doing.
Description
What I Was Trying to Achieve:
I was attempting to use the Bleak library to establish a connection with a Bluetooth Low Energy (BLE) device and enable notifications for a specific characteristic. My goal was to receive real-time data from the device via BLE notifications.
What Happened:
When trying to start notifications for the BLE characteristic, I encountered the following error:
OSError: [WinError -2140864509] The attribute cannot be written
What Went Wrong:
The specific error [WinError -2140864509] The attribute cannot be written suggests that the system encountered an issue while trying to write to the characteristic attribute. This prevents the Bleak client from successfully enabling notifications.
What I Expected to Happen:
I expected the Bleak client to successfully enable notifications for the specified characteristic and start receiving real-time data. The notification handler should be called whenever new data is available from the BLE device.
What I Did
Logs
Additional Attempts
I have also tried using the following during the initialization of the Bleak client to disable cached services:
Unfortunately, this did not solve the issue.