From df2e40fa11f06820d004d117f99548596fb141e5 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 18 Nov 2020 23:42:37 +0100 Subject: [PATCH] empty SSID is "unconfigured" as well --- WifiInterface.cpp | 2 +- config.example.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 6c6dc5a..29a698c 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -172,7 +172,7 @@ wifiSerialState WifiInterface::setup2(const __FlashStringHelper* SSid, const __F // ESP8266 is preconfigured. We check the first 13 chars // of the SSid. char *yourNetwork = "Your network "; - if (strncmp_P(yourNetwork, (const char*)SSid, 13) == 0) { + if (strncmp_P(yourNetwork, (const char*)SSid, 13) == 0 || SSid[0] == '\0') { delay(8000); // give a preconfigured ES8266 a chance to connect to a router StringFormatter::send(wifiStream, F("AT+CIFSR\r\n")); diff --git a/config.example.h b/config.example.h index 79d0d23..ab55c21 100644 --- a/config.example.h +++ b/config.example.h @@ -49,8 +49,14 @@ The configuration file for DCC++ EX Command Station // AT commands and the other WIFI_* defines below do not have any effect. //#define DONT_TOUCH_WIFI_CONF // -// WIFI_SSID is the network name IF you want to use your home network. -// Do NOT change this if you want to use the WiFi in Access Point mode. +// WIFI_SSID is the network name IF you want to use your existing home network. +// Do NOT change this if you want to use the WiFi in Access Point (AP) mode. +// +// If you do NOT set the WIFI_SSID, the WiFi chip will first try +// to connect to the previously configured network and if that fails +// fall back to Access Point mode. The SSID of the AP will be +// automatically set to DCCEX_*. +// // Your SSID may not conain ``"'' (double quote, ASCII 0x22). #define WIFI_SSID "Your network name" //