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

[Help]: issue with setNotifyValue and isNotifying on android 13 after latest security update #599

Closed
1 task done
fitterfly-parth opened this issue Oct 3, 2023 · 22 comments
Labels
help Questions, help, observations, or possible bugs

Comments

@fitterfly-parth
Copy link

Requirements

  • I've looked at the README 'Common Problems' section

FlutterBluePlus Version

1.16.2

Flutter Version

3.13.5

What OS?

Android

OS Version

Android 13

Bluetooth Module

We are using Accu-chek instant.

What happened?

After updating the Os version setNotifyValue shows true in the log but it does not return any result and after some time it shows timeout.

Logs

D/[FBP-Android](11758): [FBP-Android] onMethodCall: getConnectedSystemDevices
D/[FBP-Android](11758): [FBP-Android] onMethodCall: connect
D/BluetoothGatt(11758): connect() - device: B0:B1:13:59:FA:01, auto: false, eattSupport: false
D/BluetoothGatt(11758): registerApp()
D/BluetoothGatt(11758): registerApp() - UUID=0e0b67b8-15a3-4a69-b4b7-08f2af4bf772
D/BluetoothGatt(11758): onClientRegistered() - status=0 clientIf=12
D/BluetoothGatt(11758): onClientConnectionState() - status=0 clientIf=12 device=B0:B1:13:59:FA:01
D/[FBP-Android](11758): [FBP-Android] onConnectionStateChange: status: 0 (SUCCESS) newState: connected
D/[FBP-Android](11758): [FBP-Android] onMethodCall: discoverServices
D/BluetoothGatt(11758): discoverServices() - device: B0:B1:13:59:FA:01
D/BluetoothGatt(11758): onConnectionUpdated() - Device=B0:B1:13:59:FA:01 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt(11758): onSearchComplete() = Device=B0:B1:13:59:FA:01 Status=0
D/[FBP-Android](11758): [FBP-Android] onServicesDiscovered: count: 4 status: 0
D/BluetoothGatt(11758): onConnectionUpdated() - Device=B0:B1:13:59:FA:01 interval=38 latency=0 timeout=500 status=0
D/[FBP-Android](11758): [FBP-Android] onMethodCall: setNotification
D/BluetoothGatt(11758): setCharacteristicNotification() - uuid: 00002a18-0000-1000-8000-00805f9b34fb enable: true
@fitterfly-parth fitterfly-parth added the bug Something isn't working label Oct 3, 2023
@fitterfly-parth
Copy link
Author

fitterfly-parth commented Oct 3, 2023

E/flutter (15536): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FlutterBluePlusException: setNotifyValue: (code: 1) Timed out after 15s
E/flutter (15536): #0      FutureTimeout.fbpTimeout.<anonymous closure> (package:flutter_blue_plus/src/utils.dart:57:7)
E/flutter (15536): #1      _RootZone.run (dart:async/zone.dart:1655:54)
E/flutter (15536): #2      Future.timeout.<anonymous closure> (dart:async/future_impl.dart:938:34)
E/flutter (15536): #3      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter (15536): #4      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (15536): #5      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (15536): #6      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

@chipweinberger
Copy link
Owner

chipweinberger commented Oct 3, 2023

After we call setCharacteristicNotification() (which just configures the android phone itself), we then update the CCCD descriptor on the remote device to enable notifications.

In other words, this might be a problem with your device.

  1. Is your device receiving the descriptor update?
  2. are there any more logs after "setCharacteristicNotification()"?

@fitterfly-parth
Copy link
Author

Screenshot 2023-10-06 at 2 43 42 PM

@chipweinberger
Copy link
Owner

chipweinberger commented Oct 6, 2023

your device is disconnecting. you are calling disconnect

@fitterfly-parth
Copy link
Author

fitterfly-parth commented Oct 6, 2023

I disconnect the device if there is any error and timeout occurs. Please check my code.

Screenshot 2023-10-06 at 2 52 32 PM Screenshot 2023-10-06 at 2 53 39 PM

@fitterfly-parth
Copy link
Author

I set timeout 30 seconds but it's Timed out after 15s only.

@chipweinberger
Copy link
Owner

  1. Is your device receiving the descriptor update?
  2. you are hitting the default timeout. you can change it setNotifyValue(true, timeout:30);

@chipweinberger
Copy link
Owner

try the example app

@fitterfly-parth
Copy link
Author

fitterfly-parth commented Oct 6, 2023

  1. Is your device receiving the descriptor update?
  2. you are hitting the default timeout. you can change it setNotifyValue(true, timeout:30);

When it's timeout it shows ERR on the device.

I don’t know why this happen now everything working fine before update I have one device which is running on Andorid 13 also without new update on this device everything working fine.

But only on latest updated version Android 13 it's not showing connection popup

Please guide me on this.

@chipweinberger
Copy link
Owner

Good luck. I have no special knowledge about this.

@chipweinberger
Copy link
Owner

try 1.16.10

@fitterfly-parth
Copy link
Author

fitterfly-parth commented Oct 9, 2023

Still not working.

Nothing happen after below line

onConnectionUpdated() - Device=B0:B1:13:59:FA:01 interval=38 latency=0 timeout=500 status=0

@chipweinberger
Copy link
Owner

try the example app?

@chipweinberger
Copy link
Owner

also try updating

@fitterfly-parth
Copy link
Author

I try 1.17.3 but still not working.

This issue occurs only for the Latest updated android device.

@chipweinberger
Copy link
Owner

chipweinberger commented Oct 11, 2023

What is your OS build number?

I cannot reproduce this issue on:

  • TQ3A.230805.001 (August 2023, Pixel 5a)
  • TQ3A.230901.001 (September 2023, Pixel 5a)

@chipweinberger
Copy link
Owner

Also, you've also filed an AOSP bug report I assume? Can you share the link?

@fitterfly-parth
Copy link
Author

What is your OS build number?

I cannot reproduce this issue on:

  • TQ3A.230805.001 (August 2023, Pixel 5a)
  • TQ3A.230901.001 (September 2023, Pixel 5a)

I have Oppo CPH2371 and it's build number is CPH2371_13.1.0.591(EX01) And second device is OnePlus 9Pro and it's build number is LE2121_13.1.0.591(EX01).

@fitterfly-parth
Copy link
Author

Also, it's working fine with Android Native code but not working with your plugin.

@chipweinberger
Copy link
Owner

chipweinberger commented Oct 12, 2023

We use native code as well.

Can you spot any differences in your native code vs ours?

Also, have you tried the example app?

cd ./example
flutter run

@chipweinberger
Copy link
Owner

bump.

@chipweinberger
Copy link
Owner

without more info, this cannot be fixed. closing.

@chipweinberger chipweinberger changed the title [Bug]: issue with setNotifyValue and isNotifying on android 13 after latest security update [Help]: issue with setNotifyValue and isNotifying on android 13 after latest security update Jan 4, 2024
@chipweinberger chipweinberger added help Questions, help, observations, or possible bugs and removed bug Something isn't working labels Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help Questions, help, observations, or possible bugs
Projects
None yet
Development

No branches or pull requests

2 participants