rohitsangwan01 / win_ble

WinBle Plugin to use Bluetooth Low Energy in Flutter Windows Desktop
MIT License
35 stars 15 forks source link

Windows 10 error #33

Open ffamar opened 11 months ago

ffamar commented 11 months ago

win_ble 1.0.2 (same issue with version 1.0.1) flutter 3.16.4 (No issues) OS Name Microsoft Windows 11 Pro - Version 10.0.22621 Build 22621 (Issue) OS Name Microsoft Windows 10 Pro - Version 22H2 Build 19045.3803

We have two different behaviors if the application runs on Windows 10 or Windows 11. The application runs smoothly on Windows 11, but in Windows 10 it gets an "Unspecified error. 3 Required characteristic not found" during the write and subscribe command. Below the logs (the error appears translated into Italian because Windows is set to Italian). We have also tried on other computers with Windows 10 and 11 and the behaviour is always the same. Thanks in advance.

Windows 11 log (with no issue):

flutter: DEBUG - 2023-12-15 10:20:42.540147   Instance of 'BleClientConnectionStateUpdateEvent'
flutter: Received Message : {_type: response, _id: 0, result: BluetoothLE#BluetoothLE60:e3:2b:e9:2d:3d-0c:8b:95:77:10:ca}
flutter: Received Message : {_type: response, _id: 1, result: [{00001801-0000-1000-8000-00805f9b34fb}, {00001800-0000-1000-8000-00805f9b34fb}, {0000faf0-0000-1000-8000-00805f9b34fb}]}
flutter: DEBUG - 2023-12-15 10:20:44.351165   Instance of 'BleClientConnectionStateUpdateEvent'
flutter: DEBUG - 2023-12-15 10:20:44.352165   Get hello
flutter: DEBUG - 2023-12-15 10:20:44.352165   Send SET: Instance of 'HelloRequest'
flutter: Received Message : {_type: response, _id: 4, result: null}
flutter: Received Message : {_type: response, _id: 2, result: 1}
flutter: Received Message : {_type: valueChangedNotification, subscriptionId: 1, value: [1, 1, 161, 2, 0, 0, 0, 0, 0, 0, 9, 0, 1, 0, 229, 58, 8, 0, 1, 4, 0]}
flutter: {address: 0c:8b:95:77:10:ca, serviceId: 0000faf0-0000-1000-8000-00805f9b34fb, characteristicId: 0000faf2-0000-1000-8000-00805f9b34fb, value: [1, 1, 161, 2, 0, 0, 0, 0, 0, 0, 9, 0, 1, 0, 229, 58, 8, 0, 1, 4, 0]}
flutter: DEBUG - 2023-12-15 10:20:44.605119   HelloResponse decode
flutter: DEBUG - 2023-12-15 10:20:44.606125   Get setting info
flutter: DEBUG - 2023-12-15 10:20:44.607123   Send SET: Instance of 'GetSettingsInfoRequest'
flutter: Received Message : {_type: valueChangedNotification, subscriptionId: 1, value: [1, 1, 17, 51, 87, 0, 0, 0, 0, 36, 146, 0, 0, 0, 255, 255, 4, 8, 1, 255, 100, 0, 0, 9, 9, 9, 9, 1, 255, 100, 0, 0, 9, 9, 9, 9, 1, 255, 100, 0, 0, 9, 9, 9, 9, 2, 9, 100, 0, 0, 7, 9, 9, 9, 0, 0, 26, 186, 122, 101, 24, 0, 24, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 0, 7, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 1, 7, 1, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 2, 7, 2, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 3, 7, 3, 0, 0, 1, 0, 0, 26, 186, 122, 101, 25, 0, 25, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 28, 0, 28, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 6, 0, 6, 0, 0, 0, 1]}
flutter: {address: 0c:8b:95:77:10:ca, serviceId: 0000faf0-0000-1000-8000-00805f9b34fb, characteristicId: 0000faf2-0000-1000-8000-00805f9b34fb, value: [1, 1, 17, 51, 87, 0, 0, 0, 0, 36, 146, 0, 0, 0, 255, 255, 4, 8, 1, 255, 100, 0, 0, 9, 9, 9, 9, 1, 255, 100, 0, 0, 9, 9, 9, 9, 1, 255, 100, 0, 0, 9, 9, 9, 9, 2, 9, 100, 0, 0, 7, 9, 9, 9, 0, 0, 26, 186, 122, 101, 24, 0, 24, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 0, 7, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 1, 7, 1, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 2, 7, 2, 0, 0, 1, 0, 0, 26, 186, 122, 101, 7, 3, 7, 3, 0, 0, 1, 0, 0, 26, 186, 122, 101, 25, 0, 25, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 28, 0, 28, 0, 0, 0, 1, 0, 0, 26, 186, 122, 101, 6, 0, 6, 0, 0, 0, 1]}
flutter: Received Message : {_type: response, _id: 3, result: 2}
flutter: Received Message : {_type: response, _id: 5, result: null}
flutter: Received Message : {_type: valueChangedNotification, subscriptionId: 1, value: [1, 1, 161, 2, 1, 0, 0, 0, 3, 0, 36, 0, 1, 0, 5, 1, 0, 0, 2, 0, 171, 1, 0, 0, 2, 0, 227, 0, 0, 0, 1, 0, 108, 0, 0, 0, 2, 0, 188, 0, 0, 0, 1, 0, 64, 0, 0, 0]}
flutter: {address: 0c:8b:95:77:10:ca, serviceId: 0000faf0-0000-1000-8000-00805f9b34fb, characteristicId: 0000faf2-0000-1000-8000-00805f9b34fb, value: [1, 1, 161, 2, 1, 0, 0, 0, 3, 0, 36, 0, 1, 0, 5, 1, 0, 0, 2, 0, 171, 1, 0, 0, 2, 0, 227, 0, 0, 0, 1, 0, 108, 0, 0, 0, 2, 0, 188, 0, 0, 0, 1, 0, 64, 0, 0, 0]}
flutter: DEBUG - 2023-12-15 10:20:44.645242   GetSettingsInfoResponse decode
flutter: DEBUG - 2023-12-15 10:20:44.677927   Send SET: Instance of 'MonitorEnableRequest'
flutter: Received Message : {_type: response, _id: 6, result: null}
flutter: Received Message : {_type: valueChangedNotification, subscriptionId: 1, value: [1, 1, 161, 2, 2, 0, 0, 0, 9, 0, 0, 0]}
flutter: {address: 0c:8b:95:77:10:ca, serviceId: 0000faf0-0000-1000-8000-00805f9b34fb, characteristicId: 0000faf2-0000-1000-8000-00805f9b34fb, value: [1, 1, 161, 2, 2, 0, 0, 0, 9, 0, 0, 0]}
flutter: DEBUG - 2023-12-15 10:20:44.844795   MonitorEnableResponse decode
flutter: DEBUG - 2023-12-15 10:20:48.869576   AppLifecycleState.inactive
flutter: DEBUG - 2023-12-15 10:20:52.536680   Send SET: Instance of 'KeepAliveRequest'
flutter: Received Message : {_type: response, _id: 7, result: null}
flutter: Received Message : {_type: valueChangedNotification, subscriptionId: 1, value: [1, 1, 161, 2, 3, 0, 0, 0, 2, 0, 0, 0]}
flutter: {address: 0c:8b:95:77:10:ca, serviceId: 0000faf0-0000-1000-8000-00805f9b34fb, characteristicId: 0000faf2-0000-1000-8000-00805f9b34fb, value: [1, 1, 161, 2, 3, 0, 0, 0, 2, 0, 0, 0]}

.....

Windows 10 log (with issue):

flutter: DEBUG - 2023-12-15 09:43:34.337885   Instance of 'BleClientConnectionStateUpdateEvent'
flutter: Received Message : {type: response, id: 0, result: BluetoothLE#BluetoothLE00:0a:cd:2f:ad:2f-7c:87:ce:0d:ef:da}
flutter: Received Message : {type: response, id: 1, result: [{00001801-0000-1000-8000-00805f9b34fb}, {00001800-0000-1000-8000-00805f9b34fb}, {0000faf0-0000-1000-8000-00805f9b34fb}]}
flutter: DEBUG - 2023-12-15 09:43:34.928884   Instance of 'BleClientConnectionStateUpdateEvent'
flutter: DEBUG - 2023-12-15 09:43:34.929877   Get hello
flutter: DEBUG - 2023-12-15 09:43:34.929877   Send SET: Instance of 'HelloRequest'
flutter: Received Message : {type: response, id: 2, error: Errore non specificato.
3

Requested characteristic not found}
flutter: Received Message : {type: response, id: 3, error: Errore non specificato.
3

Requested characteristic not found}
flutter: ERROR - 2023-12-15 09:43:35.162883   Errore non specificato.
3

Requested characteristic not found
flutter: ERROR - 2023-12-15 09:43:35.162883   runZonedGuarded 2: #0      WinConnector.invokeMethod (package:win_ble/src/utils/win_connector.dart:52:32)
<asynchronous suspension>
#1      WinBle.subscribeToCharacteristic.<anonymous closure> (package:win_ble/src/win_ble.dart:300:13)
<asynchronous suspension>
#2      WinBle.subscribeToCharacteristic (package:win_ble/src/win_ble.dart:296:5)
<asynchronous suspension>

flutter: ERROR - 2023-12-15 09:43:35.162883   Errore non specificato.
3

Requested characteristic not found
flutter: ERROR - 2023-12-15 09:43:35.162883   runZonedGuarded 2: #0      WinConnector.invokeMethod (package:win_ble/src/utils/win_connector.dart:52:32)
<asynchronous suspension>
#1      WinBle.subscribeToCharacteristic.<anonymous closure> (package:win_ble/src/win_ble.dart:300:13)
<asynchronous suspension>
#2      WinBle.subscribeToCharacteristic (package:win_ble/src/win_ble.dart:296:5)
<asynchronous suspension>

flutter: Received Message : {type: response, id: 4, result: null}

.....
ffamar commented 10 months ago

@rohitsangwan01 is there any news on this issue? Do you need any more information? Thank you.

rohitsangwan01 commented 10 months ago

@ffamar can you cross check with another windows 10 issue to verify if its windows 10 issue or something else

ffamar commented 10 months ago

@ffamar can you cross check with another windows 10 issue to verify if its windows 10 issue or something else

@rohitsangwan01 I got the same result using 2 notebooks and 1 desktop of different brands.

BikeBr0 commented 10 months ago

I'm having the same issue with win_ble 1.1.1. I can produce an MSIX installer (or .exe) which runs fine on Windows 11. On Windows 10, I can connect to the peripheral device but the subsequent interaction yields an "Unspecified error Requested characteristic not found" error. I was testing on a:

Lenovo Thinkpad X270 Edition Windows 10 Pro Version 21H1 OS build 19043.2364 Experience Windows Feature Experience Pack 120.2212.4190.0

Giovanni-Fantin commented 6 months ago

I'm having the same issue with win_ble 1.1.1 on windows 11 on a dell latitude 5540. (flutter: Received Message : {_type: response, _id: 9, error: Errore non specificato. In italian, means "unspecified error") when i try to subscribe to the characteristics. On another pc with windows 11 the same code works. Any resolution?

BikeBr0 commented 6 months ago

@Giovanni-Fantin - recommend you switch the universal_ble

rohitsangwan01 commented 5 months ago

i don't have Windows 10 to test yet, that's why am not able to replicate this issue, though am also one of the maintainer in universal_ble plugin, both plugins uses different Apis, on win_ble we are using win32 and on universal_ble we are using winrt apis, but will also try to fix this one if i get access to Windows10