Unable to connect to script.google.com

Hello experts..

I am using wemos D1 to update multiple sensor data on Google spreadsheet using 4051IC.. but every time my serial monitor says connection failed.. and I am not able to connect to script.google.com :(

Please suggest a solution.

Thanks in advance. :)

Start by posting your code

Thanks for prompt reply sir… This is what I am writing…

//https://script.google.com/macros/s/AKfycbwnjWGj4E1AGmi-EZ2rgG7CUaePn7LiuzRbRsQfBJNcngUKmXcx/exec
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>

const char *ssid = “WiFi SSID”;
const char password = “WiFi PASSWORD”;
const char
host = “script.google.com”;
String url;

void setup()
{
pinMode(D1, OUTPUT);
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT);
Serial.begin(115200);
delay(100);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println(“WiFi connected”);
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
Serial.print("Netmask: ");
Serial.println(WiFi.subnetMask());
Serial.print("Gateway: ");
Serial.println(WiFi.gatewayIP());
}

void loop()
{
Serial.print("connecting to ");
Serial.println(host);

WiFiClientSecure client;

const int httpPort = 443;
if (!client.connect(host, httpPort))
{
Serial.println(“connection failed”);
return;
}
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
float t = analogRead(A0);
delay(1000);
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, HIGH);
float r = analogRead(A0);
delay(1000);
digitalWrite(D1, LOW);
digitalWrite(D2, HIGH);
digitalWrite(D3, LOW);
float c = analogRead(A0);
delay(1000);
PrintData();
delay(5000);
}

void PrintData()
{
WiFiClientSecure client;
float t;
float r;
float c;
url = “macros/s/AKfycbwnjWGj4E1AGmi-EZ2rgG7CUaePn7LiuzRbRsQfBJNcngUKmXcx/exec?func=addData&val=”+ String(t) + String(r) + String(c);
Serial.print("Requesting URL: ");
Serial.println(url);

client.print(String("GET “) + url + " HTTP/1.1\r\n” +
"Host: " + host + “\r\n” +
“Connection: close\r\n\r\n”);
delay(500);
String section=“header”;
while(client.available())
{
String line = client.readStringUntil(’\r’);
Serial.print(line);
}
Serial.println();
Serial.println(“closing connection”);
}

I had the same problem. You only have to downgrade the esp8266 version at 2.4.2 from the Board Manager