Arduino Mega+ESP8266 ESP-01S sending data to Google Sheets

Yes. I'm trying to build it for the Arduino Mega because I've already got the code for collecting the sensor data and sending it to the Remotexy app done.

This is the code that I've got so far:

#define REMOTEXY_MODE__ESP8266_HARDSERIAL_CLOUD

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL Serial1
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "xxx"
#define REMOTEXY_WIFI_PASSWORD "xxx"
#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN "xxx"

//Temperatura
const double VCC = 3.3;
const double R1 = 9850;            // 10k ohm series resistor
const double adc_resolution = 4096;
const double A = 0.001129148;
const double B = 0.000234125;
const double C = 0.0000000876741;
int TempS1 = 99;

//Reflectoare
int LightS = A0; // Fotorezistor
int LightR = 7; // Releu reflectoare
int MotionSensor1 = 8;
int MotionSensor2 = 9;
int MotionSensor3 = 10;
int MotionSensor4 = 11;
int LightStat;
int LightV;
int LightM;
unsigned long onDuration = 90000;// OFF time for LED
unsigned long offDuration = 10000;// ON time for LED
unsigned long rememberTime=0;// this is used by the code
int LEDState = HIGH;
unsigned long secunda = 1000;
unsigned long timp = 0;
int contor = 0;


//Vant
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 1000;    // the debounce time; increase if the output flickers
int pinInterrupt = 2; //senzor vant
int Count = 0;
int Vant;
int VantMax = 0;

//Alarma
int MotionSensor = 4; // Senzor miscare
int MotionSignal = 5; // Semnal sirena

//Apa
int ReleuApaGeneralSemnal = 12;
int ReleuApaGeneralStat;

//Ploaie
#define CALC_INTERVAL 1000
#define DEBOUNCE_TIME 15*1000
const int RainSensor = 3;
float TotalVolume = 0;
long NrTips = 0;
long last_micros_rg;
long nextCalc;
long Cronometru;
int PloaieReset;

// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 418 bytes
  { 255,5,0,27,0,155,1,16,30,5,130,1,255,2,65,96,0,31,129,0,
  4,251,53,6,0,13,65,117,116,111,109,97,116,105,122,97,114,101,32,99,
  117,114,116,101,0,131,1,1,99,21,7,1,13,31,71,101,110,101,114,97,
  108,0,130,0,0,2,16,18,1,31,67,6,1,7,7,4,1,135,31,4,
  129,0,8,7,4,2,1,135,75,77,47,72,0,129,0,1,3,13,3,1,
  8,86,195,162,110,116,32,77,97,120,0,129,0,1,11,13,3,1,8,86,
  195,162,110,116,32,76,105,118,101,0,67,6,1,15,7,4,1,135,31,4,
  129,0,8,15,4,2,1,135,75,77,47,72,0,130,0,16,2,23,11,1,
  31,70,16,17,6,6,6,1,16,135,0,10,50,24,6,14,6,1,0,31,
  31,79,78,0,0,79,70,70,0,129,0,19,3,16,3,1,8,82,101,102,
  108,101,99,116,111,97,114,101,0,130,0,16,13,23,18,1,31,129,0,22,
  14,10,3,1,8,65,108,97,114,109,196,131,0,10,50,25,24,12,6,1,
  1,31,31,79,78,0,1,79,70,70,0,70,16,18,24,6,6,1,16,37,
  0,130,0,0,20,16,14,1,31,1,2,2,29,11,4,0,31,164,82,101,
  115,101,116,0,129,0,3,21,8,3,1,8,80,108,111,97,105,101,0,67,
  2,0,25,9,4,0,164,31,6,129,0,9,24,5,3,0,164,76,105,116,
  114,105,0,130,0,16,31,23,10,1,31,129,0,25,32,5,3,1,8,65,
  112,196,131,0,10,50,18,17,19,6,1,1,31,31,65,114,109,97,116,196,
  131,0,1,68,101,122,97,114,109,97,116,196,131,0,10,50,27,36,10,4,
  1,6,31,31,79,78,0,6,79,70,70,0,129,0,18,37,7,2,1,8,
  71,101,110,101,114,97,108,0,67,6,16,41,23,6,0,135,26,11 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t Reflectoare_B; // =1 if state is ON, else =0 
  uint8_t Alarma; // =1 if state is ON, else =0 
  uint8_t PloaieReset; // =1 if button pressed, else =0 
  uint8_t Alarma_A; // =1 if state is ON, else =0 
  uint8_t ApaGeneral; // =1 if state is ON, else =0 

    // output variables
  char Vant_Max[4];  // string UTF8 end zero 
  char Vant_Live[4];  // string UTF8 end zero 
  uint8_t Reflectoare_L; // led state 0 .. 1 
  uint8_t Alarma_L; // led state 0 .. 1 
  char Litri[6];  // string UTF8 end zero 
  char text_1[11];  // string UTF8 end zero 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

void setup() {
  Serial.begin(115200);
  delay(2000);
  RemoteXY_Init ();
  delay(1000);

  pinMode(2,INPUT);
  pinMode(3,INPUT);
  pinMode(4,INPUT);
  pinMode(5,OUTPUT);
  pinMode(A0,INPUT);
  pinMode(7,OUTPUT);
  pinMode(8,INPUT);
  pinMode(9,INPUT);
  pinMode(10,INPUT);
  pinMode(11,INPUT);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);

  //Pini de la 14-19 pt Serial comunication. 18, 19 conectat esp-ul
  
  digitalWrite(LightR,HIGH);
  digitalWrite(ReleuApaGeneralSemnal,HIGH);
  //timer.setInterval(1000L, sendSensor);

  //interrupt vant
  pinMode( pinInterrupt, INPUT_PULLUP);// set the interrupt pin
  attachInterrupt( digitalPinToInterrupt(pinInterrupt), CounterVant, FALLING);

  //interrupt ploaie
  attachInterrupt(digitalPinToInterrupt(RainSensor), Ploaie, RISING);
}

