-
Notifications
You must be signed in to change notification settings - Fork 145
ESP32-S3 not appearing as a MIDI device #279
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
Comments
are you using the stock midi_test sketch, if yes then just put links or name the example. Otherwise, attach your sketch as txt file. |
I'm using the stock midi_test sketch from the examples in Adafruit TinyUSB Library -> MIDI. Since posting the initial issue report, I've tested on two other ESP32 S3 boards, the Lolin S2 Mini and the Lilygo T7 S3. Both display the same results as reported when using the S3 Dev Board. To repeat, the program compiles and loads, but the board does not show up as a USB MIDI device on my Mac and no MIDI data is transmitted. The call to TinyUSBDevice.mounted() returns false so the program halts. Even if bypassed MIDI data is not sent (or received). Also reconfirming that an equivalent example from the related library ESPTinyUSB (https://github.com/chegewara/EspTinyUSB/blob/master/examples/device/midi/midi.ino) does appear as a MIDI device, but no MIDI data is transmitted. Finally, the example works fine on the ESP32-S2 boards I've tested. |
Hi, Same issue here on win10. Then I tried to reproduce it on an esp32-s3 without success. Also tried examples to have usb_hid. No mode seems to switch the USB mode. My platformio.ini is as it follows:
|
midi_test sketch works with ArduinoIDE but not with Platformio due to the order of includes. I am using the following
|
Solved on Arduino IDE. After much trial and error and thanks to a post by ruprup on the platform io community site. The following changes from the default Arduino IDE setting for S3 boards are required:
Also, on some boards it may be necessary to:
|
thank for the update, you should always try with arduino IDE first, then based platformio config based on the defineds of arduino IDE. |
I'm having the same problem again. Below are my environments. arduino-cli compile --fqbn esp32:esp32:esp32s3 ./rawhid --output-dir ./rawhid 1 ✘ 6s 19:10:19
Sketch uses 278413 bytes (21%) of program storage space. Maximum is 1310720 bytes.
Global variables use 19904 bytes (6%) of dynamic memory, leaving 307776 bytes for local variables. Maximum is 327680 bytes.
Used library Version Path
Adafruit TinyUSB Library 2.3.1 /home/noname/Arduino/libraries/Adafruit_TinyUSB_Library
SPI 2.0.0 /home/noname/.arduino15/packages/esp32/hardware/esp32/2.0.14/libraries/SPI
Used platform Version Path
esp32:esp32 2.0.14 /home/noname/.arduino15/packages/esp32/hardware/esp32/2.0.14 and i used the arduino ide like you set,it’s the same. any idea is welcome. |
Also having this problem. USB MIDI device presents itself when using arduino-esp32 core 3.0 on a mac but will not show up on my windows 10. I am running out of ideas |
Confirm issue still exists, tried multiple versions. Official expressif examples work without issues |
this is macos specific issue, should be fixed with #454 using midi_test example. Note that in your sketch, you may need to force re-enumeration like updated example. S3 is a fast chip, macos driver is also very quick. Together s3 board is already enumerated by the time setup() is called to initialize other class driver such as midi |
Operating System
MacOS
Arduino IDE version
2.0.4
Board
ESP32-S3 dev board
ArduinoCore version
ESP32
TinyUSB Library version
2.0.3
Sketch as ATTACHED TXT
#include <Arduino.h>
#include <Adafruit_TinyUSB.h>
#include <MIDI.h>
// USB MIDI object
Adafruit_USBD_MIDI usb_midi;
// Create a new instance of the Arduino MIDI Library,
// and attach usb_midi as the transport.
MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usb_midi, MIDI);
// Variable that holds the current position in the sequence.
uint32_t position = 0;
// Store example melody as an array of note values
byte note_sequence[] = {
74,78,81,86,90,93,98,102,57,61,66,69,73,78,81,85,88,92,97,100,97,92,88,85,81,78,
74,69,66,62,57,62,66,69,74,78,81,86,90,93,97,102,97,93,90,85,81,78,73,68,64,61,
56,61,64,68,74,78,81,86,90,93,98,102
};
void setup()
{
#if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040)
// Manual begin() is required on core without built-in support for TinyUSB such as mbed rp2040
TinyUSB_Device_Init(0);
#endif
pinMode(LED_BUILTIN, OUTPUT);
//usb_midi.setStringDescriptor("TinyUSB MIDI");
// Initialize MIDI, and listen to all MIDI channels
// This will also call usb_midi's begin()
MIDI.begin(MIDI_CHANNEL_OMNI);
// Attach the handleNoteOn function to the MIDI Library. It will
// be called whenever the Bluefruit receives MIDI Note On messages.
MIDI.setHandleNoteOn(handleNoteOn);
// Do the same for MIDI Note Off messages.
MIDI.setHandleNoteOff(handleNoteOff);
Serial.begin(115200);
// wait until device mounted
while( !TinyUSBDevice.mounted() ) delay(1);
}
void loop()
{
static uint32_t start_ms = 0;
if ( millis() - start_ms > 266 )
{
start_ms += 266;
}
// read any new MIDI messages
MIDI.read();
}
void handleNoteOn(byte channel, byte pitch, byte velocity)
{
// Log when a note is pressed.
Serial.print("Note on: channel = ");
Serial.print(channel);
Serial.print(" pitch = ");
Serial.print(pitch);
Serial.print(" velocity = ");
Serial.println(velocity);
}
void handleNoteOff(byte channel, byte pitch, byte velocity)
{
// Log when a note is released.
Serial.print("Note off: channel = ");
Serial.print(channel);
Serial.print(" pitch = ");
Serial.print(pitch);
Serial.print(" velocity = ");
Serial.println(velocity);
}
Compiled Log as ATTACHED TXT
Sketch uses 269553 bytes (20%) of program storage space. Maximum is 1310720 bytes.
Global variables use 21128 bytes (6%) of dynamic memory, leaving 306552 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/cu.wchusbserial56292538521
Connecting....
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
What happened ?
The code compiles and uploads, but the Microcontroller does not appear on my computer as a USB MIDI device. No data is able to be transmitted.
Similar code using a similar library at https://github.com/chegewara/EspTinyUSB does appear as a MIDI device but that library has other issues that MIDI message send and receive are not (yet) working.
How to reproduce ?
Debug Log
N/A
Screenshots
N/A
The text was updated successfully, but these errors were encountered: