-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 S2 and S3 support?? #18
Comments
I don't have the hardware, it crossed my mind, but hoping other would contribute - you? (What underlying lib from S2 or S3 can we use?) |
I believe this one can do it as well. But I do prefer the way you library handles the MIDI, based on the arduino midi library which is quite intuitive for a beginner like me. About the hardware, are you in Europe? |
I’ll have a look at the Tiny-USB API |
Cool, I am in Germany. Is there a way we can send Private messages here? |
The ESP32 S2 can do WiFi and native USB but it cannot do BLE Midi unfortunately. |
Is there anything new known about USB MIDI on the ESP32-S3? I want to build a MIDI instrument that can switch between BLE MIDI and USB MIDI. I am hoping the S3 can do this. |
I did found this and looks promising (albeit USB only), but i never tried - can you try? |
I don't have an S3 right now but I will order one and give it a try. |
I am successfully using Serial, USB, BLE, and RTP Midi on an S3. All in the same project. |
Cool! Can you post the code on how to use |
Well, I believe I use the "TinyUSB" library instead of this one, not "with" this one.
And to send MIDI via USB:
The picture shows the Boards configuration I use to make it work. |
Looks like TinyUSB exposes a serial interface (rather than a USB device). Good to know |
I am successfully using Serial, USB, BLE, and RTP Midi on an S3. All in the same project. Would you please tell me which board you are using. |
ESP32-S3 N16R8 |
Thank you. |
Here are my findings so far. I am using a very similar board to jhsa - a cheap clone of the Espressif ESP32-S3-DevKitC-1 (note not the current version 1.1): https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1-v1.0.html Arduino 2.2.1 with the following board settings:
Connected to the USB-OTG port on the board (labelled USB underneath the board), nothing on the USB to Serial port (labelled COM). (Working with this board requires a lot of button presses so I brought out the Boot and Reset buttons to make it easier to use. I added a direct connection to D+ D- to see if that made any difference and it did not). What works:
#include <Arduino.h> // USB MIDI object // Create a new instance of the Arduino MIDI Library, void setup() { void loop() { What does not work: Using the USB-MIDI Transport. The same sketch modified to use USB-MIDI Transport: void setup() { void loop() { does not compile: WARNING: library MIDIUSB claims to run on avr, sam, samd architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s). exit status 1 Compilation error: exit status 1 FWIW, the same sketch using the BLEMIDI Transport does work: #include <BLEMIDI_Transport.h> BLEMIDI_CREATE_INSTANCE("MIDI_CONCERTINA", MIDI) void setup() { void loop() { |
Try initialize the serial after the Midi.begin(). Do you still need the delay? |
No, that works without the delay. |
Perhaps one of those things that we aren't supposed to understand ;) Midi is also serial, so maybe the library doesn't like the fact that some other serial started before it tries to start its own serial. and I believe that even the baudrate is the same? |
I have found other situations on this and other ESP32 boards where I need to put in a delay after Serial.begin. For example in setup:
If I don't have the delay then that Serial.println does not happen, in this case a full 2 seconds is needed. |
Yeah, same here, I also sometimes need to add some delays for stuff to work, specially on ESP32 :) |
Or maybe just |
This does not work on ESP32 S3 boards. |
Is there any outcome or resolution to this thread? It seems to have devolved to discussions of Serial operation. I'm hoping to send and receive USB Midi on the Espressif ESP32-S3-DevkitC-1 N8R8 |
Using the AdaFruit TinyUSB library as outlined above works but I have been having problems with the recent recent versions of TinyUSB library. As of now I am still using version 2.40, anything later than that does not work for me using a Nano ESP32. |
Thanks DonWT, examples compile now without indecipherable error messages. (With V2.40 of the library.) |
I have experienced two different problems with the Tiny USB library versions after version 2.40. One is the compile failures that you have seen. These are failures reported when the IDE tries to compile the library itself, not your code. The errors seem to be board dependent, the compile works fine with some boards and not with others. The other problem is that, at least with my Nano ESP32, the Serial port is not re-established after the midi connection is made. Code is compiled, uploaded and makes the midi connection OK, but any Serial.print statements are ignored. I also have to reset the board into the boot loader before I can upload a new sketch. Both problems seem to be hardware/board dependent. I have raised the issue on the TinyUSB GitHub but the maintainer only has an Adafruit Feather S3 and he says that he does not see these problems on that board. Version 2.40 seems to work just fine on the boards that I have and I don't see any compelling reason to want to use a higher version of the TinyUSB library. Oh, and one other thing. I am using a windows 10 box for development and I have found that the latency between it and my Nano Esp32 running the TinyUSB library is really bad. I can use it for debugging but it would be useless for playing a midi instrument. I don't know if this is because of Windows deficiencies or if it is something to do with the TinyUSB library. The Fourtyseven effects library is not the problem because I can use it for BLE midi connected to an old Android cell phone and that works well, (subjectively) it has low latency. |
Waveshare ESP32-S3 ZERO here Examples compile correctly with Arduino IDE but using platformio I get this error `CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-fh4r2.html
|
|-- USB-MIDI @ 1.1.3Is this the correct library? Version 3 of the ESP32 platform has its own USB MIDI library - which I have not been able to get working. Maybe you have picked this one instead of the Adafruit library. |
It is this library
This setup works on the Arduino IDE but not in platformio. What should I do with the Adafruit library? |
"What should I do with the Adafruit library?" All I can say is to read all of this forum topic as it does discuss using the Adafruit library for USB MIDI. For my own project, I am still using an old version of the Adafruit library (v2.40) and an old version of the ESP32 board manager (v2.0.17 -the last one before version 3 was released). I am hoping that one day the various incompatibilities will get sorted out. I sometimes wish that I had used a Teensy instead of the ESP32 S3. |
"Examples compile correctly with Arduino IDE" Have you tried running the resulting code? I suspect that they will not work. |
Wow so annoying. Thank you for the info. edit: even the Adafruit library compiles correctly with Arduino IDE but not on platformio
No I did not, I didn't receive the module I ordered yet. |
In theory everything should work on Arduino IDE, it's a esp32 core issue and it was recently fixed with 3.0.7 |
But that is about the Adafruit library, not the library that you were trying to use:
|
If with this library compiles without errors too then there's a good chance there will be no problems when I'm going to load the program onto the esp. I will find out eventually when I will get the board. |
Would it be possible to make this library work with the ESP32 S2 and S3? Both support native USB.
Thanks
The text was updated successfully, but these errors were encountered: