Widget not working

Hello friends. Im using ESP32 to control a relay. Everything is working OK inside blynk app. Problem is when i add a button widget at my Android phone homescreen. Widget does not work. Visually it changes state, but physically nothing happens. Am i missing anything?
Thank you

#include <BlynkSimpleEsp32.h>


// Blynk Auth Token.
// Go to the Project Settings (nut icon)in Blynk App.
char auth[] = "x";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "x";
char pass[] = "x";

const int Relay_1 = 26;

BLYNK_WRITE(V1)
{
int pinValue = param.asInt();
if (pinValue == 1)
{
digitalWrite(Relay_1, HIGH);
Serial.println("Luz Ligada");
}
else if (pinValue == 0)
{
digitalWrite(Relay_1, LOW);
Serial.println("Luz Desligada");
}
}

BLYNK_CONNECTED() {
Blynk.syncAll();
}

void setup()
{
pinMode(Relay_1, OUTPUT);
digitalWrite(Relay_1, LOW);

// Debug console
Serial.begin(115200);

// Connect to Wi-Fi network with SSID and password
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed!");
}

// Print local IP address
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
  
Blynk.config(auth, IPAddress(192,168,x,x), 8080);
}

void loop()
{
Blynk.run();
}

As you’re using a local server I think the issue is related to your network setup…

Pete.

1 Like

Nailed it… Thanks! Now try to use this with NodeRed+Alexa. Already tried you example from your projects, but something is not working