tonyp7 / esp32-wifi-manager

Captive Portal for ESP32 that can connect to a saved wireless network or start an access point where you can connect to existing wifis.
MIT License
664 stars 217 forks source link

Setting DEFAULT_AP_PASSWORD to empty string or "\0" causes boot loop #26

Closed liftoff closed 5 years ago

liftoff commented 5 years ago

I tried to set DEFAULT_AP_PASSWORD to "" as instructed in the comment above in wifi_manager.h but this results in a boot loop. Looks like this:

I (0) cpu_start: App cpu up.
I (446) heap_init: Initializing. RAM available for dynamic allocation:
I (453) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (459) heap_init: At 3FFB8DD8 len 00027228 (156 KiB): DRAM
I (465) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (471) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (478) heap_init: At 40091690 len 0000E970 (58 KiB): IRAM
I (484) cpu_start: Pro cpu start user code
I (166) pm_esp32: Frequency switching config: CPU_MAX: 160, APB_MAX: 80, APB_MIN: 40, Light sleep: DISABLED
I (167) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
http_server: waiting for start bit
wifi_manager: Start DHCP client for STA interface. If not already running
I (279) IOT_UNICORN: Time is not set yet. Getting time over NTP.
free heap: 249904
I (299) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (299) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
ESP_ERROR_CHECK failed: esp_err_t 0xb (ERROR) at 0x4008c74c
0x4008c74c: _esp_error_check_failed at /storage/workspace/esp/esp-idf/components/esp32/panic.c:685

file: "/storage/workspace/esp/wifi_unicorn/main/wifi_manager.c" line 576
func: wifi_manager
expression: esp_wifi_set_config(WIFI_IF_AP, &ap_config)

Backtrace: 0x4008c30c:0x3ffbe1f0 0x4008c74f:0x3ffbe210 0x400d3923:0x3ffbe230 0x4008e9d1:0x3ffbe390
0x4008c30c: invoke_abort at /storage/workspace/esp/esp-idf/components/esp32/panic.c:680

0x4008c74f: _esp_error_check_failed at /storage/workspace/esp/esp-idf/components/esp32/panic.c:686

0x400d3923: wifi_manager at /storage/workspace/esp/wifi_unicorn/main/wifi_manager.c:576 (discriminator 1)

0x4008e9d1: vPortTaskWrapper at /storage/workspace/esp/esp-idf/components/freertos/port.c:403

Rebooting...

I believe it has something to do with how the wifi_settings_t struct gets created initially. Not sure (I'm terrible with C).

tonyp7 commented 5 years ago

Hello,

You also need to change AP_AUTHMODE in this case. I'll updat the comment to make this clearer