Weird behavior of nodemcu

Hello Brilliant Brains !!

Local server on Rpi Zero W
Blynk Server - server-0.36.5-java8
Apps are all upto date ios and android
Arduino 1.8.7
esp core 2.4.1
code sync physical button examples from blynk sketch builder (4 CHANNEL RELAY CONNECTED) all the below mentioned appliances are connected to the same relay unit and nodemcu

This setup is running from past many months :point_up_2:

From past 3 days i am noticing a strange behavior that is the switched on appliance(FAN) will turn off automatically with out anyone touching the app or the physical button ! And this is not at regular intervals or at fixed period or time [it just turned off as i am writing this post :roll_eyes:]. It just turns off its self and remains off until we manually turn it back on via Blynk app or Physical switch.

The best part is while turning off automatically it syncs with the app (shows that the switch as been turned off), so there is not question that the device as rebooted due to some issue because i can see that device online from 2.25AM OCT 15… So to make sure i turned on another appliance (Plugged in a mosquito repellent) but this never turned off like the FAN did… Even if the fan get turned off the repellent stays On.

As i have shared access with my parents i thought they might be messing up with me(FOR FUNN) !! So i turned off the shared access on the Blynk app. But still the strange behavior exists !!

  1. If there was a defect in the relay unit that should update on the app
  2. If there was a power issue then it should show (online since _just after reboot(time and date))
  3. Even if someone was messing around with shared access i turned it off as well as
    generated a new QR code.
  4. I have not programmed any time based turn on\off for this particular nodemcu.

I am not able to think anything other possible issues other than this.

Changing the module is not a problem for me. But i want to know the real cause for this.

1)Should i change the auth token or something like that ?
2)Should i reset the blynk server(local) ?
3)I have port forwarded by local server is that causing any issues (may be some hacker just
hacked in ?? :face_with_raised_eyebrow:)
4) Is pi zero w not able to support the traffic from nodemcu ? (sounds silly i guess) previously i had pi3 with no problem but it got destroyed due to its hardware…

Can someone think of anything and tell me what is happening ??

I think I’d start by adding a Terminal or Table widget and writing an event to it whenever the physical or app button is pressed (different messages for the different triggers) . This might give you some idea what is triggering the fan to turn off.

I’d also check the wiring, and look for loose connections around the NodeMCU pins or the switch connections. If you’re using a breadboard then that’s most probably the culprit.

As its only the fan that is acting this way then it’s possible that noise from the fan is causing an issue. I had a similar issue when I built a door entry system where a relay was used to apply 12v to an AC gate release mechanism. The noise from the mechanism was messing-up the MCU and had to put a capacitor across the relay switched contacts to suppress the noise spikes that are generated by the gate release.

If you do this then ensure that the capacitor is suitably rated and is designed for use as a noise suppressor across mains voltages (they need to be X Rated, and no, that doesn’t have anything to do with adult movies :slightly_smiling_face:). Something like this is what I’d use:

If none of that helps then post your code (correctly formatted of course) as you may have made a silly error when changing from 1 switch/relay to 4.


Please, update the server… the one you are using is really old…


Yes, I got this idea before itself !! But before doing any changes to the code i wanted a second opinion from you guys ! Because, what if the problem goes away after changing the code(modify)… Then i cannot make out what was causing the problem…

NO !!! Everything is soldered and relay and switches are connected with JST connectors !!

If this is the case then the whole nodemcu needs to get effected and the remaining relays also needs to act weird !
But i have a good power supply for the nodemcu and there are smoothing capacitors for the nodemcu…And also i have opto-couplers driving the relays and relay board itself has on-board opto-coupler(so there is double isolation). So the noise must not reach the nodemcu pins if i am not wrong…


The reason why i am using this version is that it was stable for me from 2 or more years…
and i can get the server running without any problems or error…

i tried the latest version also few days ago, but i gut error on the terminal window. But when i use the above mentioned version everything works fine.

I will create a new post regarding the error i am getting on latest builds…

The opto isolators on most relay boards are disabled unless you move the JD-VCC and provide a separate power supply.

I’d suggest that you post your full code with triple backticks at the beginning and end so that it displays correctly.
Triple backticks look like this:


Yep… I am driving the relay board with a different power supply.

From past two nights i am not getting the weird behavior !! :roll_eyes: :thinking:

And i just updated the Blynk local server to the latest build. Let me see if that also helps in solving the issue…