espressif / esp-idf-provisioning-ios

Apache License 2.0
130 stars 62 forks source link

on iOS calling prov-session twice results in a NSURLErrorDomain 1005 error "The network connection was lost" #5

Closed pricimus closed 3 years ago

pricimus commented 4 years ago

When configuring wifi on a ESP device using iOS with the following steps over SoftAP with Security 1:

  1. Call prov-session with a correct POP code
  2. Supply incorrect credentials to prov-config, for example with an incorrect SSID passphrase
  3. An error is returned
  4. Correct the wifi credentials and then retry the above steps

Expected result: Successfully create session and apply credentials

Actual result: The call to prov-session fails with an NSURLErrorDomain 1005 error "The network connection was lost"

shahpiyushv commented 4 years ago

@pricimus , the provisioning state machine is designed such that you need to reset it to factory defaults if incorrect credentials are provided, and then re-provision.

pricimus commented 4 years ago

Thanks for the quick response. Incidentally this is not the case when testing the same scenario with Android. I can supply incorrect credentials the first time and then try again without resetting the device to factory defaults, and it will configure wifi correctly. This would suggest that the device does indeed support submitting incorrect details then resubmitting with correct details. Perhaps there is a difference in how iOS and Android configure the session either on the client or on the device itself?

vikas-chandra-mnnit commented 3 years ago

@pricimus We would like to inform you that since your last comment there has been a lot of structural and design changes in our provisioning source. We have created ESPProvision library for iOS which can be integrated into your application using CocoaPods. The library contains all the APIs required to provision both BLE and SoftAP devices. You can find the usage and documentation for the same in README. We have also included a sample app to demonstrate the working of the library. These sample apps are also available on App Store Link1 Link2.

We request you to use this library and sample app reference for any development henceforth. We will close this ticket as part of our cleanup process. If you see any issue with the library or any components feel free to open a new ticket for it. Thanks for your support.