void loop() {
  RemoteXY_Handler ();

//START Vant  
  if ((millis() - lastDebounceTime) > debounceDelay)
  {
    lastDebounceTime = millis();
    Vant=((Count * 8.75)/100)*3.6;
    Count = 0;
    itoa (Vant, RemoteXY.Vant_Live, 10);
    if (Vant > VantMax) {
        VantMax = Vant;
        itoa (VantMax, RemoteXY.Vant_Max, 10);
    }    
  }
//STOP Vant

//START Reflectoare
  LightV = analogRead(LightS);
  //itoa (LightV, RemoteXY.Senzor_Lumina, 10);
if (RemoteXY.Reflectoare_B == 1) {
  digitalWrite(LightR, LOW);
} else {
  if (LightV > 900) {
  RemoteXY.Reflectoare_L = 1;
      if( LEDState == HIGH ){
        if( (millis()- rememberTime) >= onDuration){   
          LEDState = LOW;// change the state of LED
          rememberTime=millis();// remember Current millis() time
        }
      } else {   
        if( (millis()- rememberTime) >= offDuration){     
        LEDState = HIGH;// change the state of LED
        rememberTime=millis();// remember Current millis() time
        }
      }

 digitalWrite(LightR, LEDState);// turn the LED ON or OFF

    /*
    if (digitalRead(MotionSensor1) == HIGH){
      digitalWrite(LightR,LOW);
      RemoteXY.Reflectoare_L = 1;
      } else {
          if (digitalRead(MotionSensor2) == HIGH){
            digitalWrite(LightR,LOW);
            RemoteXY.Reflectoare_L = 1;
          } else {
              if (digitalRead(MotionSensor3) == HIGH){
                digitalWrite(LightR,LOW);
                RemoteXY.Reflectoare_L = 1;
              } else {
                  if (digitalRead(MotionSensor4) == HIGH){
                    digitalWrite(LightR,LOW);
                    RemoteXY.Reflectoare_L = 1;
                  } else {
                      digitalWrite(LightR,HIGH);
                      RemoteXY.Reflectoare_L = 0;
                        }
                     }
                  }
              }
    */
    
    } else {
      digitalWrite(LightR,HIGH);
      RemoteXY.Reflectoare_L = 0;
    }

if (LightV > 900) {
  if( (millis() - timp) >= secunda){
    timp = millis();
    if (digitalRead(MotionSensor1) == HIGH){
      contor = contor + 1;
      itoa (contor, RemoteXY.text_1, 10);
      Serial.println(contor);
    }
  }
}  

}
//STOP Reflectoare

//START Alarma
  if (RemoteXY.Alarma_A == 1) {
    if (RemoteXY.Alarma == 1) {
      digitalWrite(MotionSignal,HIGH);
      RemoteXY.Alarma_L = 1;
      } else {
        if (digitalRead(MotionSensor) == 1) {
        digitalWrite(MotionSignal,HIGH);
        RemoteXY.Alarma_L = 1; 
        } else {
        digitalWrite(MotionSignal,LOW);
        RemoteXY.Alarma_L = 0;
        } 
      }
  } else {
    RemoteXY.Alarma = 0;
    digitalWrite(MotionSignal,LOW);
    RemoteXY.Alarma_L = 0;
  }
//STOP Alarma

//START Ploaie
  Cronometru = millis();
  if(Cronometru > nextCalc) {
    nextCalc = Cronometru + CALC_INTERVAL;
    itoa (TotalVolume, RemoteXY.Litri, 10);
  }
  if (RemoteXY.PloaieReset == 1){
    NrTips = 0;
    TotalVolume = 0;
  }
//STOP Ploaie

//START Apa
  if (RemoteXY.ApaGeneral == 1) {
    digitalWrite(ReleuApaGeneralSemnal,LOW);
    } else {
        digitalWrite(ReleuApaGeneralSemnal,HIGH);
    }
//STOP Apa

} // END LOOP



