esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.01k stars 13.33k forks source link

WeMOS R1 D2 issuing "wdt reset" messages #1757

Closed dspdon closed 6 years ago

dspdon commented 8 years ago

Basic Infos

Running WiFiScan.ino example with WeMOS R1 D2, started failing with "wdt reset" message

Hardware

Hardware: WeMos R1 D2

Description

Ran WiFiScan.ino example with WeMOS R1 D2, ran fine a few times. I changed serial port rates, ran fine. Changed back, code started failing with message:

ets Jan 8 2013,rst cause:4, boot mode:(1,6) wdt reset

Sometimes a stack dump would also display repetitively.

Settings in IDE

Module: ?Generic ESP8266 Module? Flash Size: ?4MB/1MB? CPU Frequency: ?80Mhz? Flash Mode: ?qio? Flash Frequency: ?40Mhz? Upload Using: ?OTA / SERIAL? Reset Method: ?ck / nodemcu?

Sketch

/*

void setup() { Serial.begin(115200);

// Set WiFi to station mode and disconnect from an AP if it was previously connected WiFi.mode(WIFI_STA); WiFi.disconnect(); //ESP.wdtDisable();

delay(100); }

void loop() { Serial.print(F("Scanning ... "));

int n = WiFi.scanNetworks(); if (n == 0) { Serial.println(F("no networks")); } else { Serial.print(n); Serial.println(F(" networks")); for (int i = 0; i < n; ++i) { Serial.print(i + 1); Serial.print(": "); Serial.print(WiFi.SSID(i)); Serial.print(", ch "); Serial.print(WiFi.channel(i)); //WiFiPhyMode_t pm = WiFi.getPhyMode(); Serial.print(", "); Serial.print(WiFi.RSSI(i)); Serial.print(" dBm, "); Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? "" : "*"); delay(10); } } Serial.println();

delay(5000); }

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

igrr commented 8 years ago

Which version of the core are you using (2.1.0 or latest git?)

dspdon commented 8 years ago

How do I determine which core I am using?

On Mar 12, 2016, at 12:25 PM, Ivan Grokhotkov notifications@github.com wrote:

Which version of the core are you using (2.1.0 or latest git?)

— Reply to this email directly or view it on GitHub.

krzychb commented 8 years ago

@dspdon,

  1. Go to Tools > Board: (Board Name) > Boards Manager.
  2. Scroll down to esp8266
  3. You should see version N.N.N INSTALLED (see below).
  4. If version is not listed, you are likely using git version

Krzysztof

core version

dspdon commented 8 years ago

I have version 2.1.0:

[image: Inline image 1]

On Tue, Mar 15, 2016 at 1:04 AM, Krzysztof notifications@github.com wrote:

@dspdon https://github.com/dspdon,

  1. Go to Tools > Board: (Board Name) > Boards Manager.
  2. Scroll down to esp8266
  3. You should see version N.N.N INSTALLED (see below).
  4. If version is not listed, you are likely using git version

Krzysztof

[image: core version] https://cloud.githubusercontent.com/assets/12953787/13768100/577aeeaa-ea72-11e5-983b-bab3d03bfe01.png

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/esp8266/Arduino/issues/1757#issuecomment-196662818

yomasa commented 8 years ago

delay too long in loop maybe?

242617 commented 8 years ago

Removing writing to Serial is the solution in my case.

devyte commented 6 years ago

Scanning is being done on every loop pass, including print out to Serial. The execution of the loop body should be spaced out by polling millis(), and actually do a scan every e.g.: 6s. Also, the relevant underlying code has changed quite a lot since this issue was opened. Closing.