Es 32 V2 relay push boton

Buenas por favor un código de pulsar botón en un esp32 lora V2 y active un relé en otro esp32 v2.
Las conexiones lo tengo entendido.
No sé cómo hacer que se refleje una entrada gpio en un esp32 lora y active una salida gpio en otro gpio

/*
Send a lora signal to control the LED light switch of another board.
Pull the 12th pin high to turn on the LED light.
Pull pin 13 high to turn off the LED light.
by Aaron.Lee from HelTec AutoMation, ChengDu, China
成都惠利特自动化科技有限公司
www.heltec.cn

this project also realess in GitHub:
https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series
*/
#include “heltec.h”
#define BAND 868E6 //you can set band here directly,e.g. 868E6,915E6

int counter = 0;
#define Open_LED 12
#define Close_LED 13
void setup() {

//WIFI Kit series V1 not support Vext control
Heltec.begin(false /DisplayEnable Enable/, true /Heltec.LoRa Disable/, true /Serial Enable/, true /PABOOST Enable/, BAND /long BAND/);
pinMode(Open_LED,INPUT);
digitalWrite(Open_LED,LOW);
pinMode(Close_LED,INPUT);
digitalWrite(Close_LED,LOW);
LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);

}

void loop() {
if(digitalRead(Open_LED)){
Serial.print(“Sending packet: OpenLED\r\n”);
// send packet
LoRa.beginPacket();
LoRa.print(“OpenLED”);
LoRa.endPacket();
digitalWrite(Open_LED,LOW);
}
if(digitalRead(Close_LED)){
Serial.print(“Sending packet: CloseLED\r\n”);
// send packet
LoRa.beginPacket();
LoRa.print(“CloseLED”);
LoRa.endPacket();
digitalWrite(Close_LED,LOW);
}
delay(1000);
}

/*
Receive the lora signal to control the on and off of the LED.
Pull the 12th pin high to turn on the LED light.
Pull pin 13 high to turn off the LED light.
by Aaron.Lee from HelTec AutoMation, ChengDu, China
成都惠利特自动化科技有限公司
www.heltec.cn

this project also realess in GitHub:
https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series
*/

#include “heltec.h”
#include “string.h”
#include “stdio.h”
#define LED 25
#define BAND 868E6 //you can set band here directly,e.g. 868E6,915E6
char Readback[50];
void setup() {
//WIFI Kit series V1 not support Vext control
Heltec.begin(false /DisplayEnable Enable/, true /Heltec.LoRa Disable/, true /Serial Enable/, true /PABOOST Enable/, BAND /long BAND/);
pinMode(LED,OUTPUT);
digitalWrite(LED,LOW);
}

void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print(“Received packet '”);
// read packet
while (LoRa.available()) {
sprintf(Readback+strlen(Readback),"%c",(char)LoRa.read());
}
Serial.print(Readback);
if(strncmp(Readback, “OpenLED”, strlen(Readback)) == 0) {
digitalWrite(25, HIGH);
}
else if(strncmp(Readback, “CloseLED”, strlen(Readback)) == 0) {
digitalWrite(25, LOW);
}
memset(Readback,0,50);
// print RSSI of packet
Serial.print(" with RSSI ");
Serial.println(LoRa.packetRssi());
}
}

You can try to modify the above example to accomplish your goal.

Hi I want to do the same thing but with node red