From 31022094c11ccfbdee7eb15d772f1559005aa8df Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 23 Nov 2020 00:46:14 +0100 Subject: [PATCH] adjust timeouts --- WifiInterface.cpp | 7 ++++--- config.example.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 3e9a0f0..a80481c 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -35,7 +35,8 @@ bool WifiInterface::connected = false; Stream * WifiInterface::wifiStream; #ifndef WIFI_CONNECT_TIMEOUT -#define WIFI_CONNECT_TIMEOUT 8000 +// Tested how long it takes to FAIL an unknown SSID on firmware 1.7.4. +#define WIFI_CONNECT_TIMEOUT 14000 #endif //////////////////////////////////////////////////////////////////////////////// @@ -175,8 +176,8 @@ wifiSerialState WifiInterface::setup2(const __FlashStringHelper* SSid, const __F // ESP8266 is preconfigured. We check the first 13 chars // of the password. if (strncmp_P("Your network ",(const char*)password,13) == 0) { - delay(WIFI_CONNECT_TIMEOUT); // give a preconfigured ES8266 a chance to connect to a router - + delay(8000); // give a preconfigured ES8266 a chance to connect to a router + // typical connect time approx 7 seconds StringFormatter::send(wifiStream, F("AT+CIFSR\r\n")); if (checkForOK(5000, (const char*) F("+CIFSR:STAIP"), true,false)) if (!checkForOK(1000, (const char*) F("0.0.0.0"), true,false)) diff --git a/config.example.h b/config.example.h index d3542d6..a6412bc 100644 --- a/config.example.h +++ b/config.example.h @@ -56,10 +56,10 @@ The configuration file for DCC++ EX Command Station // ///////////////////////////////////////////////////////////////////////////////////// // -// Wifi connect timeout in milliseconds. Default is 8000 (8 seconds). You only need +// Wifi connect timeout in milliseconds. Default is 14000 (14 seconds). You only need // to set this if you have an extremely slow Wifi router. // -//#define WIFI_CONNECT_TIMEOUT 8000 +//#define WIFI_CONNECT_TIMEOUT 14000 ///////////////////////////////////////////////////////////////////////////////////// //