Skip to content

Commit df5168e

Browse files
committed
fix: better wifi connection delay
1 parent 6cc2a32 commit df5168e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/BasicWrite/BasicWrite.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void setup() {
5353
wifiMulti.addAP(WIFI_SSID, WIFI_PASSWORD);
5454
while (wifiMulti.run() != WL_CONNECTED) {
5555
Serial.print(".");
56-
delay(100);
56+
delay(500);
5757
}
5858
Serial.println();
5959

@@ -83,8 +83,9 @@ void loop() {
8383
Serial.print("Writing: ");
8484
Serial.println(client.pointToLineProtocol(sensor));
8585
// If no Wifi signal, try to reconnect it
86-
if ((WiFi.RSSI() == 0) && (wifiMulti.run() != WL_CONNECTED))
86+
if (wifiMulti.run() != WL_CONNECTED) {
8787
Serial.println("Wifi connection lost");
88+
}
8889
// Write point
8990
if (!client.writePoint(sensor)) {
9091
Serial.print("InfluxDB write failed: ");

0 commit comments

Comments
 (0)