Wemos D1 Mini >> Random reboots

OK - before I get shot-down I know this post has nothing to do with Node-RED, but I know a number of people on this forum use Wemos D1 Minis (in conjunction with Node-RED) to collect data and operate devices and may have encountered this problem.

At random times the Wemos reboots. Whether this is a problem for you depends on what you are using the Wemos to do. Anyway, I think I may have found the cause and offer this solution.

I've been doing experiments on 'deepsleep' with a set of Wemos D1 Mini devices and encountered the problem with random reboots.
When I checked some of my other units, I found they were acting the same (rebooting at odd times).
Some would reboot in say 23 mins, others might go for 70 or 80 minutes.
Although there is a +3V3 regulator on the Wemos board, there isn't any reservoir capacitors.
So I took a Wemos D1 Mini (with all the correct logos and curved PCB) fiited it to a breadboard with a BME sensor (so I had something to measure) and added a 220uF and a 0.1uF capacitors from +5V to GND and +3V3 to GND.
i.e. four capacitors in total.
Each pair of capacitors are wired in parallel and stradle the two power rails.

The idea is the 220uF acts as a reservoir and helps maintain the voltage when sudden loads are applied, while the 0.1uF offers a low impedance path to ground for any nasty little spikes.

Note: I used 220uF capacitors because they were the only ones I had in my 'bits-n-bobs' box.
I'm sure you could probably use a smaller one (I'll do some experiments this week and/or try to find my textbook about how to calculate the size).

So far the Wemos has been running for 720 minutes without rebooting (which is a dramatic improvement).
I just thought I'd share this with the forum as other people could try it and see if it helps their situation.

It's a long time since I designed a power supply, but I suspect when the Wemos switches on the WiFi the current consumption rises dramatically.
If the power supply that is feeding the Wemos is poor, then the supplied voltage will fall for a short period of time (and if it falls too low the Wemos goes into reboot).

wemos_caps_2_sm


3 Likes

Nice! Why two capicators on each side? Arn't the rails tied together with wires?

Hi Paul,
Using the second photo - the capacitors on the left-hand side of the breadboard connect to the +5V pin (which is the input to the Wemos).

The capacitors on the right-hand side connect to the +3V3 pin (which is the output from the on-board regulator).

In this lash-up the two sets of tram-lines on the extreme edges of the breadboard are NOT connected.

I dare say only the capacitors on the +3V3 rail are the important ones.

I'll probably do some further tests this week to confirm the above.

Very nice! Thanks for sharing. I don't suppose there is any chance of adding a wiring diagram?

I also get occasional reboots from my D1 Mini's. I've always assumed that it was a software issue as it seems to happen more often on devices that use 3rd-party builds rather than my own. But that might just be co-incidence.

I've put a very ROUGH sketch on my original post.
Hope that helps??

1 Like

Very cool. Thanks. I just need to get some larger capacitors now & to find the set I brought a while back but had to pack up when moving my office :frowning:

Ha, ha.
Just checked... it has run for 928 minutes without rebooting.
This is a record for me.

1 Like

Clearly I'm not getting such bad issues as mine typically run for a few weeks.

Hi Julian,
Just out of curiosity... are you running yours from a UPS ???

No, 1 runs from a mega USB power distribution thing - 12 USB ports with smart sensing on them to adjust power and an input power brick like a laptop from the 90's!

The rest run on a random selection of spare USB power supplies. Honestly, I don't generally even check their power output though the 1 I have to hand (our living room has been rebuilt but not decorated yet so the sensor is on my desk) is 1A from an old HTC Windows Mobile.

Only my Pi's and other core network kit is on my UPS setup.

Great stuff Dave, how exactly are you checking the uptime?

Hi Garry,
I've setup a 'device' in ESP Easy to show the system information.
'uptime' is a system variable that shows the uptime in one minute increments.

I've written a Rule-Set that listens for an 'event-command' sent from Node-RED via MQTT which then publishes a 'json' string back to NR (as shown in the screenshot below).

ScreenShot114

1 Like

Ahhh so this is to regulate the power because of devices tapping the WeMos for their power. Got it!

Espeasy had (has?) also massive problems with "random" reboots (related to the wifi signal), so you should include the version nr of your firmware (or sdk if you dont use a precompiled firmware).

I've got around 5-6 Wemos D1 minis running constantly and don't seem to have any issues with restarting.

I got them all from AliExpress Lolin official store and power them with USB.

Only one of them is running with deep sleep and an 18650 battery for a while now, and it doesn't seem to restart either.

But then again I don't record the data constantly so they could be occasionally and I wouldn't know.

As requested,
version number of the ESP Easy firmware I'm using is...

ESP_Easy_mega-20190607_normal_ESP8266_4M.bin

I've also written a Rule-Set that detects... on wifi#connected do
and sends a notification-email to my mobile phone, so I know exactly when the Wemos rebooted.

I can also send an 'event,command' from Node-RED to trigger the Wemos into sending the system uptime.

I think "System#Boot" indicates a (re)boot, so i guess you are combining it with sysinfo/uptime...

1 Like

Reboot problem

1 Like

Thanks for the link @markost, very useful information!

Here is another page - reboot problems

https://www.letscontrolit.com/wiki/index.php?title=Power