Open
Description
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
Labels
Relates to peripheral's APIs.Relates to peripheral's APIs.awaiting a response from the authorawaiting a response from the author