Skip to content

Unexpected light sleep and deep sleep behaviour on ESP32-S3 #6612

Closed
@idea--list

Description

@idea--list

Board

Adafruit ESP32-S3 Feather

Device Description

Adafruit ESP32-S3 Feather

Hardware Configuration

Nothing attached

Version

latest development Release Candidate (RC-X)

IDE Name

Arduino IDE V1.8.19

Operating System

Windows 10

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

115200

Description

Began to try the ESP32-S3 today and find unexpected behaviour of the native USB-Serial converter.

When the sketch uses deep sleep:
I can hear the sound playing when the COM port detaches and even when the board is recognized when waking up after deep sleep. However the the Serial output updates only before the board goes to deep sleep for the first time. Later on the serial output does not update despite the board is waking up. Power consumption is as expected.
Did not find earlier report regarding deep sleep.

When the sketch uses light sleep:
I do not see any serial output at all (not even in the 1st cycle). Do not hear any sounds for detaching/recognition and also the power consumption drops to the expected level only in the 1st cycle but after that it remains at least 87mA without ever dropping back to low levels. Seem like the board can not reenter light sleep after it has waken up for the first time.
This might be related to #6581

Sketch

#include <WiFiClientSecure.h>

const char* ssid     = "SSID";     // your network SSID (name of wifi network)
const char* password = "password"; // your network password

const char*  server = "www.howsmyssl.com";  // Server URL


WiFiClientSecure client;

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  delay(15000);

  esp_sleep_enable_timer_wakeup(10e6);  //

  Serial.print("Attempting to connect to SSID: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);

  // attempt to connect to Wifi network:
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    // wait 1 second for re-trying
    delay(1000);
  }

  Serial.print("Connected to ");
  Serial.println(ssid);

  Serial.println("\nStarting connection to server...");
  client.setInsecure();//skip verification
  if (!client.connect(server, 443))
    Serial.println("Connection failed!");
  else {
    Serial.println("Connected to server!");
    // Make a HTTP request:
    client.println("GET https://www.howsmyssl.com/a/check HTTP/1.0");
    client.println("Host: www.howsmyssl.com");
    client.println("Connection: close");
    client.println();

    while (client.connected()) {
      String line = client.readStringUntil('\n');
      if (line == "\r") {
        Serial.println("headers received");
        break;
      }
    }
    // if there are incoming bytes available
    // from the server, read them and print them:
    while (client.available()) {
      char c = client.read();
      Serial.write(c);
    }

    client.stop();

    //esp_deep_sleep_start();
    esp_light_sleep_start();
  }
}

void loop() {
  // do nothing
}

Debug Message

None

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions