Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Rebooting when joining WiFi

Open sticilface opened this issue 11 years ago • 48 comments

Using latest version 1.6.1-esp8266-1-1054-g3183c7c

I have a project that has been working fine (at least booting and joining wifi.) now it crashes upon trying to join wifi...

NORMAL ACCESS MODE ENABLED
Scanning for Networks

Joining Wifi Network....
 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1464, room 16 
tail 8
chksum 0x7a
csum 0x7a
e���(�SQS�(RQ�)HT�)SHHHC���r

Not sure what to do next, to help? I should add that the same code compiled on a previous IDE works fine.

sticilface avatar Jun 15 '15 14:06 sticilface

I had the same problem with pubsubclient and it seems to be solved with this version 1.6.4-835-g77d77e8 ( https://github.com/esp8266/Arduino/issues/324 ) See https://github.com/Imroy/pubsubclient/issues/8

BJvDL avatar Jun 24 '15 20:06 BJvDL

Thanks Buddy I will try a fixed IP out now and then test the version you specify after with DHCP.

Awesome, fingers crossed.

Dans

danbicks avatar Jun 24 '15 20:06 danbicks

You are a hero, so Far I have a static IP assigned and no more WDT resets. Superb so it does seem DHCP related.

Not only that I have a really good test router that links to my main wireless network and does several drop connections before it becomes solid. An Ideal unit to test for harsh network conditions,

I will now look at my current build of the Arduino IDE which is 1.64, how do I find out donwload version of this eg g77d77e8 ?

Massive thanks again

Dans

danbicks avatar Jun 24 '15 21:06 danbicks

See issue #324 for details how to get Package for nightly build

BJvDL avatar Jun 24 '15 21:06 BJvDL

Very simple sketch leads to out of heap:

#include <ESP8266WiFi.h>

void setup() {
  delay(2000); // debugging purposes
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  WiFi.printDiag(Serial);
  WiFi.mode(WIFI_STA);
  // with or without this string result is the same
  WiFi.config({192, 168, 78, 233}, {192, 168, 78, 1}, {255, 255, 255, 0}, {192, 168, 78, 1});
  // correct AP name with wrong pass
  WiFi.begin("atmosphere", "wrong password!");
}

void loop() {
  Serial.println(ESP.getFreeHeap());
  delay(500);
}

The log http://pastebin.com/M80fvhxs

syadykin avatar Jun 26 '15 10:06 syadykin

The original issue should be fixed in esp8266-1.6.5-804-g2d340c7. Will also check the out-of-memory issue with wrong password.

igrr avatar Jun 26 '15 17:06 igrr

i was having a number issues with random wdt reboots while trying to connect to the AP - all at different times after startup. What's interesting is that it seems random - will connect fine for hours then stop working for hours (wdt reboots) then it starts working again. Problem seems greatly improved with the latest code (no reboots yet).

BTW - what's the best way to get the arduino IDE to detect and reload any updates to the board manager .json code?

Also, what tools do you use to debug crashes - gdb?

Thnx,Reza

thethereza avatar Jul 30 '15 01:07 thethereza

I also had my ESP8266 (NodeMCU) rebooting on WiFi.begin() with the following messages: ets Jan 8 2013,rst cause:4, boot mode:(3,6) wdt reset load 0x4010f000, len 3460, room 16 tail 4 chksum 0xcc

For me the issue was that I used WiFi.h (used in many old examples) instead of ESP8266WiFi.h.

EdwinGH avatar Aug 11 '22 16:08 EdwinGH