File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,19 @@ WiFiServer server(80);
42
42
void setup () {
43
43
write_header (" setup()" );
44
44
Serial.begin (115200 );
45
+ WiFi.hostname (" ESP8266-Weatherstation" );
45
46
EEPROM.begin (city_len + countrycode_len + apikey_len);
46
47
setup_display (update_display_clock);
47
48
WiFiManager wifiManager;
48
- WiFi.hostname (" ESP8266-Weatherstation" );
49
- wifiManager.autoConnect (" AutoConnectAP" );
49
+ wifiManager.setTimeout (60 );
50
+
51
+ if (!wifiManager.autoConnect (" AutoConnectAP" , " diesistdaspasswort" )) {
52
+ Serial.println (" failed to connect and hit timeout" );
53
+ delay (3000 );
54
+ // reset and try again, or maybe put it to deep sleep
55
+ ESP.restart ();
56
+ }
57
+
50
58
Serial.println (" Connected." );
51
59
ipaddress = WiFi.localIP ().toString ();
52
60
read_config_from_storage ();
You can’t perform that action at this time.
0 commit comments