Disable auto captive portal when configuration exists (#5)
* only bring up the config portal if there is no config file or config button is held * use slightly older version of WiFiManager
This commit is contained in:
parent
6ad9081eaa
commit
437842776c
|
|
@ -21,7 +21,7 @@ lib_deps =
|
||||||
https://github.com/liebman/DLog.git
|
https://github.com/liebman/DLog.git
|
||||||
https://github.com/liebman/DLogNet.git
|
https://github.com/liebman/DLogNet.git
|
||||||
MicroNMEA@2.0.1
|
MicroNMEA@2.0.1
|
||||||
https://github.com/tzapu/WiFiManager.git#development
|
https://github.com/tzapu/WiFiManager.git#9d6ce13
|
||||||
https://github.com/ThingPulse/esp8266-oled-ssd1306.git#4fa903f
|
https://github.com/ThingPulse/esp8266-oled-ssd1306.git#4fa903f
|
||||||
https://github.com/me-no-dev/ESPAsyncUDP.git#b592ac6
|
https://github.com/me-no-dev/ESPAsyncUDP.git#b592ac6
|
||||||
https://github.com/arcao/Syslog.git#e9c2eea
|
https://github.com/arcao/Syslog.git#e9c2eea
|
||||||
|
|
@ -29,7 +29,7 @@ lib_deps =
|
||||||
monitor_speed = 76800
|
monitor_speed = 76800
|
||||||
|
|
||||||
[env:default]
|
[env:default]
|
||||||
platform = espressif8266@2.2.2
|
platform = espressif8266@2.3.2
|
||||||
|
|
||||||
[env:staging]
|
[env:staging]
|
||||||
build_flags = ${env.build_flags} -DUSE_CERT_STORE
|
build_flags = ${env.build_flags} -DUSE_CERT_STORE
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,9 @@ void setup()
|
||||||
dlog.info(SETUP_TAG, "enabling syslog: '%s:%u'", syslog_host, syslog_port);
|
dlog.info(SETUP_TAG, "enabling syslog: '%s:%u'", syslog_host, syslog_port);
|
||||||
dlog.begin(new DLogSyslogWriter(syslog_host, syslog_port, devicename, ESPNTP_SERVER_VERSION));
|
dlog.begin(new DLogSyslogWriter(syslog_host, syslog_port, devicename, ESPNTP_SERVER_VERSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dlog.info(SETUP_TAG, "ESP::FullVersion: %s", ESP.getFullVersion().c_str());
|
||||||
|
|
||||||
const char* url = wifi.getOTAURL();
|
const char* url = wifi.getOTAURL();
|
||||||
const char* fp = wifi.getOTAFP();
|
const char* fp = wifi.getOTAFP();
|
||||||
if (fp == nullptr)
|
if (fp == nullptr)
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@ void WiFiSetup::connect(bool force_config)
|
||||||
{
|
{
|
||||||
WiFi.mode(WiFiMode::WIFI_STA);
|
WiFi.mode(WiFiMode::WIFI_STA);
|
||||||
WiFi.setSleepMode(WIFI_NONE_SLEEP);
|
WiFi.setSleepMode(WIFI_NONE_SLEEP);
|
||||||
|
|
||||||
|
dlog.info(TAG, F("connect: disableing captive portal when auto-connecting"));
|
||||||
|
_wm.setEnableConfigPortal(false); // don't automatically use the captive portal
|
||||||
|
|
||||||
if (force_config)
|
if (force_config)
|
||||||
{
|
{
|
||||||
dlog.info(TAG, F("connect: starting forced config portal!"));
|
dlog.info(TAG, F("connect: starting forced config portal!"));
|
||||||
|
|
@ -58,7 +62,11 @@ void WiFiSetup::connect(bool force_config)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dlog.info(TAG, F("connect: auto-connecting"));
|
dlog.info(TAG, F("connect: auto-connecting"));
|
||||||
_wm.autoConnect(_devicename, NULL);
|
while (!_wm.autoConnect(_devicename, NULL))
|
||||||
|
{
|
||||||
|
dlog.error(TAG, F("connect: not connected! retrying...."));
|
||||||
|
delay(1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user