chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
791 stars 478 forks source link

[Help]: mtu request with 133 error code #852

Closed lorenzosfarra closed 7 months ago

lorenzosfarra commented 7 months ago

Requirements

Have you checked this problem on the example app?

Yes

FlutterBluePlus Version

1.32.1

Flutter Version

3.19.5

What OS?

Android

OS Version

14

Bluetooth Module

Nordic

What is your problem?

Hi,

I'm currently working on connecting to a BLE device manufactured by the same person who provided me with the documentation. According to the doc, I should request an MTU >= 32. He shared me some logs where he's setting the MTU to 50 and the device is connecting accordingly, from a dedicated PC software he wrote.

Using the example app for this lib (and logs are in fact from the example app), anyway, I get the logs attached in the dedicated section. I have just cleared a bit some warning repeated multiple times (wrote once and then replaced by [..many of these]) and set the scan timeout to 3 seconds instead of 15.

It seems that it tries to request 50 (await connect(mtu: 50)), it goes back to 23 and then it gets disconnected with the very annoying 133 error that all of us hate so much! :)

If I don't specify any MTU, then it gets connected with MTU 23 (that should be the default MTU chosen by Android), but then I can't write some values to the characteristic because of data longer than expected (with the suggestion to ask for a greater MTU), also with allowLongWrite set to true.

Could you please provide me with some insights on how to effectively debug this issue with the individual responsible for the hardware?

Thank you sincerely, Lorenzo

Logs

✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...
D/VRI[MainActivity](25938): Cancelling draw. cancelDueToPreDrawListener=true cancelDueToSync=false
D/VRI[MainActivity](25938): Cancelling draw. cancelDueToPreDrawListener=true cancelDueToSync=false
Debug service listening on ws://127.0.0.1:51578/ZMfPyi-pC2Q=/ws
Syncing files to device Pixel 6...
D/VRI[MainActivity](25938): Cancelling draw. cancelDueToPreDrawListener=true cancelDueToSync=false
[..many of these]
D/[FBP-Android](25938): [FBP] onMethodCall: flutterHotRestart
D/[FBP-Android](25938): [FBP] initializing BluetoothAdapter
D/CompatibilityChangeReporter(25938): Compat change id reported: 263076149; UID 10412; state: DISABLED
I/flutter (25938): [FBP] <setLogLevel> args: 5
D/[FBP-Android](25938): [FBP] disconnectAllDevices(flutterHotRestart)
D/[FBP-Android](25938): [FBP] connectedPeripherals: 0
D/[FBP-Android](25938): [FBP] onMethodCall: setLogLevel
D/VRI[MainActivity](25938): Cancelling draw. cancelDueToPreDrawListener=true cancelDueToSync=false
[..many of these]
I/flutter (25938): [FBP] <setLogLevel> result: true
I/flutter (25938): [FBP] <getAdapterState> args: null
D/[FBP-Android](25938): [FBP] onMethodCall: getAdapterState
D/VRI[MainActivity](25938): Cancelling draw. cancelDueToPreDrawListener=true cancelDueToSync=false
[..many of these]
I/flutter (25938): [FBP] <getAdapterState> result: {adapter_state: 4}
D/VRI[MainActivity](25938): Cancelling draw. cancelDueToPreDrawListener=true cancelDueToSync=false
[..many of these]
I/flutter (25938): [FBP] <getSystemDevices> args: null
D/[FBP-Android](25938): [FBP] onMethodCall: getSystemDevices
I/flutter (25938): [FBP] <getSystemDevices> result: {devices: []}
I/flutter (25938): [FBP] <startScan> args: {with_services: [], with_remote_ids: [], with_names: [], with_keywords: [], with_msd: [], with_service_data: [], continuous_updates: false, continuous_divisor: 1, android_scan_mode: 2, android_uses_fine_location: false}
D/[FBP-Android](25938): [FBP] onMethodCall: startScan
D/BluetoothAdapter(25938): isLeEnabled(): ON
D/BluetoothLeScanner(25938): onScannerRegistered() - status=0 scannerId=5 mScannerId=0
I/flutter (25938): [FBP] <startScan> result: true
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -56, connectable: 1, manufacturer_data: {76: 0c0e082b4702557bd82da9ca08d19dec1005411c827d9d}, remote_id: 7A:88:72:EA:E3:E5, service_data: {}}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -71, connectable: 1, appearance: 5184, manufacturer_data: {}, remote_id: DB:73:F8:69:51:28, platform_name: LINKY, service_data: {}, adv_name: LINKY}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -67, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -62, manufacturer_data: {224: 0064ca811c01}, remote_id: 45:85:85:32:2D:B0, service_data: {fe9f: 0000000000000000000000000000000000000000}, service_uuids: [fe9f]}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -64, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -64, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -71, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -70, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -97, manufacturer_data: {76: 12020001}, remote_id: D2:C2:63:B7:58:1F, service_data: {}}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -63, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -58, connectable: 1, manufacturer_data: {}, remote_id: FD:02:C2:73:BB:DE, platform_name: Charge 4, service_data: {180a: 30046e5e01}, adv_name: Charge 4, service_uuids: [abbaff00-e56a-484c-b832-8b17cf6cbfe8]}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -64, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -96, connectable: 1, manufacturer_data: {76: 1006331d7259d078}, remote_id: 73:72:CF:54:70:4C, tx_power_level: 12, service_data: {}}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -67, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -64, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -66, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -75, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -68, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -63, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -63, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -65, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -64, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -67, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -94, manufacturer_data: {76: 160800b73f4507b821b0}, remote_id: 62:68:F3:45:35:4A, service_data: {}}]}
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -67, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -67, connectable: 1, manufacturer_data: {117: 420401207e17050000000000000000000000000000000000}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
D/[FBP-Android](25938): [FBP] onScanResult
I/flutter (25938): [FBP] <stopScan> args: null
D/[FBP-Android](25938): [FBP] onMethodCall: stopScan
D/BluetoothAdapter(25938): isLeEnabled(): ON
I/flutter (25938): [FBP] [[ OnScanResponse ]] result: {advertisements: [{rssi: -67, connectable: 1, manufacturer_data: {117: 420401017e641cb00a91c1661cb00a91c00137041e860a22}, remote_id: 64:1C:B0:0A:91:C1, platform_name: [TV] Samsung 6 Series (49), service_data: {}, adv_name: [TV] Samsung 6 Series (49)}]}
I/flutter (25938): [FBP] <stopScan> result: true
I/flutter (25938): [FBP] <connect> args: {remote_id: DB:73:F8:69:51:28, auto_connect: 0}
D/[FBP-Android](25938): [FBP] onMethodCall: connect
D/CompatibilityChangeReporter(25938): Compat change id reported: 265103382; UID 10412; state: DISABLED
D/BluetoothGatt(25938): connect() - device: DB:73:F8:69:51:28, auto: false
D/BluetoothGatt(25938): registerApp()
D/BluetoothGatt(25938): registerApp() - UUID=6cafb172-5fec-4108-b648-b42f3381627f
D/BluetoothGatt(25938): onClientRegistered() - status=0 clientIf=7
W/WindowOnBackDispatcher(25938): OnBackInvokedCallback is not enabled for the application.
W/WindowOnBackDispatcher(25938): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
I/flutter (25938): [FBP] <connect> result: true
D/BluetoothGatt(25938): onClientConnectionState() - status=0 clientIf=7 device=DB:73:F8:69:51:28
D/[FBP-Android](25938): [FBP] onConnectionStateChange:connected
D/[FBP-Android](25938): [FBP]   status: SUCCESS
I/flutter (25938): [FBP] [[ OnConnectionStateChanged ]] result: {disconnect_reason_code: 0, disconnect_reason_string: SUCCESS, remote_id: DB:73:F8:69:51:28, connection_state: 1}
I/flutter (25938): [FBP] <requestMtu> args: {remote_id: DB:73:F8:69:51:28, mtu: 50}
D/[FBP-Android](25938): [FBP] onMethodCall: requestMtu
D/BluetoothGatt(25938): configureMTU() - device: DB:73:F8:69:51:28 mtu: 50
I/flutter (25938): [FBP] <requestMtu> result: true
D/BluetoothGatt(25938): onConnectionUpdated() - Device=DB:73:F8:69:51:28 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt(25938): onConnectionUpdated() - Device=DB:73:F8:69:51:28 interval=36 latency=0 timeout=500 status=0
D/BluetoothGatt(25938): onConfigureMTU() - Device=DB:73:F8:69:51:28 mtu=23 status=133
E/[FBP-Android](25938): [FBP] onMtuChanged:
E/[FBP-Android](25938): [FBP]   mtu: 23
E/[FBP-Android](25938): [FBP]   status: UNKNOWN_GATT_ERROR (133) (133)
D/BluetoothGatt(25938): onClientConnectionState() - status=19 clientIf=7 device=DB:73:F8:69:51:28
D/[FBP-Android](25938): [FBP] onConnectionStateChange:disconnected
D/[FBP-Android](25938): [FBP]   status: REMOTE_USER_TERMINATED_CONNECTION
D/BluetoothGatt(25938): close()
D/BluetoothGatt(25938): unregisterApp() - mClientIf=7
I/flutter (25938): [FBP] [[ OnMtuChanged ]] result: {error_string: UNKNOWN_GATT_ERROR (133), success: 0, remote_id: DB:73:F8:69:51:28, error_code: 133, mtu: 23}
I/flutter (25938): [FBP] <readRssi> args: DB:73:F8:69:51:28
I/flutter (25938): [FBP] [[ OnConnectionStateChanged ]] result: {disconnect_reason_code: 19, disconnect_reason_string: REMOTE_USER_TERMINATED_CONNECTION, remote_id: DB:73:F8:69:51:28, connection_state: 0}
D/[FBP-Android](25938): [FBP] onMethodCall: readRssi
E/flutter (25938): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(readRssi, device is disconnected, null, null)
E/flutter (25938): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (25938): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (25938): <asynchronous suspension>
E/flutter (25938): #2      FlutterBluePlus._invokeMethod (package:flutter_blue_plus/src/flutter_blue_plus.dart:599:13)
E/flutter (25938): <asynchronous suspension>
E/flutter (25938): #3      BluetoothDevice.readRssi (package:flutter_blue_plus/src/bluetooth_device.dart:366:7)
E/flutter (25938): <asynchronous suspension>
E/flutter (25938): #4      _DeviceScreenState.initState.<anonymous closure> (package:flutter_blue_plus_example/screens/device_screen.dart:45:17)
E/flutter (25938): <asynchronous suspension>
E/flutter (25938):
chipweinberger commented 7 months ago

unfortunately no good solution that I know of.

you can try googling for "ble sniffer", "ble packet capture", etc. If you can get access to the raw ble data thats ideal. I've never done that before though.

REMOTE_USER_TERMINATED_CONNECTION - this log means the BLE peripheral is very unhappy, and is deciding to end the connection

chipweinberger commented 7 months ago

closing