Closed SlavaInstinctools closed 4 years ago
Unfortunately, the best way to solve that issue is to sniff actual transmission and check if connection parameters are violated. There is a guide how to do it here: https://www.polidea.com/blog/bluetooth-low-energy-sniffing-guide/.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Found solution for me. Last message: https://lists.apple.com/archives/bluetooth-dev/2013/Apr/msg00154.html
@rhakh , do you mean everything is about 2.4GHz interference?
@ekrivenja-sequenex Yes. BLE and Wi-Fi (2.4 ghz) works on the same frequency. Try to find “clear” space and try again to connect devices.
Hi @SlavaInstinctools, I am experiencing the same issue with random Bluetooth disconnections on iOS. Have you found any solution to this problem?
I'm not sure, that is a bug in this library, but I would like to find any information or opinion, that can help!
Prerequisites
I connect a peripheral device to a phone (ios/android) and then get a large amount of data from the device using notifications. (Stream this data by subscribing on one of the characteristics - device.monitorCharacteristicForService). As the device, I use an emulator on "bleno" library.
Expected Behavior
I need no automatic and unexpected disconnects on IOS if the connection is good (signal and so on). As currently in android - everything is fine.
Current Behavior
Stably disconnections on IOS in 1-2 minutes after connection. Connection time until disconnect is random but as rule max is 2 minutes. On android everything is okay and the connection is not interrupted and there are not any disconnects.
By the way, I saw similar behavior with my Mi Band 4 and the official app on IOS. On Android, everything is okay too.
Steps to Reproduce
There are two situations:
1) Just connect a peripheral device to the IOS device (bleManager.connectToDevice, bleManager.discoverAllServicesAndCharacteristicsForDevice) and wait. In 1-2 minutes device will be disconnected automatically (device.onDisconnected listener get device object and error = null) with next logs:
2) Connect to a device, subscribe to notifications and start streaming data from device to phone. Then in 1-2 will be a disconnect. For example, here I managed to get 712 notifications and then there is an unexpected disconnect (device.onDisconnected listener get device object and error = null):
Sometimes I can get 2500 notifications without disconnects, but it's a really rare situation...
Context
I tried finding something on the internet by this error code and message and found next:
1) https://stackoverflow.com/questions/32588325/ios-bluetooth-le-code-6-the-connection-has-timed-out-unexpectedly 2) https://devzone.nordicsemi.com/f/nordic-q-a/9224/ios-8-disconnection-code-6-the-connection-has-timed-out-unexpectedly 3) https://github.com/innoveit/react-native-ble-manager/issues/555
Looks like it's some problem or feature of apple devices, but I believe that there is a solution because it's really strange. I'm not so good at the BLE topic and probably missed some important detail and as a result, have this situation with disconnects on IOS.
But I believe that there is someone who knows what to do or had this situation too! And wait for your help or opinion :)