lathoub / Arduino-USBMIDI

Allows a microcontroller, with native USB capabilities, to appear as a MIDI device over USB to a connected computer
MIT License
148 stars 11 forks source link

PluggableUSB.h #17

Open marchingband opened 1 year ago

marchingband commented 1 year ago

I am getting an error that I cannot resolve.

/Users/temporary/Documents/Arduino/libraries/USBMIDI/src/usbmidi_pluggableusb.cpp:13:10: fatal error: PluggableUSB.h: No such file or directory
 #include <PluggableUSB.h>

I see other posts online about this issue, but nothing that has helped me, are you able to offer some clarity or a fix or workaround? Thank you!

lathoub commented 1 year ago

What is your hardware?

marchingband commented 1 year ago

Seeed XIAO SAMD21

lathoub commented 1 year ago

I believe PluggableUSB.h is part of the standard Arduino stack when selecting SAMD based boards. Can you compile examples from the MIDIUSB dependancy library?

marchingband commented 1 year ago

No, I get the same error compiling usbMidiLoopback. Infact in the examples drop-down, USBMIDI examples are placed in the INCOMPATIBLE sub-menu. XIAO has it's own board file. https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

lathoub commented 1 year ago

That explains the error, board not compatible :-(

lathoub commented 1 year ago

Does it come with its own usb lib?

marchingband commented 1 year ago

It's strange, because I have been compiling the same program for over a year, with no errors, it only appeared recently. I updated your library, got the error, went back to the old version I was using before (v1.0.1), but still get the error now. XIAO doesn't come with its own USB lib that I know of, you have 2 options "Arduino" or "TinyUSB" under tools->USBStack.

marchingband commented 1 year ago

Would you be interested in supporting the XIAO? It's one of the only ways to get a SAMD21 with the chip shortage.

marchingband commented 1 year ago

I installed Adafruit SAMD boards, and selected trinket_m0. I get the same error, and USBMIDI is still listed as INCOMPATIBLE. Any idea what could be going on here? Is this something about my personal installation perhaps?

marchingband commented 1 year ago

I also get the error when using Arduino zero.

/Arduino/libraries/USBMIDI/src/usbmidi_pluggableusb.cpp:15:10: fatal error: PluggableUSB.h: No such file or directory
 #include <PluggableUSB.h>
marchingband commented 1 year ago

you code does

#include <PluggableUSB.h>

other libs do something like

#if defined(ARDUINO_ARCH_AVR)
#include "PluggableUSB.h"
#elif defined(ARDUINO_ARCH_SAM)
#include "USB/PluggableUSB.h"
lathoub commented 1 year ago

I also get the error when using Arduino zero.

Not here (using Arduino SAMD Boards) and Arduino IDE 1.8.19. Maybe it is your local installation that got corrupted?

your code does

Not this lib directly, the underlying MIDIUSB.h lib does - and it does make the difference between AVR and SAM code. See here:

https://github.com/arduino-libraries/MIDIUSB/blob/578f9f535e37cf8f557bddc1d6f85540b42cfba8/src/MIDIUSB.h#L23-L35

marchingband commented 1 year ago

That's strange because MIDIUSB does compile for me. For XIAO and other boards. If your library is built on top of that, I am very confused indeed. I have 3 machines with fresh installs of Arduino and these libs, all report the error. 2 are OSX one is PC.

Do you have any tips how I could proceed? I use your lib in an open source project that has a few users. One user reported the problem, and after updating I have it as well.

marchingband commented 1 year ago

I realize before you asked me to compile the MIDIUSB examples. I misread that as USBMIDI. MIDIUSB is compatible, USBMIDI is not.

marchingband commented 1 year ago

OMG I have the wrong repo I am so so so sorry, I thought this was for USBMIDI, but its USB-MIDI. As you were.