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

ScanNetworks produce an Failed to create session error #52

Closed
juanirow opened this issue Aug 13, 2021 · 2 comments
Closed

ScanNetworks produce an Failed to create session error #52

juanirow opened this issue Aug 13, 2021 · 2 comments

Comments

@juanirow
Copy link

The connection fails when I try to scan networks when a BLE device is already connected.
My Flow is:

  1. Scan for BLE devices:
    manager.searchBleEspDevices(this)

  2. Create the ESPDevice when the device is found:
    manager.createESPDevice(ESPConstants.TransportType.TRANSPORT_BLE,ESPConstants.SecurityType.SECURITY_1)
    manager.espDevice.connectBLEDevice(device, serviceUUID)

  3. Try to scan for Networks
    manager.espDevice.proofOfPossession = "POP_VALUE"
    manager.espDevice.scanNetworks(this)

Then I always receive the onWiFiScanFailed error:

E/ProvisionManager: NAILAH onWiFiScanFailed: java.lang.RuntimeException: Failed to create session.
    java.lang.RuntimeException: Failed to create session.
        at com.espressif.provisioning.ESPDevice$3.onFailure(ESPDevice.java:475)
        at com.espressif.provisioning.ESPDevice$6.OnSessionEstablishFailed(ESPDevice.java:570)
        at com.espressif.provisioning.Session$1.onFailure(Session.java:108)
        at com.espressif.provisioning.transport.BLETransport$1.onCharacteristicWrite(BLETransport.java:354)
        at android.bluetooth.BluetoothGatt$1$7.run(BluetoothGatt.java:474)
        at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:882)
        at android.bluetooth.BluetoothGatt.access$200(BluetoothGatt.java:42)
        at android.bluetooth.BluetoothGatt$1.onCharacteristicWrite(BluetoothGatt.java:469)
        at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:267)
        at android.os.Binder.execTransactInternal(Binder.java:1195)
        at android.os.Binder.execTransact(Binder.java:1159)

I even tried this in the application in this repository and got the same problem.

@MhtSuthar
Copy link

Hi @juanirow,
I am facing this issue what i need to do?

I am having ESP32 device and try to connect via BLE
I don't have any POP value so i enter blank but after the device is not sending WIFI list and session is closed.

@juanirow
Copy link
Author

juanirow commented May 20, 2022

Hello, for me, it was the wrong POP at the end. According to the documentation, if you do not have a POP, you only need to send an empty string. If you have the same behavior as the previous description, maybe your device was configured with a POP different than an empty string

Sorry that I can't help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants