schnoog / Joystick_ESP32S2

Joystick library for ESP32 S2 & S3 devices (native USB) for the Arduino framework.
GNU Lesser General Public License v3.0
34 stars 3 forks source link

Simultaneous serial and gamepad data #12

Open ChrGri opened 4 months ago

ChrGri commented 4 months ago

Thank you for this awesome project.

I'm using an ESP32 S3 (connected via USB port) and want to send/read additional serial data over the USB port to monitor/debug the ESP.

What seems to work:

What does not work:

Do you have an example script where the additional serial communication is working properly?

BR Chris

ChrGri commented 4 months ago

I wrote a simple test script (see attachment) and it does what I'm expecting: changing the USB gamepad output and printing info to the Arduino serial monitor simultaneously. Joystick_Serial_test.zip

My original code has two tasks running on two cores which are accessing the same USB port. Apperently that creates some trouble. I'll continoue the serach for a solution.

schnoog commented 4 months ago

Hi Chris, thanks for your feedback.

In my projects I never used the serial output and both cores at the same time. Thanks for having a look into it. Would appreciate if you could keep me updated.

Cheers Volker

ChrGri commented 4 months ago

Can you confirm that the flash settings are okay? Specifically "CDC on boot enabled" & "USB mode OTG".

324125279-dc73cd64-73c5-4bd5-ba5f-7b06a87677b7.png

The USB cable is connected to the USB OTG port.

BR Christopher

schnoog commented 4 months ago

What I'm seeing on your screenshot looks correct to me. (don't have ArduinoIDE installed at the moment, so assessment based on my memory)

A news delivery of S3 should arrive soon, will start testing once they arrived. My current ones are all wired to my simulator setup.

ChrGri commented 4 months ago

Hi @schnoog,

the current status is, that when serial and HID output are asked at high repetition rate, both outputs stop working. I've addded a testscript below. Feel free to play with the delay.

Joystick_Serial_test.ino.txt

Edit: I'm using this serial monitor since it allows to en-/disable the RTS/DTR signals manually. As soon as serial is activated via DTR, the HID output stalls. image

BR Chris