Skip to content

wtd reset after WiFi.forceSleepBegin(); #4341

@p99will

Description

@p99will

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions