When using a generic ESP8266 module, make sure you have a 100nf capacitor or similar over the power lines, as close to the chip as possible. This solved my problems with the module crashing and sending a memory dump over the serial line.
I use my ESP8266 with blynk in standalone mode, so far so good. But after adding several sensor, thinkspeak, ntp-sync, etc. I was kind of disappointed when I saw my ESP randomly hangs (no crash, really doing nothing).
It has once successfully worked for almost 6 hours! I was suspecting the hardware but I made a try without blynk and guess what, 3 days of uptime until I added few more line of code.
I have fixed the while loop and Iām happy again, uptime with blynk for now 12h. Itās not a lot but looks like promising since it beats the max uptime I had during one of my numerous blynk trys.
@vshymanskyy Sometimes, I need to kill the Blynk android app on my LG G2 in order to re-connect to my ESP. Also I didnāt try the notify, but Iām assuming that it notifies only if the blynk app in running. It should be great to have notification even if the blynk app was not started or at least started but put in some kind of background mode.
Itās look like the app randomly hangs, app was started 10 min ago, home button, doing stuff with my phone, then I āwake upā the blynk app from the running process manager, I push some button, slider and no response (even if I wait 1min). So I kill it, re-launch, it reconnect to the server and then works as expected.
But anyhow, not a huge problem to me, the ESP hanging was my only huge problem.
My bad, I should have tried it before making assumption.
A question though, should there be some amount of retry? Iām guessing the original code wasnāt a comms retry as much as a āfinish the sendā loop. Iām wondering if there were cases where this loop resulted in a successful retry and didnāt loop endlessly.
Just a few lines before the while loop, they check if the connection is up. If it is down, they also exit without reconnecting. It would be nice to have a return value to check if the data was sent successfully.
I guess it doesnāt make a big difference, because a retry will automatically happen with the next blynk.run()⦠And we wouldnāt want the program to lockup when the internet is down.
I included the above code and it seems to have helped, but I am still unable to keep the ESP online for more than 12 hours.
It is interesting that my Android application occasionally issues disconnection notifications, even though I can still access the ESP when I re-open the Blynk applicationā¦
I got an LCD display with the ESP hanging onto my Arduino, but itās really instable. The LCD flickers a lot too, so I think (quite sure actually) the ESP needs a whole lot more juice then the duino can deliver. Wifi chips eat a lot.
I ordered a seperate 3.3v step down module which can deliver 3a at 3.3v. The ESP is specced at about 500mA, so make sure you have enough power for it.
Ok so with the fix, my ESP has reached about 13 days of uptime but sadly not more ā¦
I will try to add a connection test in the main loop, something like pinging my wifi passerel and if it fails several time reset the esp ā¦
I donāt think I am having power issue with my setup (ESP12 + TinyESP + DHT22).
Hi i have nodemcu board esp8266 witty from ali and i have same problem. Esp was disconected ewery 10-30 sec. i run basic ino file, standalone. on witty is rgb led and ldr sensor. connection is totaly unstable.
Iāve had an ESP8266 (the original -01 version) running for months without issue, and I think there are 2 keys to that stability:
Decoupling capacitors. Add a .1uF ceramic capacitor and a 10uF electrolytic capacitor between the 3.3V and GND pins.
A ācleanā void loop():
void loop() {
Blynk.run();
timer.run();
yield();
}
All additional code should be called by the timer function. The yield() may be unnecessary, but Iāve read that it keeps the ESPās background processes running smoothly. In any case, this combination of hardware and code has been absolutely rock solid.
You donāt need a board like nodemcu necessarily. Even a breadboard adapter like this with a decoupling cap has worked perfect for me: esp-01 BB adapter