Open kurogalaxy opened 7 months ago
Hi @kurogalaxy, Thank you for raising this question. We will review it and get back to you soon.
Yes, we currently have a problem with the onDisconnect listener, especially when the disconnection is initiated from the BLE device, we are working on it.
If you have called functions for:
Could you show:
I got the current issue now. when I sync data from my BLE device, the BLE device send data to the app(Android) the progress take arround 10 - 30 second. But in the latest version 3.1.2 It's fire disconnection event in this case. I'm not sure it is the same case. look like when the BLE device do some busy task. that make the library fire disconnect event
same happening to me after updating from 2.0.3 to 3.1.2 on Android, module fires disconnected event a few seconds after connecting.
for me it basically disconnects after the timeout period, despite it actually connecting successfully and I can send and receive data fine before it happens. E.g. below will connect fine for 30 seconds then disconnect for no reason.
const connectedDevice = await this.manager.connectToDevice(device.id, {
timeout: 30000
});
I have the same problem, in my case iOS works fine, but Android disconnects.
@fustaro, @ex3ndr, @nhaduongc Thanks for your patience; we'll need a bit more time to get back to you with a solution.
Same problem here. When I try char.writeWithResponse, it fails randomly telling me that device has been disconnected. IOS and Android
Is there any progress here ? I am also experiencing a disconnect after writing and leading several characteristics (so somehow a heavy read). Unfortunately i have to write a little piece of data after each connect.
Any update on this issue?. I could make it work putting a small delay (around 50ms) before sending every chunk of data, it happens to me with the writeWithResponse call.
Any update on this issue? The same issue, disconnects after 20-30 seconds on Android.
Prerequisites
Question
After scanning and connecting the device, I call the following
await plxBleManager .writeCharacteristicWithoutResponseForDevice( deviceId, serviceUUIDs.server, serviceUUIDs.write, data, ) .then(algo => { console.log('Write successful'); }) .catch(error => { console.log('Error', error); });
The first time I run the code I get the 'write successful' text but second time returns a
[BleError: Device D8:3A:DD:83:AE:DC is not connected]
I also have the following method but it won't return anything at all
const onDisconnect = (device: Device) => { device.onDisconnected(error => { console.log('device was disconnected', error); }); };
Am I missing something? Do I need to call another method before doing every write? I'd really appreciate any help.
Testing on Android 13.