softAP connection problems.

Posts: 27
Joined: Tue Dec 27, 2016 2:10 am

softAP connection problems.

Postby ammaree » Fri Sep 21, 2018 8:59 pm

I have reached the end of my tether and need some help. Have a large application that, in a succession of versions has run for the last 9 months. The application boots in STA mode (if SSID/PSWD found in NVS) or in AP (if is not found). If booted in AP mode configuration is done in a number of steps:
a) Connect from phone, tablet or pc to device AP using know "SSID" and "PSWD" values
b) open web browser to device default IP address
c) fill in the required host network SSID and PSWD values and save to NVS
d) auto reboot device and connect to host network using SSID and PSWD values from NVS.

After the ESP-IDF updates on 15 Sep I tested our application on existing devices (starting in STA mode since SSID/PSWD found, hence working) as well as on brand new device (boot into AP mode since SSID/PSWD not found in NVS, and NOT working)

I have now reduced the AP config to the simplest possible example included below. The symptoms are as follows:
Device boots, start absolute minimum tasks (HTTP server + Supervisor) required for webserver configuration.
When I connect from my iPhone, Windows tablet or OSX laptop, the SSID of the AP is seen, can be selected but always fails from all 3 devices.
Whether I use and open network with no password or a WPA2 network with password, exact same result.

The code used to connect is as follows:

Code: Select all

   wifi_config_t sWifiAP = { .ap = { .ssid = "0123456789", .password = "0123456789" } } ;
   sWifiAP.ap.authmode         = WIFI_AUTH_WPA2_PSK ;
   sWifiAP.ap.max_connection   = 2 ;
   ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &sWifiAP)) ;
   ESP_ERROR_CHECK(esp_wifi_start()) ;

The content of the wifi_config_t is as follows:
0x00000000: 3031323334353637383900000000000000000000000000000000000000000000 0123456789......................
0x00000020: 3031323334353637383900000000000000000000000000000000000000000000 0123456789......................
0x00000040: 0000000000000000000000000000000000000000000000000000000000000000 ................................
0x00000060: 00000000030000000002000000000000000000000000000000000000 ............................

I have enabled VERBOSE log level but no message of any value is displayed after the following:
SSID='0123456789' PSWD='0123456789'
1.225: wifi RTC_MODULE Wi-Fi takes adc2 lock.
1.227: wifi phy_init loading PHY init data from application binary
1.229: wifi nvs nvs_open_from_partition phy 0
1.230: wifi nvs nvs_get cal_version 4
1.232: wifi phy_init phy_get_rf_cal_version: 4000
1.233: wifi nvs nvs_get_str_or_blob cal_mac
1.236: wifi nvs nvs_get_str_or_blob cal_data
1.245: wifi nvs nvs_close 3
1.306: wifi phy phy_version: 4000, b6198fa, Sep 3 2018, 15:11:06, 0, 0
1.309: wifi wifi mode : softAP (24:0a:c4:03:5d:e9)
1.312: eventTask event SYSTEM_EVENT_AP_START
1.314: eventTask event enter default callback
1.316: tiT tcpip_adapter check: local, if=1 fn=0x4011d12c
0x4011d12c: tcpip_adapter_start_api at C:/Dropbox/devs/ws/z-sdk/esp-idf/components/tcpip_adapter/tcpip_adapter_lwip.c:1092
1.317: main vApplicationDaemonTaskStartupHook AP mode - [Telnet/]SNTP/MQTTxx/Events/Sensors[/Actuators] tasks not started
1.321: tiT tcpip_adapter dhcp server start:(ip:, mask:, gw:
1.324: tiT tcpip_adapter call api in lwip: ret=0x0, give sem
1.326: eventTask tcpip_adapter check: remote, if=1 fn=0x4011d12c
0x4011d12c: tcpip_adapter_start_api at C:/Dropbox/devs/ws/z-sdk/esp-idf/components/tcpip_adapter/tcpip_adapter_lwip.c:1092
1.327: eventTask event exit default callback
1.329: eventTask halWL_EventHandler Event=13 (SYSTEM_EVENT_AP_START)
5:03.198: wifi wifi n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1

All other tasks continue in the background, the command line works but I just cannot connect to the AP.
Any suggestions or pointers will be appreciated.


Posts: 27
Joined: Tue Dec 27, 2016 2:10 am

Re: softAP connection problems.

Postby ammaree » Sun Sep 23, 2018 10:44 pm

Problem solved, application code tried to start a syslog session without being in STA mode and connected.

Who is online

Users browsing this forum: Bing [Bot], YxWang and 9 guests