void CounterVant()
{
  if ( digitalRead(pinInterrupt) == LOW )
    Count++;
}

void Ploaie() {
  if((long)(micros() - last_micros_rg) >= DEBOUNCE_TIME) { 
    NrTips += 1;
    TotalVolume = NrTips*(0.00165/0.0055);
    last_micros_rg = micros();
  }  
}

looks like you need to add code to the Mega to transmit data over Serial1 to the ESP-01 (see post 4)
the ESP-01 receives the data and transmits it to googlesheets - see post 18 from @StorageB

I think that the solution post 4 will conflict with the remotexy coding. I think the library is configured to use the mega and esp8266 with the certain firmware on it.

I have found something that I think will help me. Link

I habe modify the code as follow

#include "WiFiEsp.h"

#ifndef HAVE_HWSERIAL1
#endif

char ssid[] = "George12";            // your network SSID (name)
char pass[] = "xxx";        // your network password
int status = WL_IDLE_STATUS;     // the Wifi radio's status

char server[] = "script.google.com";
const String URI = "/macros/s/.../exec?v1=4";

// Initialize the Ethernet client object
WiFiEspClient client;

void setup(){
  // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(115200);
  // initialize ESP module
  WiFi.init(&Serial1);

  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue
    while (true);
  }

  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
  }

  // you're connected now, so print out the data
  Serial.println("You're connected to the network");

  if (client.connect(server, 80)) {
    Serial.println(F("con..."));
    // send the HTTP GET request:
    client.println("POST " + URI + " HTTP/1.1");
    client.println("Host: " + String(server));
    client.println("Content-Type: application/json");
    client.print("Content-Length: ");

    // note the time that the connection was made:

  } else {
    // if you couldn't make a connection:
    Serial.println(F("con failed"));
  }

  Serial.println("Disconnecting from server...");
  client.stop();
}

void loop(){

}

but I get stuck at the connecting to server part.

[WiFiEsp] Initializing ESP module
[WiFiEsp] Initilization successful - 1.5.4
Attempting to connect to WPA SSID: George12
[WiFiEsp] Connected to George12
You're connected to the network
[WiFiEsp] Connecting to script.google.com
[WiFiEsp] >>> TIMEOUT >>>
con failed
Disconnecting from server...

Hello. I'm using a ESP32 and I'm trying to send data to 2 different google sheets and I have problem with the second one.

