-
Notifications
You must be signed in to change notification settings - Fork 318
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
iOS: Warning! No event channel set up to report a connection update, notifications not working #385
Comments
hmm this looks like a bug (thanks for the elaborate example btw). Can you try to add a small delay (500ms) as a workaround before subscribing to the notifications? It feels like a race condition. |
Thanks for the feedback! I initially tried subscribing immediately after the connection was established. Now, I'm subscribing on a button press which is typically seconds after the connection is established in case there needed to be a delay after the connection is made for services to be discovered. This didn't work either. Do you think the "no event channel" warning is related to the fact that notifications are not being received, or a separate issue? I also had an issue ($360) where writeCharacteristicWithoutResponse didn't work on iOS so I changed it to WithResponse as a workaround. Not sure if this could be related or not... |
I've also been observing the "Warning! No event channel set up to report a connection update" warning on ios. The warning appears as soon as the connectTo command is invoked. Connecting works fine, however the ConnectionStateUpdate.Connecting event is never added to the stream. This is ONLY the case for the first device I connect to after an app restart. Second, third nth device all work as expected. Notifications, reading and writing characteristics are not affected by this warning after a connection has been established and this behaviour is not present on android. Smartphone / tablet Device: iPhone7 |
I checked and I only get this warning on the first connection after installing the app, the same as @mwernsen . It does not occur on the 2nd connection. I've also found that readCharacteristics are also not working in addition to notifications. Both work in the Android version and on iOS using nRF Connect. I have try and catch blocks around both reads and subscriptions but do not get any error messages. |
I'm using Catalina OS so I'm limited to Xcode v12.4. I saw that v4.0.1 is for Xcode 13 so I changed back to version 4.0.0 of flutter_reactive_ble but this didn't make any change. I also tried using v4.0.1 with a dependency_override for reactive_ble_mobile to '4.0.0'. The log messages on iOS are much more sparse than Android but I can't find a way to turn them on in Xcode. Any suggestions for further digging? Thanks! |
Similar to characteristic values, queue up discovery messages until sink is ready Closes PhilipsHue#385
I've attached a console log that covers the time from connection to disconnection: I notice several things:
But my peripheral has a UUID 2A05 in the embedded code but no UUID 2A05 is actually present. Is this missing char enough to cause reads and notifies to not work when writes do?
error 11:33:18.927306-0300 bluetoothd Remote sides asks for a timeout of more than 6 seconds, this is not very user friendly - refusing
default 11:33:13.163067-0300 bluetoothd statedump: 0x0026 Characteristic [ valueUUID: 0xFFF4, valueHandle: 0x0027, properties: notify, discoveredDescriptors: all ]
default 11:33:39.073188-0300 bluetoothd Subscribing to updates of characteristic handle 0x0026 on device ""
Thanks for any hints! |
I have the exact same issue. Which is quite annoying, because I need to read a characteristic after I connect ... Device: iPhone 8 Does anyone found a workaround ? |
Hi Gaelle, because of this issue I changed to flutter_blue_plus for the iOS version. It's not my preferred solution to use different packages for Android and iOS! |
I actually mannage to read the characteristic now ! I realise that i needed to use 16 bit ID and NOT 128 bits ID (which worked in Android!), the read on 128 bit ID were causing infinite read with no answer but no error either. With 16 bit characteristic id (the same you got when you do discover characteristics), it worked fine :) |
@remonh87 I'm still experiencing this issue with the v5.0.2 package. On iOS, I get the following error message for the first connection: The The library works correctly for subsequent connections. It's only the first connection on iOS that triggers this bug. |
This seemed to work for me. For some reason, it gave the above unhelpful errors. It doesn't like things in the format '180f', such as when passing |
I've tested it both with Android and IOS.
And then later I call that string with Uuid.parse : |
this thread is amazing! thank you to @GaelleJoubert for the insight! for reference I dont know if it has been updated since then but for me only 16bit works for both service and characteristic. For android and IOS it works being 16bit too so its perfect! Thank you all for your help! |
I am also seeing this error message, and failing to stay connected for more than a ~0.5 seconds. #728 Is the the 16-bit UUID relevant to me? I am not reading or writing a characteristic yet. Just trying to stay connected! |
getting this error also. if I re-run / hot reload the app then I do get 1 update on the listen of the connection. the handleConnectionState method never gets called on the first try and only gets called once the second time I try to connect. I never get the update that the device is connected. This is my code
|
Describe the bug
I get a "Warning! No event channel set up to report a connection update" when trying to connect on iOS. The warning is not present on Android with similar code (on Android I use connectToAdvertisingDevice and on iOS connectTo).
On Android, I can successfully subscribe to a notification. On iOS, I do not receive any notifications. I'm not sure if this warning is related to the notification issue or not. I can successfully connect, read and write on iOS (although I had to change from writeWithoutResponse to writeWithResponse, as others have suggested).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should connect without the warning as it does on Android.
Smartphone / tablet
Peripheral device
Additional context
The missing notifications on iOS work on Android and also using nRF Connect.
The text was updated successfully, but these errors were encountered: