espressif / esp-idf-provisioning-ios

Apache License 2.0
134 stars 64 forks source link

Current Appstore softAP failing to connect to device #29

Closed markirwin closed 3 years ago

markirwin commented 3 years ago

I am trying to use the vanilla softAP examples in ESP-IDF 4.3 they build fine and a couple of weeks back it worked fine with the app store softAP application to provision the ESP32.

However, I am trying to do this again since upgrading to iOS 14.5 and now the app is getting stuck.

I connect to the AP hotspot from settings, then open the ESP softAP provisioning example, Skip the QR code window and on the second screen when I press connect it takes me to the ESP SoftAP Prov settings, I have granted all permissions required. On occasion, i manage to get it to the spinning icon when I press connect but the app isn't asking for permission to connect to the network. I assume some of the privacy changes in 14.5 might have interfered in the operation?

I see from the output in monitor I (955) app: If QR code is not visible, copy paste the below URL in a browser. https://espressif.github.io/esp-jumpstart/qrcode.html?data={"ver":"v1","name":"PROV_0699E4","pop":"abcd1234","transport":"softap"} I (23185) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<0,0>, prof:1 I (23195) wifi:station: ca:58:06:1a:ad:f1 join, AID=1, bgn, 20 I (24455) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2 W (26245) wifi:idx:4 (ifx:1, ca:58:06:1a:ad:f1), tid:0, ssn:0, winSize:64

Everytime i jump back to the app and press connect it keeps taking me back to settings.

vikas-chandra-mnnit commented 3 years ago

Hi @markirwin, Thanks for reporting this issue. We will verify this behaviour and let you know.

vikas-chandra-mnnit commented 3 years ago

Hi @markirwin, Can you confirm if app has permission for local network from iPhone settings? In our case we can see that local network permission dialog is not getting triggered when you try to communicate with SoftAP device. This behaviour is not consistent with the earlier iOS 14 version.

We will look into making some dummy arrangement in the provisioning library in order to trigger this dialog.

markirwin commented 3 years ago

Hi Vikas,

The SoftAP setting window is triggered.

And there is local network permission but it can’t seem to find the device to connect on the network.

IMG_3209

vikas-chandra-mnnit commented 3 years ago

@markirwin Can you check if below log is coming in the SoftAP device below the QR code.

I (144485) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.3

If its not coming then keep your phone connected for some time with the SoftAP and retry provisioning once the log is visible.

markirwin commented 3 years ago

I am running softAP provisioning on ESP32S2 NodeMCU dev board.

I (45) boot: ESP-IDF v4.3-beta2-2-g9a2d25191-dirty 2nd stage bootloader I (46) boot: compile time 16:12:10 I (46) boot: chip revision: 0 I (49) boot.esp32s2: SPI Speed : 80MHz I (54) boot.esp32s2: SPI Mode : DIO I (59) boot.esp32s2: SPI Flash Size : 2MB I (63) boot: Enabling RNG early entropy source... I (69) boot: Partition Table: I (72) boot: ## Label Usage Type ST Offset Length I (80) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (87) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (95) boot: 2 factory factory app 00 00 00010000 0013d620 I (102) boot: End of partition table I (106) esp_image: segment 0: paddr=00010020 vaddr=3f000020 size=1f58ch (128396) map I (139) esp_image: segment 1: paddr=0002f5b4 vaddr=3ffc63d0 size=00a64h ( 2660) load I (140) esp_image: segment 2: paddr=00030020 vaddr=40080020 size=87544h (554308) map I (250) esp_image: segment 3: paddr=000b756c vaddr=3ffc6e34 size=033b4h ( 13236) load I (254) esp_image: segment 4: paddr=000ba928 vaddr=40022000 size=143d0h ( 82896) load I (287) boot: Loaded app from partition at offset 0x10000 I (287) boot: Disabling RNG early entropy source... I (299) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte I (299) cpu_start: Pro cpu up. I (359) cpu_start: Pro cpu start user code I (359) cpu_start: cpu freq: 160000000 I (359) cpu_start: Application information: I (362) cpu_start: Project name: wifi_prov_mgr I (367) cpu_start: App version: 0cc2713 I (372) cpu_start: Compile time: Jun 4 2021 16:10:56 I (378) cpu_start: ELF file SHA256: 170710af68969367... I (384) cpu_start: ESP-IDF: v4.3-beta2-2-g9a2d25191-dirty I (391) heap_init: Initializing. RAM available for dynamic allocation: I (398) heap_init: At 3FF9E000 len 00002000 (8 KiB): RTCRAM I (404) heap_init: At 3FFCE8D0 len 0002D730 (181 KiB): DRAM I (411) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM I (417) spi_flash: detected chip: generic I (422) spi_flash: flash io: dio W (426) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header. I (442) cpu_start: Starting scheduler on PRO CPU. I (459) wifi:wifi driver task: 3ffd6344, prio:23, stack:6656, core=0 I (459) system_api: Base MAC address is not set I (459) system_api: read default base MAC address from EFUSE I (459) wifi:wifi firmware version: bb5a818 I (469) wifi:wifi certification version: v7.0 I (469) wifi:config NVS flash: enabled I (469) wifi:config nano formating: disabled I (479) wifi:Init data frame dynamic rx buffer num: 32 I (479) wifi:Init management frame dynamic rx buffer num: 32 I (489) wifi:Init management short buffer num: 32 I (489) wifi:Init dynamic tx buffer num: 32 I (499) wifi:Init static rx buffer size: 1600 I (499) wifi:Init static rx buffer num: 10 I (499) wifi:Init dynamic rx buffer num: 32 I (509) wifi_init: rx ba win: 6 I (509) wifi_init: tcpip mbox: 32 I (519) wifi_init: udp mbox: 6 I (519) wifi_init: tcp mbox: 6 I (519) wifi_init: tcp tx win: 5744 I (529) wifi_init: tcp rx win: 5744 I (529) wifi_init: tcp mss: 1440 I (539) wifi_init: WiFi IRAM OP enabled I (539) wifi_init: WiFi RX IRAM OP enabled I (549) app: Starting provisioning I (549) phy_init: phy_version 1500,0a54a2f,Feb 25 2021,11:47:04 I (689) wifi:mode : sta (7c:df:a1:32:ec:f2) I (689) wifi:enable tsf I (689) wifi:mode : sta (7c:df:a1:32:ec:f2) + softAP (7c:df:a1:32:ec:f3) I (689) wifi:Total power save buffer number: 16 I (689) wifi:Init max length of beacon: 752/752 I (699) wifi:Init max length of beacon: 752/752 I (699) wifi:Total power save buffer number: 16 W (709) wifi_prov_scheme_softap: Error adding mDNS service! Check if mDNS is running I (719) wifi_prov_mgr: Provisioning started with service name : PROV_32ECF2 I (719) app: Provisioning started I (729) app: Scan this QR code from the provisioning application for Provisioning. I (729) QRCODE: Encoding below text with ECC LVL 0 & QR Code Version 10 I (739) QRCODE: {"ver":"v1","name":"PROV_32ECF2","pop":"abcd1234","transport":"softap"}

I (949) app: If QR code is not visible, copy paste the below URL in a browser. https://espressif.github.io/esp-jumpstart/qrcode.html?data={"ver":"v1","name":"PROV_32ECF2","pop":"abcd1234","transport":"softap"} I (124009) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<0,0>, prof:1 I (124009) wifi:station: fe:e7:ff:f4:2b:9c join, AID=1, bgn, 20 W (124059) wifi:idx:4 (ifx:1, fe:e7:ff:f4:2b:9c), tid:0, ssn:0, winSize:64 I (125359) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2

If I scan the QR code it says to be the device cannot be connected. If I click do not have QR code and then click on connect it takes me to the settings page.

vikas-chandra-mnnit commented 3 years ago

@markirwin Unfortunately I was not able to verify this on iOS version 14.5. I was using the iOS version 14.4 and after upgrade it is now 14.6. However I tried SoftAP provisioning on 14.6 and it worked as expected. We are trying to search if there was some bug in 14.5 OS which has lead to this behaviour. If possible, it would be really helpful if you can upgrade your iOS version and share us the result of provisioning on it, thanks.

markirwin commented 3 years ago

After upgrading and reinstalling the app it now works.. I am not sure if it was a iOS configuration issue. I will now close this ticket.