Hi All,
So I'm trying to sent a GET to a Google sheet using this code:
if (client.connectSSL(WEBSITE, 443))
{
String URL = (String) "GET " + "/macros/s/AKfycbzS6lHOD599uMOBJamBLbxypxSuYgnwveNrRB4ldpwovt4qRlAoBP2HpsHD2wQaR7SY/exec?"
+ "temp=" + (String) temperature
+ "&humid=" + (String) humidity
+ "&illum=" + (String) illuminance
+ "&moist=" + (String) moisture
+ "&lights=" + (String) lightsS
+ "&fan=" + (String) fanS
+ "&flag=" + (String) flagS;
Serial.println(URL);
client.println(URL);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(WEBSITE);
client.println("User-Agent: MKR1000/1.0");
client.println();
Serial.println("\nData Sent");
} else {
Serial.println("Error connecting to website.");
Serial.println(WEBSITE);
}
WEBSITE is script.google.com
It appears to work ok, but no data is getting through. I follow it with:
while(client.available()){
String line = client.readStringUntil('\r');
Serial.println(line);
}
but no data is returned. When I copy the code and paste it into Chrome, I get an OK returned and the data is fed from the script into the spreadsheet.
Any thoughts much appreciated!