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

Joystick not recognized #2

Closed hfjg closed 11 months ago

hfjg commented 11 months ago

Issue

Examples "FlightControllerTest.ino" and "JoystickTest.ino" both do not report HID device. Actually, nothing is reported. Test with flashing the onboard LED works, so I expect the program is transferred correctly.

Hardware

S2_DevBoard-clone by "VCC GND", separate usb connectors for native usb and UART

PC

Examples checked with lsusb, dmesg and syslog, no USB from board reported

schnoog commented 11 months ago

Hi, I tried the examples on a S2 and a S3 board before i pushed them to github. Using the Arduino IDE it's necessary to "enable USB CDC on boot". Additionally I have chosen the USB-Mode USB-OTG(TinyUSB)

Unfortunately I'm currently not aware how to set this in Platfromio.

hfjg commented 11 months ago

Thank you. I'll check tomorrow.

schnoog commented 11 months ago

You're welcome.

build_flags = -DARDUINO_USB_CDC_ON_BOOT=1

in your platformio.ini should do the trick.

Alternatively you can use

    USB.PID(0x8211);
    USB.VID(0x303b);
    USB.productName("My product name");
    USB.manufacturerName("My company name");
    USB.begin();

within you setup() procedure to set the PID/VID and start the USB device.

hfjg commented 11 months ago

Thank you so much. The Arduino option "enable USB CDC on boot" did the trick, and so did build_flags = -DARDUINO_USB_CDC_ON_BOOT=1 in Platformio.

Now I have to check for the data transmitted, but that's a complete different question...

schnoog commented 11 months ago

Great to hear that. Thank you very much for your feedback