espressif / esp-idf-provisioning-ios

Apache License 2.0
134 stars 64 forks source link

SoftAP example not working #34

Closed tobyloki closed 3 years ago

tobyloki commented 3 years ago

I'd tried the SoftAP example from this repository and received an error saying "Error: Unable to verify device connection" on the app after connecting to the ESP32 in the WiFi settings app. I believe this is a problem with the iOS SoftAP provisioning example because I also tried provisioning with the Android SoftAP provisioning example, and it worked fine. How can I get it to work?

I am using an iPhone 8 running iOS 14.6. I'm also using XCode 12.5. Here are the log outputs I got when receiving the error on the app.

2021-07-01 14:25:59.485429-0700 ProvisionTest[715:239905] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2 192.168.4.1:80 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4)] unregister notification for read_timeout failed
2021-07-01 14:25:59.485565-0700 ProvisionTest[715:239905] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2 192.168.4.1:80 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4)] unregister notification for write_timeout failed
2021-07-01 14:25:59.514353-0700 ProvisionTest[715:239388] [] nehelper sent invalid result code [1] for Wi-Fi information request
2021-07-01 14:26:26.542252-0700 ProvisionTest[715:239388] [Storyboard] Unknown class _TtC13ProvisionTest8BarTitle in Interface Builder file.
2021-07-01 14:26:26.587114-0700 ProvisionTest[715:239388] [] nehelper sent invalid result code [1] for Wi-Fi information request
2021-07-01 14:27:17.309333-0700 ProvisionTest[715:239388] [Storyboard] Unknown class _TtC13ProvisionTest8BarTitle in Interface Builder file.
2021-07-01 14:27:17.346359-0700 ProvisionTest[715:240286] [connection] nw_endpoint_handler_set_adaptive_read_handler [C4 192.168.4.1:80 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed
2021-07-01 14:27:17.346501-0700 ProvisionTest[715:240286] [connection] nw_endpoint_handler_set_adaptive_write_handler [C4 192.168.4.1:80 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed
2021-07-01 14:27:17.364012-0700 ProvisionTest[715:239388] [] nehelper sent invalid result code [1] for Wi-Fi information request
vikas-chandra-mnnit commented 3 years ago

Hi @tobyloki, we are experiencing this behaviour for some versions of iOS 14. We have an ongoing thread that relates to your problem. There are a couple of steps mentioned in the thread that you can try to make this work for your iPhone. Let me know if it solves your problem.

tobyloki commented 3 years ago

I noticed that a location permission was required, and so I added the appropriate permission to the Info.plist and clicked allow on the app when it gave me a popup. However, the problem still exists.

vikas-chandra-mnnit commented 3 years ago

I noticed that a location permission was required, and so I added the appropriate permission to the Info.plist and clicked allow on the app when it gave me a popup. However, the problem still exists.

@tobyloki Please share logs of your ESP32 device to help us better understand the problem. Thanks.

tobyloki commented 3 years ago

Here are the logs I get after connecting to the ESP32 device.

I (26012) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<0,0>, prof:1
I (26012) wifi:station: b2:f7:7d:a2:61:83 join, AID=1, bgn, 20
I (27162) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
I (30272) protocomm_httpd: Creating new session: 57

Also, here's a screenshot of the error I see on the app.

vikas-chandra-mnnit commented 3 years ago

@tobyloki Unfortunately I was not able to reproduce this issue using the repo sample code. According to the error description, this message appears when the app is not able to fetch the name of the SoftAP with which the iPhone is connected.

This may happen if you have removed the Access WiFi information from project capabilities.

Screenshot 2021-07-06 at 10 59 28 PM

Please ensure this capability is present in the sample app. If it is present, let us know so that we can look for some alternate resolutions. Thanks.

tobyloki commented 3 years ago

Thank you. That seemed to be my problem.

shahpiyushv commented 3 years ago

Closing this issue since it has been addressed.