fix boot loop caused by competing wifi_manager and cmd_wifi

It is now possible to set a default autoexec command to automatically
join wifi when wifi_manager is disabled. To test wifi stability without
wifi_manager, use the following commands:

nvs_set bypass_wm str -v "1"
nvs_set autoexec str -v "1"
nvs_set autoexec1 str -v "squeezelite -o I2S -b 500:2000 -d all=info -m
nvs_set autoexec2 str -v "join <ssid> <password>"
ESP32"
restart

Note that squeezelite occupies the "autoexec1" slot to avoid conflicts
with the wifi manager web configuration page when it is re-enabled. To
re-enable the wifi-manager, use the following commands:

nvs_set bypass_wm str -v "0"
restart

--
Additional change:  Credits page now has a button to enable the nvs
editor even in ota mode
This commit is contained in:
Sebastien
2019-11-01 09:49:51 -04:00
parent 2ed8b50fbe
commit 04b82e5bf6
4 changed files with 31 additions and 16 deletions

View File

@@ -32,7 +32,7 @@
#include "tcpip_adapter.h"
#include "esp_event.h"
#include "led.h"
extern bool bypass_wifi_manager;
#define JOIN_TIMEOUT_MS (10000)
extern EventGroupHandle_t wifi_event_group;
@@ -92,7 +92,7 @@ static void initialise_wifi(void)
return;
}
tcpip_adapter_init();
wifi_event_group = xEventGroupCreate();
// Now moved to esp_app_main: wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_event_loop_create_default());
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
@@ -194,5 +194,7 @@ void register_wifi_join()
void register_wifi()
{
register_wifi_join();
initialise_wifi();
if(bypass_wifi_manager){
initialise_wifi();
}
}