@@ -18,7 +18,7 @@ void setup()
18
18
19
19
Serial.println ();
20
20
Serial.println ();
21
- Serial.print (" Wait for WiFi... " );
21
+ Serial.print (" Waiting for WiFi... " );
22
22
23
23
while (WiFiMulti.run () != WL_CONNECTED) {
24
24
Serial.print (" ." );
@@ -39,32 +39,30 @@ void loop()
39
39
const uint16_t port = 80 ;
40
40
const char * host = " 192.168.1.1" ; // ip or dns
41
41
42
-
43
-
44
- Serial.print (" connecting to " );
42
+ Serial.print (" Connecting to " );
45
43
Serial.println (host);
46
44
47
45
// Use WiFiClient class to create TCP connections
48
46
WiFiClient client;
49
47
50
48
if (!client.connect (host, port)) {
51
- Serial.println (" connection failed" );
52
- Serial.println (" wait 5 sec ..." );
49
+ Serial.println (" Connection failed. " );
50
+ Serial.println (" Waiting 5 seconds before retrying ..." );
53
51
delay (5000 );
54
52
return ;
55
53
}
56
54
57
- // This will send the request to the server
58
- client.print (" Send this data to server" );
55
+ // This will send a request to the server
56
+ client.print (" Send this data to the server" );
59
57
60
- // read back one line from server
58
+ // read back one line from the server
61
59
String line = client.readStringUntil (' \r ' );
62
60
client.println (line);
63
61
64
- Serial.println (" closing connection" );
62
+ Serial.println (" Closing connection. " );
65
63
client.stop ();
66
64
67
- Serial.println (" wait 5 sec ..." );
65
+ Serial.println (" Waiting 5 seconds before restarting ..." );
68
66
delay (5000 );
69
67
}
70
68
0 commit comments