esp-idf-provisioning-android
esp-idf-provisioning-android copied to clipboard
"Write to BLE failed" on ESPDevice.scanNetworks
Sometimes, randomly, I'm getting "Write to BLE failed" error in the onFailure callback of scanNetworks. From there, I always got this error when retrying to call scanNetworks.

I/chromium: [INFO:CONSOLE(2198)] "java.lang.RuntimeException: Failed to create session.", source: http://localhost:8100/main.js (2198)
D/ESPIdfProvisioningPlugin: action = scanNetworks
D/ESP:ESPDevice: Send Wi-Fi scan command to device
W/PluginManager: THREAD WARNING: exec() call to ESPIdfProvisioning.scanNetworks blocked the main thread for 160ms. Plugin should use CordovaInterface.getThreadPool().
D/Espressif::BLETransport: onCharacteristicWrite, status : 0
UUID : 1775ff51-6b43-439b-877c-060f2d9bed07
D/Espressif::BLETransport: onCharacteristicRead, status 0 UUID : 1775ff51-6b43-439b-877c-060f2d9bed07
D/Espressif::BLETransport: onCharacteristicWrite, status : 4
UUID : 1775ff51-6b43-439b-877c-060f2d9bed07
W/System.err: java.lang.Exception: Write to BLE failed
W/System.err: at com.espressif.provisioning.transport.BLETransport$1.onCharacteristicWrite(BLETransport.java:376)
W/System.err: at android.bluetooth.BluetoothGatt$1$7.run(BluetoothGatt.java:448)
W/System.err: at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:780)
W/System.err: at android.bluetooth.BluetoothGatt.access$200(BluetoothGatt.java:41)
W/System.err: at android.bluetooth.BluetoothGatt$1.onCharacteristicWrite(BluetoothGatt.java:443)
W/System.err: at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:258)
W/System.err: at android.os.Binder.execTransactInternal(Binder.java:1159)
W/System.err: at android.os.Binder.execTransact(Binder.java:1123)
Hi @QuentinFarizon ,
Please try again after disabling CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION, which you can find under Component Config -> Wi-Fi Provisioning Manager.
Hello @khushbushah2302, it was disabled