I am not sure if you can help me but following How to post data to Google sheets using ESP8266 | Embedded Lab . Complete code attached.
I have updated the HttpsRedirect library as requested in the tutorial but now I get the following when verifying the code:
/home/test/Dropbox/Transfer/WorkingOn/WeatherStation - Dad/WeatherStationBMP280-GSheets/WeatherStationBMP280-GSheets.ino: In function 'void postData(String, float)': WeatherStationBMP280-GSheets:90:52: error: no matching function for call to 'HTTPSRedirect::printRedir(String&, const char*&, const char*&)' client.printRedir(urlFinal, host, googleRedirHost); ^
/home/test/Dropbox/Transfer/WorkingOn/WeatherStation - Dad/WeatherStationBMP280-GSheets/WeatherStationBMP280-GSheets.ino:90:52: note: candidate is: In file included from /home/test/Dropbox/Transfer/WorkingOn/WeatherStation - Dad/WeatherStationBMP280-GSheets/WeatherStationBMP280-GSheets.ino:9:0: /home/test/Arduino/libraries/HTTPSRedirect/HTTPSRedirect.h:48:10: note: bool HTTPSRedirect::printRedir() bool printRedir(void);
^/home/test/Arduino/libraries/HTTPSRedirect/HTTPSRedirect.h:48:10: note: candidate expects 0 arguments, 3 provided exit status 1 no matching function for call to 'HTTPSRedirect::printRedir(String&, const char*&, const char*&)'
The HTTPSRedirect Library is taken from: ESP8266/HTTPSRedirect at master · electronicsguy/ESP8266 · GitHub. I am not sure how to change the code below to accommodate the updated library.
This is the call where this issue is happening
void postData(String tag, float value) {
if (!client.connected()) {
Serial.println("Connecting to client again…");
client.connect(host, httpsPort);
}
String urlFinal = url + "tag = " + tag + "&value = " + String(value);
client.printRedir(urlFinal, host, googleRedirHost); //This is the line where the error is highlighted
}
My declarations are as follows:
const char* googleRedirHost = "script.googleusercontent.com";
const int httpsPort = 443;
HTTPSRedirect client(httpsPort);
// Prepare the url (without the varying data)
String url = String(" / macros / s / ") + GScriptId + " / exec ? ";```
WeatherStationBMP280-GSheets.ino (2.66 KB)