Here is the complete code:

#define REMOTEXY_MODE__ESP32CORE_WIFI_CLOUD
#include <WiFi.h>
#include <HTTPClient.h>
#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID "xxx"
#define REMOTEXY_WIFI_PASSWORD "xxx"
#define REMOTEXY_CLOUD_SERVER "cloud.remotexy.com"
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN "xxx"
#define RXp2 16
#define TXp2 17

//Reflectoare
int LightS = 34; // Fotorezistor
int LightR = 5; // Releu reflectoare
int MotionSensor1 = 18;
int MotionSensor2 = 19;
int MotionSensor3 = 21;
int MotionSensor4 = 22;
int LightStat;
int LightV;
int LightM;
unsigned long onDuration = 90000;// OFF time for LED
unsigned long offDuration = 10000;// ON time for LED
unsigned long rememberTime=0;// this is used by the code
int LEDState = HIGH;
unsigned long IntervalReflectoare = 1000;
unsigned long TimpReflectoare = 0;
unsigned long IntervalReflectoareT = 1000;
unsigned long TimpReflectoareT = 0;
int ContorReflectorT = 0;


//Vant
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 1000;    // the debounce time; increase if the output flickers
int pinInterrupt = 35; //senzor vant
int Count = 0;
int Vant;
int VantMax = 0;

//Alarma
int MotionSensor = 23; // Senzor miscare
int MotionSignal = 32; // Semnal sirena

//Ploaie
#define CALC_INTERVAL 1000
#define DEBOUNCE_TIME 15*1000
const int RainSensor = 33;
float TotalVolume = 0;
long NrTips = 0;
long last_micros_rg;
long nextCalc;
long Cronometru;
int PloaieReset;

//Google Sheets
unsigned long IntervalGoogleSheetsVP = 1000;
unsigned long TimpGoogleSheetsVP = 0;
String urlVP;

unsigned long IntervalGoogleSheetsTU = 20000;
unsigned long TimpGoogleSheetsTU = 0;
String urlTU;

// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 363 bytes
  { 255,4,0,27,0,100,1,16,30,5,130,1,255,2,65,96,0,31,129,0,
  4,251,53,6,0,13,65,117,116,111,109,97,116,105,122,97,114,101,32,99,
  117,114,116,101,0,131,1,1,99,21,7,1,13,31,71,101,110,101,114,97,
  108,0,130,0,0,2,16,18,1,31,67,6,1,7,7,4,1,135,31,4,
  129,0,8,7,4,2,1,135,75,77,47,72,0,129,0,1,3,13,3,1,
  8,86,195,162,110,116,32,77,97,120,0,129,0,1,11,13,3,1,8,86,
  195,162,110,116,32,76,105,118,101,0,67,6,1,15,7,4,1,135,31,4,
  129,0,8,15,4,2,1,135,75,77,47,72,0,130,0,39,2,23,11,1,
  31,70,16,40,6,6,6,1,16,135,0,10,50,47,6,14,6,1,0,31,
  31,79,78,0,0,79,70,70,0,129,0,42,3,16,3,1,8,82,101,102,
  108,101,99,116,111,97,114,101,0,130,0,16,2,23,18,1,31,129,0,22,
  3,10,3,1,8,65,108,97,114,109,196,131,0,10,50,25,13,12,6,1,
  1,31,31,79,78,0,1,79,70,70,0,70,16,18,13,6,6,1,16,37,
  0,130,0,0,20,29,9,1,31,1,2,17,24,11,4,0,31,164,82,101,
  115,101,116,0,129,0,11,21,8,3,1,8,80,108,111,97,105,101,0,67,
  2,0,25,9,4,0,164,31,6,129,0,9,24,5,3,0,164,76,105,116,
  114,105,0,10,50,18,6,19,6,1,1,31,31,65,114,109,97,116,196,131,
  0,1,68,101,122,97,114,109,97,116,196,131,0,67,6,40,22,20,5,1,
  135,26,11 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t Reflectoare_B; // =1 if state is ON, else =0 
  uint8_t Alarma; // =1 if state is ON, else =0 
  uint8_t PloaieReset; // =1 if button pressed, else =0 
  uint8_t Alarma_A; // =1 if state is ON, else =0 

    // output variables
  char Vant_Max[4];  // string UTF8 end zero 
  char Vant_Live[4];  // string UTF8 end zero 
  uint8_t Reflectoare_L; // led state 0 .. 1 
  uint8_t Alarma_L; // led state 0 .. 1 
  char Litri[6];  // string UTF8 end zero 
  char text_1[11];  // string UTF8 end zero 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

void setup() {
  Serial.begin(115200);
  Serial2.begin(115200, SERIAL_8N1, RXp2, TXp2);

  delay(1000);
  RemoteXY_Init ();
  delay(1000);

  pinMode(5,OUTPUT);
  pinMode(18,INPUT);
  pinMode(19,INPUT);
  pinMode(21,INPUT);
  pinMode(22,INPUT);
  pinMode(23,INPUT);
  pinMode(32,OUTPUT);
  pinMode(34,INPUT);
  pinMode(35,INPUT);
  
  digitalWrite(LightR,HIGH);

  //interrupt vant
  pinMode( pinInterrupt, INPUT_PULLUP);// set the interrupt pin
  attachInterrupt( digitalPinToInterrupt(pinInterrupt), CounterVant, FALLING);

  //interrupt ploaie
  attachInterrupt(digitalPinToInterrupt(RainSensor), Ploaie, RISING);

  //Google Sheets

}

void loop() {
  RemoteXY_Handler ();

//START Vant  
  if ((millis() - lastDebounceTime) > debounceDelay)
  {
    lastDebounceTime = millis();
    Vant=((Count * 8.75)/100)*3.6;
    Count = 0;
    itoa (Vant, RemoteXY.Vant_Live, 10);
    if (Vant > VantMax) {
        VantMax = Vant;
        itoa (VantMax, RemoteXY.Vant_Max, 10);
    }    
  }
//STOP Vant

//START Reflectoare
if( (millis() - TimpReflectoare) >= IntervalReflectoare){
TimpReflectoare = millis();

  LightV = analogRead(LightS);

  if (RemoteXY.Reflectoare_B == 1) {
    digitalWrite(LightR, LOW);
  } else {
    if (LightV > 900) {
    RemoteXY.Reflectoare_L = 1;
        if( LEDState == HIGH ){
          if( (millis()- rememberTime) >= onDuration){   
            LEDState = LOW;// change the state of LED
            rememberTime=millis();// remember Current millis() time
          }
       } else {   
         if( (millis()- rememberTime) >= offDuration){     
         LEDState = HIGH;// change the state of LED
         rememberTime=millis();// remember Current millis() time
         }
       }

   digitalWrite(LightR, LEDState);// turn the LED ON or OFF

    /*
    if (digitalRead(MotionSensor1) == HIGH){
      digitalWrite(LightR,LOW);
      RemoteXY.Reflectoare_L = 1;
      } else {
          if (digitalRead(MotionSensor2) == HIGH){
            digitalWrite(LightR,LOW);
            RemoteXY.Reflectoare_L = 1;
          } else {
              if (digitalRead(MotionSensor3) == HIGH){
                digitalWrite(LightR,LOW);
                RemoteXY.Reflectoare_L = 1;
              } else {
                  if (digitalRead(MotionSensor4) == HIGH){
                    digitalWrite(LightR,LOW);
                    RemoteXY.Reflectoare_L = 1;
                  } else {
                      digitalWrite(LightR,HIGH);
                      RemoteXY.Reflectoare_L = 0;
                        }
                     }
                  }
              }
    */
    
    } else {
      digitalWrite(LightR,HIGH);
      RemoteXY.Reflectoare_L = 0;
    }
  }
}

if (LightV > 900) {
  if( (millis() - TimpReflectoareT) >= IntervalReflectoareT){
    TimpReflectoareT = millis();
    if (digitalRead(MotionSensor1) == HIGH){
      ContorReflectorT = ContorReflectorT + 1;
      itoa (ContorReflectorT, RemoteXY.text_1, 10);
      Serial.println(ContorReflectorT);
    }
  }
}  


//STOP Reflectoare

//START Alarma
  if (RemoteXY.Alarma_A == 1) {
    if (RemoteXY.Alarma == 1) {
      digitalWrite(MotionSignal,HIGH);
      RemoteXY.Alarma_L = 1;
      } else {
        if (digitalRead(MotionSensor) == 1) {
        digitalWrite(MotionSignal,HIGH);
        RemoteXY.Alarma_L = 1; 
        } else {
        digitalWrite(MotionSignal,LOW);
        RemoteXY.Alarma_L = 0;
        } 
      }
  } else {
    RemoteXY.Alarma = 0;
    digitalWrite(MotionSignal,LOW);
    RemoteXY.Alarma_L = 0;
  }
//STOP Alarma

//START Ploaie
  Cronometru = millis();
  if(Cronometru > nextCalc) {
    nextCalc = Cronometru + CALC_INTERVAL;
    itoa (TotalVolume, RemoteXY.Litri, 10);
  }
  if (RemoteXY.PloaieReset == 1){
    NrTips = 0;
    TotalVolume = 0;
  }
//STOP Ploaie

//START Google Sheets
  //Vant si Ploaie
  if( (millis() - TimpGoogleSheetsVP) >= IntervalGoogleSheetsVP){
  TimpGoogleSheetsVP = millis();

  urlVP += "https://script.google.com/macros/s/";
  urlVP += "xxx";
  urlVP += "/exec?";
  urlVP += "Vant=";
  urlVP += String(Vant);
  urlVP += "&Ploaie=";
  urlVP += String(TotalVolume);

  HTTPClient httpPV;
  httpPV.begin(urlVP);
  int httpResponseCode1 = httpPV.GET();
  }
  urlVP = "";

here is the code that is the problem:

//Temperaturi si Umiditati
  if( (millis() - TimpGoogleSheetsTU) >= IntervalGoogleSheetsTU){
  TimpGoogleSheetsTU = millis();

  urlTU += "https://script.google.com/macros/s/";
  urlTU += "xxx";
  urlTU += "/exec?";
  urlTU += String(Serial2.readString());
  Serial.println(urlTU);
  HTTPClient httpTU;
  httpTU.begin(urlTU);
  int httpResponseCode2 = httpTU.GET();
  urlTU = "";

I have printed to the serial monitor the URL and if I copy-paste it in a browser that works.

I'm sorry, I can't see that inside your "complete code" because it isn't "complete" at all (the last line is "urlVP = "";" and nothing more)...
Please edit your post to include the complete code, and add some more information about the problem (what "problem"? The code executes but you don't see the values? The code executes but the GET fails (in this case, what is the response code you receive)?

The code is compliant. It only misses the last "}". The problem was that the data was not send to the Google Sheets. I have figured it out myself. The problem was that the " Serial2.readString()" was giving an additional blank line. I've added a trim() function and that resolve the problem.

No it doesn't. The only section about google is the last one:

//START Google Sheets
  //Vant si Ploaie
  if( (millis() - TimpGoogleSheetsVP) >= IntervalGoogleSheetsVP){
  TimpGoogleSheetsVP = millis();

  urlVP += "https://script.google.com/macros/s/";
  urlVP += "xxx";
  urlVP += "/exec?";
  urlVP += "Vant=";
  urlVP += String(Vant);
  urlVP += "&Ploaie=";
  urlVP += String(TotalVolume);

  HTTPClient httpPV;
  httpPV.begin(urlVP);
  int httpResponseCode1 = httpPV.GET();
  }
  urlVP = "";

and even if you add the closing curly bracket it doesn't include that "TimpGoogleSheetsTU" if() statement you're complaining about.

Sure it does, it is described on the reference:

The returned String may contain carriage return and/or line feed characters if they were received.

That means you must remove line terminators and that's what I'd tell you once you post a complete code.
For the future instead of being so touchy, remember to include a full and compiling code so we can not only check its complete structure, but also directly tell you what is to be checked. Take it easy and have a good coding.

@georgepa,

Your two or more topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.