From 7e22a8878e466f14a1874c7592b51813e7d31dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Tue, 4 Sep 2018 19:09:17 +0200 Subject: [PATCH] Configure AP fallback at build time --- code/espurna/config/general.h | 3 +++ code/espurna/wifi.ino | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 357c3bed..103e5a50 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -312,6 +312,9 @@ #define WIFI_AP_CAPTIVE 1 // Captive portal enabled when in AP mode #endif +#ifndef WIFI_FALLBACK_APMODE +#define WIFI_FALLBACK_APMODE 1 // Fallback to AP mode if no STA connection +#endif #ifndef WIFI_SLEEP_MODE #define WIFI_SLEEP_MODE WIFI_NONE_SLEEP // WIFI_NONE_SLEEP, WIFI_LIGHT_SLEEP or WIFI_MODEM_SLEEP diff --git a/code/espurna/wifi.ino b/code/espurna/wifi.ino index 65a9e3ab..a5ab8e1e 100644 --- a/code/espurna/wifi.ino +++ b/code/espurna/wifi.ino @@ -40,7 +40,7 @@ void _wifiConfigure() { #endif jw.setConnectTimeout(WIFI_CONNECT_TIMEOUT); wifiReconnectCheck(); - jw.enableAPFallback(true); + jw.enableAPFallback(WIFI_FALLBACK_APMODE); jw.cleanNetworks(); _wifi_ap_mode = getSetting("apmode", WIFI_AP_FALLBACK).toInt();