Why does my ESP8266...
 
Notifications
Clear all

Why does my ESP8266 keep restarting?

1 Posts
2 Users
0 Reactions
1,592 Views
0
Topic starter

I just got a brand new ESP8266 and tried uploading a basic sketch (just a simple Serial.begin() and a few prints), but as soon as it runs, the board keeps restarting in a loop.

I haven’t connected any sensors or peripherals — just powered it via USB. The Serial Monitor keeps showing reset messages like rst cause: 4 or something similar.

Is this normal for a new board? Could it be a power issue, bad code, or something else I’m missing?
Would really appreciate any suggestions before I start panicking


1 Answer
0

There are a few common reasons why your ESP8266 keeps restarting:

Power supply issue

This is the most common cause. The ESP8266 needs a stable 3.3V with enough current (at least 300mA, preferably 500mA). If you're powering it from the 3.3V pin on an Arduino or a weak USB cable, that could cause resets.

Watchdog reset

If your code runs a long loop without delay(), yield(), or ESP.wdtFeed(), the internal watchdog timer will reset the ESP. Try adding a small delay(1) inside long loops.

Incorrect GPIO boot states

The ESP8266 checks GPIO0, GPIO2, and GPIO15 at boot. They need to be:

1. GPIO0: HIGH

2. GPIO2: HIGH

3. GPIO15: LOW

If these are wrong, the ESP may not boot properly and keeps resetting.

Faulty code or firmware

A crash or corrupt firmware can cause repeated resets. Try uploading a basic sketch (like Blink) to rule that out.

Serial monitor clues

Connect your ESP to the serial monitor at 74880 or 115200 baud. The output usually shows the reset cause. For example:

rst cause:2 = reset from RST pin

rst cause:4 = watchdog reset

Wi-Fi reconnect loop

If your code keeps trying to connect to Wi-Fi and fails (especially without any delay), it can cause instability.

Double-check your power supply first — it's usually the culprit. If you're still stuck, share your wiring setup and what shows up in the serial monitor.


Share: