Commit f6b9e9c2 authored by Joey Babcock's avatar Joey Babcock Committed by Me No Dev

Clarified comments and debug messages in WiFiClient Example (#2389)

* Clarified comments and debug messages

Made debug messages and comments easier to understand/grammatical fixes

* few more fixes
parent fc737e08
...@@ -18,7 +18,7 @@ void setup() ...@@ -18,7 +18,7 @@ void setup()
Serial.println(); Serial.println();
Serial.println(); Serial.println();
Serial.print("Wait for WiFi... "); Serial.print("Waiting for WiFi... ");
while(WiFiMulti.run() != WL_CONNECTED) { while(WiFiMulti.run() != WL_CONNECTED) {
Serial.print("."); Serial.print(".");
...@@ -39,32 +39,30 @@ void loop() ...@@ -39,32 +39,30 @@ void loop()
const uint16_t port = 80; const uint16_t port = 80;
const char * host = "192.168.1.1"; // ip or dns const char * host = "192.168.1.1"; // ip or dns
Serial.print("Connecting to ");
Serial.print("connecting to ");
Serial.println(host); Serial.println(host);
// Use WiFiClient class to create TCP connections // Use WiFiClient class to create TCP connections
WiFiClient client; WiFiClient client;
if (!client.connect(host, port)) { if (!client.connect(host, port)) {
Serial.println("connection failed"); Serial.println("Connection failed.");
Serial.println("wait 5 sec..."); Serial.println("Waiting 5 seconds before retrying...");
delay(5000); delay(5000);
return; return;
} }
// This will send the request to the server // This will send a request to the server
client.print("Send this data to server"); client.print("Send this data to the server");
//read back one line from server //read back one line from the server
String line = client.readStringUntil('\r'); String line = client.readStringUntil('\r');
client.println(line); client.println(line);
Serial.println("closing connection"); Serial.println("Closing connection.");
client.stop(); client.stop();
Serial.println("wait 5 sec..."); Serial.println("Waiting 5 seconds before restarting...");
delay(5000); delay(5000);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment