Skip to content
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

Intermittent Read Failure Leading to Automatic Disconnection with flutter_reactive_ble #846

Open
loziobrown opened this issue Feb 19, 2024 · 1 comment

Comments

@loziobrown
Copy link

Environment:

Device: Samsung Tablet running Android 13
Peripheral: NINAB31 module
Flutter version: 3.16.9
flutter_reactive_ble version: 5.3.1

Issue Description:

I am encountering an intermittent issue where reading from a characteristic using the flutter_reactive_ble library occasionally results in an error, followed by an automatic disconnection from the BLE device. This issue does not occur consistently but seems to arise sporadically during characteristic reads.
Error Message:
Error reading characteristic: 9006: Exception: GenericFailure<CharacteristicValueUpdateError>(code: CharacteristicValueUpdateError.unknown, message: "GATT exception from MAC address 6C:1D:EB:32:36:66, with type BleGattOperation{description='CHARACTERISTIC_READ'}")

After this error is logged, the BLE device disconnects automatically.

Additional Context:

The issue seems to occur randomly during characteristic reads.
When the error occurs, if I attempt to read the same characteristic using a different BLE scanner tool, the read operation succeeds without any issues.
This leads me to believe that the issue might be related to how flutter_reactive_ble handles read operations or manages connections under certain conditions.

Potential Solution (maybe):
I am wondering if implementing a read timeout or providing a retry mechanism within the flutter_reactive_ble library might mitigate this issue. Such a feature could allow the application to attempt the read operation again before considering it a failure and disconnecting.

@xvrh
Copy link
Contributor

xvrh commented May 17, 2024

@loziobrown wondering if you've found a solution/workaround for this?
We also have some intermittent disconnection after characteristic (write in our case). We have no clue if the problem is in the firmware or the smartphone. But it only does that on Android devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants