Added timeout check at wifi connect
This commit is contained in:
parent
e15f01d290
commit
fb9fde73a4
Binary file not shown.
BIN
bin/firmware.bin
BIN
bin/firmware.bin
Binary file not shown.
@ -1 +1 @@
|
||||
{ "project":"gravmon", "version":"0.2.2", "html": [ "index.min.htm", "device.min.htm", "config.min.htm", "about.min.htm" ] }
|
||||
{ "project":"gravmon", "version":"0.2.3", "html": [ "index.min.htm", "device.min.htm", "config.min.htm", "about.min.htm" ] }
|
@ -26,7 +26,7 @@ build_flags = #-O0 -Wl,-Map,output.map
|
||||
#-D SKIP_SLEEPMODE
|
||||
-D USE_LITTLEFS=true
|
||||
#-D EMBED_HTML
|
||||
-D CFG_APPVER="\"0.2.2\""
|
||||
-D CFG_APPVER="\"0.2.3\""
|
||||
lib_deps =
|
||||
# https://github.com/jrowberg/i2cdevlib.git # Using local copy of this library
|
||||
https://github.com/codeplea/tinyexpr
|
||||
|
@ -27,8 +27,6 @@ SOFTWARE.
|
||||
#include "tinyexpr.h"
|
||||
#include "tempsensor.h"
|
||||
|
||||
//#define LOG_LEVEL 5
|
||||
|
||||
//
|
||||
// Calculates gravity according to supplied formula, compatible with iSpindle/Fermentrack formula
|
||||
//
|
||||
|
@ -49,6 +49,9 @@ void printBuildOptions() {
|
||||
#ifdef SKIP_SLEEPMODE
|
||||
"SKIP_SLEEP "
|
||||
#endif
|
||||
#ifdef EMBED_HTML
|
||||
"EMBED_HTML "
|
||||
#endif
|
||||
#ifdef ACTIVATE_OTA
|
||||
"OTA "
|
||||
#endif
|
||||
|
@ -75,13 +75,18 @@ bool Wifi::connect( bool showPortal ) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Add timeout after x retries to not end up in forever loop.
|
||||
|
||||
// Connect to wifi
|
||||
int i = 0;
|
||||
|
||||
WiFi.begin();
|
||||
while( WiFi.status() != WL_CONNECTED ) {
|
||||
delay(100);
|
||||
Serial.print( "." );
|
||||
|
||||
if( i++ > 100 ) {
|
||||
LittleFS.end();
|
||||
ESP.reset();
|
||||
}
|
||||
}
|
||||
Serial.print( CR );
|
||||
connectedFlag = true;
|
||||
|
Loading…
Reference in New Issue
Block a user