StorageB / Google-Sheets-Logging

Log data from an ESP8266 device directly to Google Sheets without a third party service. Log sensor data, send data by pressing a button, and receive data from a Google spreadsheet. (NodeMCU, Wemos D1 mini, Adafruit Feather HUZZAH, etc)
145 stars 32 forks source link

ESP Stuck on Sudden Internet Failure #3

Closed subhasis-manna closed 3 years ago

subhasis-manna commented 3 years ago

Hi, Thank for the great library. I am facing a minor issue while upload the sensor data to google sheet. In case of sudden internet failure ESP got Stuck in Following lines of Program.

Part of Code..

// Publish data to Google Sheets
  Serial.println("Publishing data...");
  Serial.println(payload);
  if(client->POST(url, host, payload)){ 
    // do stuff here if publish was successful
  }
  else{
    // do stuff here if publish was not successful
    Serial.println("Error while connecting");
  }

Serial Monitor Display 17:05:51.223 -> Publishing data... 17:05:51.223 -> {"command": "insert_row", "sheet_name": "Sheet1", "values": "28.00,30.00,14,SCAQI211101"}

Is there any way to set any time out for this command

 if(client->POST(url, host, payload)){ 
    // do stuff here if publish was successful
  }

Any Assistance will be helpful.

StorageB commented 3 years ago

Hello @subhasis-manna

The request to send and receive data from Google Sheets is handled by the HTTPSRedirect library: https://github.com/electronicsguy/HTTPSRedirect

Any sort of modification to how the request is carried out would have to be done within that library.

subhasis-manna commented 3 years ago

Thank You..