I'm trying to use WiFi on a ESP8266EX based board (XTVTX WEMOS D1 Mini Pro).
The sketch is really simple.
#include <ESP8266WiFi.h>
void setup() {
Serial.begin(9600);
WiFi.begin("<ssid>", "<password>");
}
void loop() {
if ( WiFi.status() == WL_CONNECTED)
{
Serial.println("Connected");
}
else
{
Serial.println("Not Connected");
}
yield();
}
The board keeps rebooting for a watchdog reset (source: https://arduino-esp8266.readthedocs.io/en/latest/boards.html#rst-cause).
After a few seconds a fatal exception is raised (28 = LoadProhibitedCause - source: https://arduino-esp8266.readthedocs.io/en/latest/exception_causes.html#exception-causes-exccause).
Here it is the log that shows the issue.
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 3424, room 16
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8
tail 0
chksum 0x2b
csum 0x2b
v00044b80
~ld
sp 0x3fffe9d0
epc1=0x40204d1a, epc2=0x00000000, epc3=0x00000000, excvaddr=0x04000102, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
[...]
My setup:
- Power: USB 3.0 powered hub (5V 500mA)
- IDE: Arduino IDE v2.0.4 on Linux
- Library: esp8266 from ESP8266 Community v3.1.1 (tried also 3.1.0 and 3.0.2)
- Programmer settings:
- Board: Generic ESP8266 Module
- Upload speed: 115200
- Crystal Frequency: 26MHz
- Flash Size: 4MB (FS: none OTA: 1MB)
- CPU Frequency: 80MHz
- MMU: 32KB cache + 32 KB IRAM
- lwip variant: v2 lower memory
- NONOS SDK: nonos-sdk 2.2.1+100
- Erase flash: all flash content
- Flash frequency: 40MHz
Every other sketch which does not involve the use of WiFi is working without issues.
This sketch works fine on the AzDelivery ESP8266MOD 12-F board which is very similar.
The board is new and I've seen the WiFi working for a few seconds before entering in the boot loop.
Other people with the same behavior were using #include <WiFi.h> instead of #include <ESP8266WiFi.h>, so this is not my case.
I can't understand what is the problem. Has anyone faced this problem before and found a solution?
Thank you for your time.
WiFi.setOutputPower(19.25);works fine. Higher values raise the problem. Thank you!