My goal is to scan the wifi, present the list of ssids discovered to user, let them select one, and configure the wifi to communicate with that wireless network. My apps is ESP32 based.
Right now, mgos_scan_wifi() is working. To reconfigure the wifi, I disable it with mgos_wifi_disconnect, then call mgos_wifi_setup with a filled in mgos_config_wifi structure. This works fine; I can see the disconnect happen, along with the reconnect to the new AP.
But after I do this once, mgos_scan_wifi() appears to stop working; the callback never gets called again.
mgos_scan_wifi() works fine if called multiple times if I do NOT do the mgos_wifi_disconnect()/mgos_wifi_setup() between.
How can I reconfigure wifi and keep mgos_scan_wifi() working without an intervening reboot (which would be an ugly experience for my users)?