Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wtd reset after WiFi.forceSleepBegin(); #4341

Closed
p99will opened this issue Feb 10, 2018 · 3 comments
Closed

wtd reset after WiFi.forceSleepBegin(); #4341

p99will opened this issue Feb 10, 2018 · 3 comments

Comments

@p99will
Copy link

p99will commented Feb 10, 2018

Basic Infos

Hardware

Hardware: ESP-12E
Core Version: 2.4.0

Description

Getting watchdog reset when trying to turn off WiFi (to save power).

ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset

I think there is a loop that is in the WiFi library that watchdog doesn't like.

I've tried replacing the delay with a loop calling yheld(); with a smaller delay, I still get error.

Settings in IDE

Module: Generic ESP8266 Module
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: idk?
Flash Frequency: also dont know?
Upload Using: USB Serial.
Reset Method: idk, MCU?

Sketch

void loop() { 
    beginWIFI(); // reconnects WiFi if disconnect.
    beginMQTT(); // reconnects MQTT if it was disconnected.
    printValues();
    Serial.println("Turning off wifi");

    delay(100);
    client.disconnect();   //MQTT disconnect
    WiFi.disconnect();

    WiFi.forceSleepBegin(); // Error only occurs when using this.
    delay(1);

    delay(20 * 1000) //Delay 10 seconds -- Problem occurs while waiting. 

    WiFi.forceSleepWake();


}

Debug Messages

 ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset

@p99will
Copy link
Author

p99will commented Feb 10, 2018

Sorry, correction: (I'll edit it 2morrow) but,
The problem doesn't occur at or during the delay. It occurs on anything after the delay. Including any Serial.write, additional delays and the force sleep wake.

@alexbelck
Copy link

I had same issue and figured out that I was usinig the wrong library.

For the ESP12e you need to use the "ESP8266WiFi" library, not the standar1 "WiFi"

Check if your code has the right #include <ESP8266WiFi.h>

@earlephilhower
Copy link
Collaborator

Closing, this is being tracked currently in #6172.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants