WiFi - Get method only working ONCE

dear community,

I am using the Arduino Uno R4 WiFi

I wrote a script that should switch my alarm system ON or OFF via ITFFF Link.
This happens by generating a web request via GET.
This also works in principle.
I can turn the alarm system ON.
But when I call the function later in the program that is supposed to switch off the alarm system again, this second GET is no longer passed.
I don't get any more "disconnect" messages.

Where could the (thinking) mistake lie?

//Funktion, welche Alarmanlagenszene abspielt
void Alarmanlage_AN() {
  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  wlan_ini();
  if (client.connect(server, 443)) {
    Serial.println("connected to server um einzuschalten");
    // Make a HTTP request zum Anschalten:
    client.println("GET /v1/hc/gateways/<number>/scenes/Alarm_AN?key=<key>&uuid=<uuid> HTTP/1.1");
    client.println("Host: www.mydevolo.com");
    client.println("Connection: close");
    client.println();

// if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting from server.");
    client.stop();
  } 
  }
}

void Alarmanlage_AUS() { 
    wlan_ini();
    if (client.connect(server, 443)) {
    Serial.println("connected to server um abzuschalten");
    // Make a HTTP request zum Ausschalten:
    client.println("GET /v1/hc/gateways/<number>/scenes/Alarm_AUS?key=<key>&uuid=<uuid> HTTP/1.1");
    client.println("Host: www.mydevolo.com");
    client.println("Connection: close");
    client.println();

// if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting from server.");
    client.stop();
    } 
  }
}

I've edited the links in the script above to secure my personal data.

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