-
Notifications
You must be signed in to change notification settings - Fork 8
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
scanWifiList never succeed if proofOfPossession is used #35
Comments
Facing the same issue. I updated the package to latest build 0.2.13, and using a test string as a proof of possession, and getting "Failed to create session." |
Hey! I got the same issue on 0.2.12 when testing yesterday (however my error was Note that it may be related to #46. Before I have time to patch it, you need to make sure the device and the app use the same security setting (secure1 for just POP, secure2 for POP + username). Otherwise you will get "Failed to create session", because the esp-provisioning-android library does not check if the security setting matches until after connection is established and you try scanning for wifi. |
@mateogianolio thanks for reaching out, I've given the app following permissions:
|
And when I try to provision the device by manually passing ssid and password (bypassing the wifi scan function) i get the same error. |
Maybe stupid question: Have you configured your proof of possession string |
I am not sure if our device has a POP configuration, thats why i tried with no value and unsecure security value as well. |
Our app follows the example app. searchESPDevices works, we can see list of devices.
On a found device, we call
await espDevice.connect(proofOfPossession);
Then call
await device.scanWifiList();
This always fails with messageFailed to create session
.Logcat show
onCharacteristicWrite, status : 4
And stack trace
I found that the android native property
ESPDevice.proofOfPossession
is always an empty string which make it unable to create BLE session with the device, hence the error above.The reason is:
onPeripheralFound
, whenever a device is found (viasearchESPDevices
), it is added to theespDevices
cache. But it that time, there is no PoP, thus no thing is set. Here is the line.createESPDevice
, if the device exist in theespDevices
cache, it returns immediately without filling the Pop. And the result is that PoP is never used.I made a patch and it seems to work for my case. Not know if there is any other cases. I don't check the property
android.bluetooth.BluetoothDevice.uuids
because it always null in my case: the bluetooth device is not null by its uuids is null.fix_proofOfPossession_is_never_set_patch.txt
The text was updated successfully, but these errors were encountered: