-
Notifications
You must be signed in to change notification settings - Fork 33
Description
HI,
my logging goes in hangup occasionally (1-2 times /week), this is boring.
The Wemos gets stuck exactly during
if(client->POST(url, host, payload)){
It happens, when exactly during post the internet gets disconnected for a short while. My router makes each day a reconnect with interruption of connection to get a new IP. It is not so rare, that this is falling just into the post procedure, as this takes about 3 seconds, each 15seconds.
Before the post i get the info "Publishing ...", then nothing happens anymore, it stays forever, no return of Success or error message. (Before post Wifi and client was connected)
I need to reset the Wemos to restart.
Does anybody have an idea of rootcause and/or countermeasure?
This is my code of that part, like in your example:
// Publish data to Google Sheets
int retval = client->connect(host, httpsPort);
Serial.print("Client: ");Serial.println(retval);
Serial.println(WiFi.status());
Serial.println("Publishing...");
//Serial.println(payload);
if(client->POST(url, host, payload)){
Serial.println("successful");
}
else{
// do stuff here if publish was not successful
Serial.println("Error while connecting");
}