chmorgan / esphttpd-freertos

freertos example of libesphttpd for esp32 and esp8266
53 stars 14 forks source link

Assertion failure when switching to station only mode #19

Closed JimGaluska closed 4 years ago

JimGaluska commented 4 years ago

There is an assertion failure on line 284 in file main/user_main.c when ever attempting to switch to standalone STA mode. This issue is seen in git commit #ffffd5c.

Instructions to reproduce: 1) On an ESP32, Checkout, compile, flash, and monitor version #ffffd5c. 2) Connect to the 'ESP' WiFi AP, browse to http://192.168.4.1, and select 'Configure your WIFI Network' option. 3) Click on the 'Go to AP+STA mode' button. Wait for the screen to refresh. 4) Enter your SSID (or click the scan button and select your SSID), enter your password, and click on the 'Connect!' button. After the screen has changed, click on the 'here' button to use the ESP's new IP address. 5) Re-select 'Configure your WIFI Network' option. 6) Click on the "Go to standalone STA mode' button, The esp will assert on line 284 in file main/user_main.c

Additional Information: Modifying line 284 from:

ESP_ERROR_CHECK( esp_wifi_ap_get_sta_list(&sta_list));

to

 esp_wifi_ap_get_sta_list(&sta_list);

apparently makes the software work, but I am too new to this project to know if this is the correct way to fix this issue.

Also, the error return from function esp_wifi_ap_get_sta_list is ESP_ERR_WIFI_MODE (0x305) and sta_list.num is equal to 1 upon this functions return.

phatpaul commented 4 years ago

Yep, my bad. Fixed in #20. Please test it. Thanks for reporting. -Paul