-
|
Hello everyone Wondering if i can get some assistance about the usb host (on the go) implementation using arduino core v3.0+ on the oficial Surface documentation we have this note: "The ESP32-S2 and ESP32-S3 chips have native USB support, and MIDI over USB is supported by Control Surface when using version 3.0.0 or later of the arduino-esp32 core" we are in v3.3.6 as far as i can tell i would like to apply the example 4 found here for implementing a MIDI-over-USB to MIDI-over-BLE adapter on my MCU i just did a copy paste of the code but is not working as it is. The usb host functionality and its technical notes from espressiff are making really hard to find if the capability has been completely set into arduino For instance here , it is mentioned this: "it's being worked on. Current core 3.3.3 already supports TinyUSB host, but still needs Arduino abstraction for it." They are talking about tinyusb. so i wonder if this is the backend use on this library, or if is an unrelated topic for this library example I am aware that with my board, i need a usb-c breakout, which is currently connected to the right pins (D+, D- on pin 19 and 20 plus vbus for 5v and ground) and actually when the board is powered via battery or via usb on the serial port, the usb breakout can power ext devices as well, so the connections are fine. So, if the surface Library should work with Arduino v3.0+ and if the connections are ok, is there anyway to troubleshoot this MIDI host functionality or is not tested yet with the curren library 2.1? Thx! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
|
I found this related article but it was not concluded with a solution I also found this on the guide regarding USBHostMIDI_Interface Class Reference but it is not mentioning esp32 boards, so i am not sure if it is mandatory to include such class for the example mentioned above Thx again! |
Beta Was this translation helpful? Give feedback.
-
|
Control Surface currently has no explicit support for USB Host on the ESP32. The main reason is that most Arduinos don't have proper software support for it, and things like enumeration of the connected devices and handling of USB events is much more involved than in the case of USB Device mode. That being said, if USB Host support is available in the arduino-esp32 core, you can easily integrate integrate it with a Control Surface MIDI_Interface using https://tttapa.github.io/Control-Surface/Doxygen/d7/d5f/Custom-USB-MIDI-Backend_8ino-example.html. You'll still have to manage all the USB Host-specific logic in your sketch (or offload it to another library like TinyUSB), though. To clarify: if you have code in your sketch to configure the USB hardware in Host mode, handle enumeration, discover connected MIDI devices, set up the MIDI bulk endpoints for those devices, and handle other Host controller events, you can easily use the Control Surface example above to send and receive MIDI data over those endpoints. You could either use the Espressif USB Host library, see e.g. https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/usb_host_lib or TinyUSB https://github.com/hathach/tinyusb/blob/master/examples/host/midi_rx/src/main.c. I have never tried this myself, though, and I am not up to date with the current status of TinyUSB Host support in the arduino-esp32 core. If TinyUSB works, that's probably the easiest route. |
Beta Was this translation helpful? Give feedback.
-
|
OP, It uses tinyUSB stack, so I would expect it to run on any micro that supports it, and also support host function. I made my hardware on RPi2040Zero. |
Beta Was this translation helpful? Give feedback.
-
|
Note that for my hardware implementation of USB host adapter I use RP2040_zero. I believe it should also compile for ESP32-S2 or S3, though I would suggest to use original example code from original library as staring point and edit it for LED you have onboard. Or edit it out for that matter. |
Beta Was this translation helpful? Give feedback.
-
|
I believe in the end.the issue was that my board was not fully providing 5v to the usb breakout cause the code works as intended with another usb midi powered by internal battery. So i would recommend to try that way ot buy a power booster to 5v |
Beta Was this translation helpful? Give feedback.
Control Surface currently has no explicit support for USB Host on the ESP32. The main reason is that most Arduinos don't have proper software support for it, and things like enumeration of the connected devices and handling of USB events is much more involved than in the case of USB Device mode. That being said, if USB Host support is available in the arduino-esp32 core, you can easily integrate integrate it with a Control Surface MIDI_Interface using https://tttapa.github.io/Control-Surface/Doxygen/d7/d5f/Custom-USB-MIDI-Backend_8ino-example.html. You'll still have to manage all the USB Host-specific logic in your sketch (or offload it to another library like TinyUSB), though.
To clarify…