Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ESP32-S3, can't send and receive message from Serial at the same time. #10323

Copy link
Copy link
Open
@raybantracing

Description

@raybantracing
Issue body actions

Board

Lolin ESP32-S3 and TinyS3

Device Description

Hardware Configuration

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

Win11 and Ubuntu 24

Flash frequency

240

PSRAM enabled

no

Upload speed

115200

Description

USB hangs when receiving and sending messages over Serial.
This happens on "virtual USB" devices but not on UART devices that uses hw chips like CH340 and similar.

The problem occurs randomly and may happen after 5 minutes or after 2 hours.

Sketch

#include <Arduino.h> //this needs to be first, or it all crashes and burns...

void setup() {
  Serial.setTimeout(10);
  Serial.setRxBufferSize(2000);
  Serial.begin(115200);
  Serial.setDebugOutput(true);
}

unsigned long prevMill = 0;
const long everyMillis = 1000;

void loop() {
  byte pre[2000];
  Serial.readBytes((byte *) pre, 2000);

  while(Serial.available() > 0) {
    char t = Serial.read();
  }
  unsigned long currentMillisA = millis();
  if (currentMillisA - prevMill >= everyMillis) {
    prevMill = currentMillisA;
    Serial.print("framerate:");
    Serial.println(currentMillisA);
  }
}

Python:

import serial
import time

arduino = serial.Serial(port='COM10', baudrate=115200, timeout=10)

def send_message():
    while True:        
        arduino.write(b'this is a long string this is a long string this is a long string this is a long string this is a long string this is a long string') 
        response = arduino.readline().decode('utf-8').strip() 
        if response:
            print(f"Received: {response}")
        time.sleep(0.010) 

if __name__ == "__main__":
    send_message()



### Debug Message

```plain
-

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

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.