All relay turns on automatically when my nodemcu reboot

No, you are not. Open Arduino IDE, then go to Tools ->Board->Boards manager. Go to the end of the list where ESP8266 is, then click on it and read the version. It should be like 2.2.0, 2.3.0, 2.4.0rc2…

What GPIO port are you using for relay?

gpio5, gpio2, gpio4, gpio14

That’s not what I’m asking for. Scroll up, there should be Boards Manager above Arduino boards section. Click on Boards Manager, then scroll down to ESP8266 bu ESP8266 community and read installed version.

2.3.0

That’s the answer to your problems. Upgrade to 2.4.0rc2 and reflash your NodeMCU.

Details at: https://community.blynk.cc/t/wpa2-compromised-upgrade-all-hardware/18353/14

Thank u @zodiac I will try

2 Likes

Also replace this:

with this:

when using NodeMCU or any other ESP8266 board in stand alone mode.

No luck, problem continues even after changing esp8266 core version and baud rate to 115200

Same problem occurs even when my WiFi router is restart or internet connection lost, all the relays connected to app widget getting turned on automatically. I think some problem with blynk.syncAll(); when nodemcu connects to WiFi or internet, it is not sync with app widgets that why relays turning on, so please guide to solve this problem

This is really strange. If you selected four digital pins to be connected to buttons in Android app without setting GPIO states and virtual pins (without code, to be more precise), only ONE should go low, not all of them, and that is really connected to Blynk. But I never heard of every single GPIO going low after restart, especially having Blynk.syncAll active, which should restore all pin states; that makes no sense at all. Convert your GPIO ports to virtual pins, set relay states and you will be fine, it is obvious that support for direct control of GPIO is not working well these days.

But everything working fine local server, I don’t have dedicated pc to run local. Gpio (relays) associated with button widget only gives problem. Thank u for ur support @zodiac

I’m running my setup on local server, with directly addressed digital pins from Android app, everything working fine. Never tried cloud in this setup, so I don’t know. But syncAll should be working, it’s Blynk feature.

Can u try once in cloud set up please. For me also no problem in local setup. Even three days before it is working in cloud setup. Last three days only I am facing problems

Just tried your sketch on my NodeMCU, same problem here. Don’t know what’s the reason, it should work. Instead of restoring pin states, all gpios associated with buttons goes low after reset.

Use virtual pins or go back to 2.16.5.

@Dmitriy Do you know what is the reason for this? Is there a fix for this issue?

1 Like

What local server version do you have?

@Lokesh_PS @zodiac fixed. Thanks for reporting!

2 Likes

0.28.3

working fine in local server but not working with blynk cloud. blynk.sync All() is not working. nodemcu is not sync with app widgets. so please look in to problem, from last four days only I am facing problem. before four days every thing working fine

thanks @zodiac for trying with cloud for me