I am having a problem using the esp 01 and the apps script link, since it moves all the time and doesnt execute.
`#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
const char* ssid = "MEO-4BF040";
const char* password = "2badd17ce2";
void exec(){
const char *url = "http://script.google.com/macros/s/-----------------------------/exec";
WiFiClient ue;
HTTPClient http;
http.begin(ue, url); //Specify request destination
int httpCode = http.GET(); //Send the request
//Check the returning code
String payload = http.getString();
//Print the response payload
Serial.println(payload);
if (httpCode > 0)
{
//Get the request response payload
String payload = http.getString();
//Print the response payload
Serial.println(payload);
}
//Close connection
http.end();
}
void setup() {
Serial.begin(115200);
delay(10);
// Configurar o modo de operação para o modo Station (ST)
WiFi.mode(WIFI_STA);
// Conectar-se à rede Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Conectando ao WiFi...");
}
Serial.println("Conectado à rede Wi-Fi");
Serial.println(WiFi.localIP());
exec();
}
void loop() {
// Seu código para acessar URLs via HTTP pode ser colocado aqui
}
`
The response is this
<HEAD>
<TITLE>Moved Permanently</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Permanently</H1>
The document has moved <A HREF="https://script.google.com/macros/s/-----------------------------/exec">here</A>.
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Moved Permanently</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Permanently</H1>
The document has moved <A HREF="https://script.google.com/macros/s/---------------------/exec">here</A>.
</BODY>
</HTML>