Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFi AP mode set programmatically causes core dump #41

Closed
klimbot opened this issue Jun 4, 2021 · 2 comments
Closed

WiFi AP mode set programmatically causes core dump #41

klimbot opened this issue Jun 4, 2021 · 2 comments

Comments

@klimbot
Copy link

klimbot commented Jun 4, 2021

Following code works in 2.19.1, but not in latest on ESP32:

static void enable_ap(void)
{
  struct mgos_config_wifi_ap ap_cfg;
  memcpy(&ap_cfg, mgos_sys_config_get_wifi_ap(), sizeof(ap_cfg));
  ap_cfg.enable = true;
  int result = mgos_wifi_setup_ap(&ap_cfg);
}

static void disable_ap(void)
{
  struct mgos_config_wifi_ap ap_cfg;
  memcpy(&ap_cfg, mgos_sys_config_get_wifi_ap(), sizeof(ap_cfg));
  ap_cfg.enable = false;
  int result = mgos_wifi_setup_ap(&ap_cfg);
}

Setting the WiFi AP mode on ESP32 using the above code with latest causes a core dump:

0x40103707 in esp32_wifi_set_mode (mode=WIFI_MODE_NULL)
    at /home/mongoose/deps/wifi/src/esp32/esp32_wifi.c:221
221         *((int *) 123) = 456;
#0  0x40103707 in esp32_wifi_set_mode (mode=WIFI_MODE_NULL)
    at /home/mongoose/deps/wifi/src/esp32/esp32_wifi.c:221
#1  0x401037c8 in esp32_wifi_remove_mode (mode=<optimized out>)
    at /home/mongoose/deps/wifi/src/esp32/esp32_wifi.c:285
#2  0x4010400c in mgos_wifi_dev_ap_setup (
    cfg=0x3ffb6330 <mgos_task_stack+7736>)
    at /home/mongoose/deps/wifi/src/esp32/esp32_wifi.c:458
#3  0x4010233d in mgos_wifi_setup_ap (cfg=0x3ffb6330 <mgos_task_stack+7736>)
    at /home/mongoose/deps/wifi/src/mgos_wifi.c:220
#4  mgos_wifi_setup_ap (cfg=0x3ffb6330 <mgos_task_stack+7736>)
    at /home/mongoose/deps/wifi/src/mgos_wifi.c:212

Seems to be a result of this line/commit @rojer

rojer added a commit that referenced this issue Jun 5, 2021
A deliberate crash added for debug while figuring out where wifi was being stopped.

#41
@rojer
Copy link
Contributor

rojer commented Jun 5, 2021

Seems to be a result of this line/commit @rojer

oh, this is a leftover from debug. removed, please try now.

@rojer rojer closed this as completed Jun 7, 2021
@rojer
Copy link
Contributor

rojer commented Jun 7, 2021

please reopen if it's still an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants