Skip to content

WiFiClient example needs a client.close() #72

@cswiger

Description

@cswiger

This is easy - using the WiFiClient.ino example with thingspeak.com - my sensor would only post 4 readings then stop. After putting a client.stop(); right after Serial.println("closing connection"); it now works.

// Read all the lines of the reply from server and print them to Serial
while(client.available()){
String line = client.readStringUntil('\r');
Serial.print(line);
}

Serial.println();
Serial.println("closing connection");
client.stop(); <-- add

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions