BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Relays automatically on for some ms before blynk sync occurs

When power comes the relays are automatically on for some ms before blynk sync works.
Boards : NodeMCU 1.0
So what can I implement in the below code or write any other code ?

Here is the code:

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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

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

void setup()
{
  
  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass);
    Blynk.syncAll(); 
}

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

@Its_sourav please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

edited. kindly reply.

It’s far better to post to the public forum rather than PM’ing me, as it gives an opportunity for everyone to share their thoughts, and helps other forum members who may have the same problem in future.

As you don’t have any code in your sketch that controls the relays, I assume that you’re doing this directly from the app.
This really isn’t the best approach to take, I’d always advise people to use virtual pins instead.

Also, some NodeMCU pins do fluctuate on start-up. This topic is well worth studying. Be aware that the GPIO numbers used in this table are different to the numbers screen printed onto the board.

Pete.

Thank you for your suggestion

I am using NodeMCU 1.0 for project and blynk app.
When power comes again to the NodeMCU 1.0 it turns on all relay for some milli second before syncing from blynk app. So what I can I do with this program to off the auto relay on pulse.

Here is the program:

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "xxx";
char ssid[] = "xxx";
char pass[] = "xxx";
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
Blynk.syncAll();
}
void loop()
{
Blynk.run();
}
How to implement low or high value to the all usable gpio pin?

I’ve moved your new post into your previous topic on the same subject.
Please don’t create new topics in this way.

Pete.