ESP8266 constantly resetting, but blink script works

0

Hello I have been using the Wemos D1 mini lite for awhile now with this ArduCAM setup. Everything was working perfectly, but now my esp8266 is constantly resetting.

I unplugged the ArduCAM and saw I can ran the blink script successfully, but when I try to run a script where it attempts to connect to wifi, it constantly resets.

Here is my code:

#include <ESP8266WiFi.h>        // Include the Wi-Fi library

const char* ssid     = "ssid";         // The SSID (name) of the Wi-Fi network you want to connect to
const char* password = "";     // The password of the Wi-Fi network

void setup() {
  Serial.begin(115200);         // Start the Serial communication to send messages to the computer
  delay(10);
  Serial.println('\n');

  WiFi.begin(ssid, password);             // Connect to the network
  Serial.print("Connecting to ");
  Serial.print(ssid); Serial.println(" ...");

  int i = 0;
  while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
    delay(1000);
    Serial.print(++i); Serial.print(' ');
  }

  Serial.println('\n');
  Serial.println("Connection established!");  
  Serial.print("IP address:\t");
  Serial.println(WiFi.localIP());         // Send the IP address of the ESP8266 to the computer
}

void loop() { }

When I run this, I get the following:


load 0x4010f000, len 1392, room 16 
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld

Exception (3):
epc1=0x40100710 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4006e989 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffb90 end: 3fffffc0 offset: 01a0
3ffffd30:  feefeffe feefeffe feefeffe feefeffe  
3ffffd40:  feefeffe feefeffe feefeffe 3ffffef0  
3ffffd50:  0000049c 0000049c 00000020 40100900  
3ffffd60:  feefeffe feefeffe feefeffe feefeffe  
3ffffd70:  00000002 400042db 000000fd 40100b58  
3ffffd80:  40004b31 00001000 000000fd 40100274  
3ffffd90:  40105ae0 feefeffe feefeffe 4022da8d  
3ffffda0:  40105c9d 4022db77 3ffef25c 0000049c  
3ffffdb0:  000000fd 3ffffef0 3ffef25c 4022db5a  
3ffffdc0:  ffffff00 55aa55aa 0000000e 00000020  
3ffffdd0:  00000020 00000078 00000012 aa55aa55  
3ffffde0:  000000ff 4022e05a 3ffef25c 3ffef25c  
3ffffdf0:  000000ff 00000119 00000119 40100640  
3ffffe00:  40105c9d 00000001 3ffef26c 4022e27a  
3ffffe10:  00000005 3ffef25c 000000ff 3ffffef0  
3ffffe20:  3fffff10 3ffef293 0000000e 00000020  
3ffffe30:  3ffef31c 3fffff51 00000001 4022e32a  
3ffffe40:  3ffffef0 40239860 00000000 00000000  
3ffffe50:  3ffef65c 3fffff10 3fff5594 4022e2f9  
3ffffe60:  3ffef25c 4022e360 3ffe84d4 3ffe8642  
3ffffe70:  40201946 3ffe8642 3ffe8663 4020189b  
3ffffe80:  76696e55 69737265 6f207974 61572066  
3ffffe90:  6e696873 6e6f7467 3ffffe00 40204cbc  
3ffffea0:  3ffee400 00000000 3ffffe60 40204ef9  
3ffffeb0:  00000f98 000001f3 000001f3 40100640  
3ffffec0:  000006e8 000000dd 00000014 3ffeebc4  
3ffffed0:  007a1200 44e0a632 00000000 401008cb  
3ffffee0:  adb5c801 fe20b34c feefeffe 00000100  
3ffffef0:  76696e55 69737265 6f207974 61572066  
3fffff00:  6e696873 6e6f7467 feefef00 feefeffe  
3fffff10:  40203500 3ffeefcc 3ffeef4c 402035af  
3fffff20:  0000001c 0001c200 00000000 00000000  
3fffff30:  00000003 40203771 ffffffff 00000001  
3fffff40:  40105065 00000001 3ffee35c 3ffee3d4  
3fffff50:  00000000 00000001 3ffee381 00000000  
3fffff60:  00000004 00000000 3ffee328 00000001  
3fffff70:  0001c200 0000001c 00000000 3ffee3d4  
3fffff80:  3fffdad0 3ffee328 3ffee35c 40201073  
3fffff90:  feefeffe feefeffe feefeffe feefeffe  
3fffffa0:  feefeffe 00000000 3ffee394 402024b4  
3fffffb0:  feefeffe feefeffe 3ffe84f0 40100b8d  
<<<stack<<<

over and over and over.

I don't understand what is happening. Did I possibly short it? It couldn't have been the ArduCAM, since this was working fine already.

edit:

I found out that the Wifi.begin(ssid,password) command causes the constant reboots. When I remove this, it doesn't reboot. How can I fix this?

arduino
esp8266
asked on Stack Overflow Feb 25, 2020 by Spencer Kraisler • edited Feb 25, 2020 by Spencer Kraisler

1 Answer

-1

I think your main loop is empty. Add while(true) in the main loop function

and it´s better to set the esp in sation mode.

WiFi.mode(WIFI_STA);

answered on Stack Overflow Feb 25, 2020 by pTronix

User contributions licensed under CC BY-SA 3.0