Skip to content

LIGHT_SLEEP_T causes endless delay #4485

Closed
@MikhailNatalenko

Description

@MikhailNatalenko

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [latest git hash or date]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Nodemcu]

Problem Description

LIGHT_SLEEP_T wifi mode brakes sketch. After 10-15 seconds from connection it just stop's without any output (like infinite loop with yield()). No WDT reset or exception.

This bug appers in last commit (170911a) and 2.4.1. 2.4.0 works fine (SDK: 2.1.0 deb1901)

Delay before wifi_set_sleep_type(LIGHT_SLEEP_T); doesn't help (5-10 seconds)

MCVE Sketch

#include <ESP8266WiFi.h>

extern "C" {
#include "user_interface.h"
}

void printStatus();

void setup() {
  wifi_set_sleep_type(LIGHT_SLEEP_T);
  WiFi.begin("my-ssid", "password");
  delay(500);
  
  WiFi.printDiag(Serial);

  Serial.begin(115200);
  Serial.println(F("\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\r\n"));
  delay(100);
  Serial.print(F("Core: "));
  Serial.println(ESP.getCoreVersion());

  Serial.print(F("SDK: "));
  Serial.println(ESP.getSdkVersion());

  WiFi.printDiag(Serial);
  Serial.println(F("Starting Firmware"));

}

void loop(void) { 
  delay(250);
  printStatus();
}

void printStatus() {
  static auto i = 0;
  Serial.print(WiFi.isConnected());
 
  if (i > 20) {
    Serial.println();
    i = 0;
  }
  i++;
}
Core: 00000000
SDK: 2.2.1(cfd48f3)
Mode: STA
PHY mode: N
Channel: 6
AP id: 0
Status: 1
Auto connect: 1
SSID (7): my-ssid
Passphrase (8): password
BSSID set: 0
Starting Firmware
0011111111111111111111
111111111111111111111

It stops here. No any output

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