Duda Arduino Get PHP y leer resultado

Hola
Tengo un Arduino UNO, un teclado 4x4 y un relé.
Necesito cada código que dígito, buscarlo en una web con una Get PHP y leer el valor que me devuelve, si es 0 o 1, y según este valor encender o apagar el Relé

El teclado ya está conectado y ya tengo el fichero PHP con la query. La Get que le paso es del estilo http://miservidor.com/upload.php?A=1234, él busca en la Base de Datos y me devuelve un 0 o 1 ( echo "1":wink:

Es posible activar el relé "leyendo" este valor?

He encotrado un ejemplo parecido, tendría que hacer algo así?

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0x11, 0xAC };
byte ip[] = { 192, 168, 1, 19 };
byte server[] = { 192,168,1,33 };

Client client(server, 80);

void setup()
{
 Ethernet.begin(mac, ip);
 Serial.begin(9600);
 Serial.println("Coneccion Cliente");
 Serial.println();

 delay(1000);

 Serial.println("connecting...");

 if (client.connect()) {
   Serial.println("connected");
   //client.println("GET /arduino.txt HTTP/1.0");
   client.println("GET /http://miservidor.com/upload.php?A=1234 HTTP/1.0"); 
   client.println();
 } else {
   Serial.println("connection failed");
 }
}

void loop()
{
 if (client.available()) {
   char c = client.read();
   Serial.print(c);
 }

 if (!client.connected()) {
   
   
   Serial.println();
   Serial.println("disconnecting.");
   Serial.println("");
   client.stop();
   for(;;);
 }
}

Gracias!

Al final lo he desarrollado, os paso aquí el código por si le hace falta a alguien.

El INPUT es un código que se digita en un teclado 4x4, que va conectado a un NodeMCU Lua V3 ESP8266.
Este código se busca en una base de datos usando un GET a un fichero PHP, que realiza la query y si lo encuentra en la base de datos devuelve un "1".

Una vez leído el 1, el NodeMCU va conectado por el pin VU a un relé, que acciona la puerta

// 0 ES EL CARACTER DE RESET. TODAS LAS PASSWORD EMPIEZAN POR 0 Y NINGUNA CONTIENE 0

//LO DEL RELE ES EL CONTRARIO, LOW LO ACTIVA
//EL NODEMCU COGE LOS 5V DEL VU


#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecureBearSSL.h>
#include <Keypad.h> 

int Rele = 15;


///WIFI///////

const char *ssid = "XXXXXXXX";  //ENTER YOUR WIFI SETTINGS
const char *password = "XXXXXXX";

const char *host = "miweb.com";  
const int httpsPort = 443;  //HTTPS= 443 and HTTP = 80

//certificado de miweb.com ya que es un https
const char fingerprint[] PROGMEM = "XX XX XX XX XX etc";

/////TECLADO


char codigo[6];            //Cadna donde se guardaran los caracteres de las teclas presionadas
int cont=0;          //variable que se incrementara al presionar las teclas

const byte ROWS = 4; //Numero de filas del teclado que se esta usando
const byte COLS = 4; //Numero de columnas del teclado que se esta usando

char hexaKeys[ROWS][COLS] =  //Aquí pondremos la disposición de los caracteres tal cual están en nuestro teclado
{
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {D4, D5, D6, D7};
byte colPins[COLS] = {D0, D1, D2, D3};

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); //inicializa el teclado



void setup() {


  pinMode(Rele, OUTPUT);
  digitalWrite(Rele, HIGH);
  
  Serial.begin(9600); //inicializar puerto serie
  
pinMode(5, OUTPUT); 
digitalWrite(5, LOW);
  
  delay(1000);
  Serial.begin(115200);
  WiFi.mode(WIFI_OFF);        //Prevents reconnection issue (taking too long to connect)
  delay(1000);
  WiFi.mode(WIFI_STA);        //This line hides the viewing of ESP as wifi hotspot
  
  WiFi.begin(ssid, password);     //Connect to your WiFi router
  Serial.println("");

  Serial.print("Connecting");
  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
   delay(1000);
Serial.print(".");
  }

  //If connection successful show IP address in serial monitor
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());  //IP address assigned to your ESP
}

//=======================================================================
//                    Main Program Loop
//=======================================================================
void loop() {


char customKey = customKeypad.getKey(); //se guarda en la variable customKey el caracter de la tecla presionada
if (customKey != NO_KEY)         //se evalúa si se presionó una tecla
  {
    codigo[cont]=customKey;          //se guarda caracter por caracter en el arreglo codigo[]
    Serial.println(codigo[cont]);    //se imprime en el puerto serie la tecla presionada
    cont=cont+1; 
    
     if(customKey=='0')
     {
       cont=0;  
     }
    
    if(cont==6)          //si ya fueron presionadas 6 teclas se evalúa si la contraseña es correcta
    {

            WiFiClientSecure httpsClient; 
            
            //Serial.println(host);
             
              //Serial.printf("Using fingerprint '%s'\n", fingerprint);
              httpsClient.setFingerprint(fingerprint);
              httpsClient.setTimeout(15000); // 15 Seconds
              //delay(1000);
              
              //Serial.print("HTTPS Connecting");
              int r=0; //retry counter
              while((!httpsClient.connect(host, httpsPort)) && (r < 30)){
                  delay(100);
                  Serial.print(".");
                  r++;
              }
              if(r==30) {
                //Serial.println("Connection failed");
              }
              else {
                //Serial.println("Connected to web");
              }
            
            
              String code, Link;
              int i; 
              for (i = 0; i < 6; i++) { 
                 code = code + codigo[i]; 
               } 
                          
              Link = "/miscript.php?aid=" + code;
                      
              
             //Serial.print("requesting URL: ");
              //Serial.println(host+Link);
             
              httpsClient.print(String("GET ") + Link + " HTTP/1.1\r\n" +
                           "Host: " + host + "\r\n" +               
                           "Connection: close\r\n\r\n");
             
              //Serial.println("request sent");
                              
              while (httpsClient.connected()) {
                String line = httpsClient.readStringUntil('\n');
                if (line == "\r") {
                  //Serial.println("headers received");
                  break;
                }
              }
             
              //Serial.println("reply was:");
              String line;
              while(httpsClient.available()){        
                line = httpsClient.readStringUntil('\n');  //Read Line by Line
                //Serial.println(line); //Print response
              }

            
            if (line =="1") {
             Serial.println("enciendo");
            digitalWrite(Rele, LOW);
            delay(2000);
            digitalWrite(Rele, HIGH);
            }
            else{
              Serial.println("nada");
            }                
            cont=0;  //resetear a 0 la variable cont
      }
  }
}

Como lo veis? Le veis alguna pega?
Lo estoy probando y de momento funciona, aunque desconecto y vuelvo a conectar el router vuelve a conectarse sin problemas.

Estoy testeando el código y tarda a encenderse el relé unos 6-10 segundos. Le veis algun punto donde podría ir mas rapido?
Gracias