Nodemcu loses program every time it's powered up

I have a nodemcu v2 device kit. When it’s connected to my lap via the serial cable n code uploaded it works fine. I’m using blynk sketch to control 8 relays via a logic level converter. So whenever I switch to external supply that is remove the serial cable n connect external supply, it loses its program and has to be re programmed

@Liam77 this recent thread is similar to yours Wemos D1 mini loses sketch after reconnect

Same question to you, which core version?

Yeah I went through the thread… I was suspecting a defect in the chip too. I don’t know what u mean by what core version. I’m a beginner

How do you KNOW it is losing the programm??

What type of power adapter are you switching too? Voltage, Current, interface (USB or direct to pins)?

First off, even a past version core will not just up and delete your sketch… not that I have ever seen at least :stuck_out_tongue:

And if you gotten this far, then you have loaded in an Arduino core at least once :wink: … so as long as you followed the official method, then you probably have the latest stable version.

Heres a link from where I bought it… https://www.amazon.in/gp/aw/d/B0716N2SHQ/ref=yo_ii_img?ie=UTF8&psc=1.
Maybe u can see which core it is. Cause I’ve no idea about it. The adapter is a 9v 850mA

The adapter goes into Vin. Of the Nodemcu. And I know it’s losing the sketch cause. If I connect Vin from the adapter while the USB serial cable is still connected to the lap. And then proceed to disconnect the serial cable USB, it stays connect to the wifi n the code works. But if I switch off and then on the adapter, it goes offline and doesn’t connect again

Well, it seems whatever your issue is, it is NOT Blynk related… so not sure what more can be assisted with in this here Blynk forum :wink: I would recommend you spend some time Googling NodeMcu power issues and testing other scripts… here is some basic ideas…

Did you or did you not load the Arduino Core following those directions? If you didn’t, then how on Earth are you connecting to the IDE? If you did, then you should know what you loaded by the simple process of … well, you did it :stuck_out_tongue:

And you can check to see what ESP core is installed in your IDE by following the install methods and looking at what is installed in the IDE Boards Manager.

That only shows that is will not reconnect… possibly bad power and unable to handle the WiFi startup. Test it with a simple onboard LED flashing script.

Might be a little underpowered for the current… particularly if it is a cheap PSU and not actually capable of it’s supposed rating (been there seen that) and especially if you are powering any relays off of it as well (they should be powered by a seperate PSU with only shared grounding).

http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/powering-the-esp-12e-nodemcu-development-board/

1 Like

You mean the Nodemcu v2 12E? Is that it? Yea it cant be a power related issue cause when I try to connect back with the serial cable it still doesn’t come online

Well I just tried uploading the blink sketch and then switching to external supply… Same thing it loses the sketch and doesn’t run. I tried supplying the board and the relay also with separate power supply and common ground with the blynk sketch… Still nothing. Once the Nodemcu loses the power it loses the sketch as well. It’s node mcu 1.0 v2 12E

Either it was already bad… or something got fried. Replace it. Problem solved.

1 Like

Got a new one, no problems with this one

2 Likes