Open JeffyOLOLO opened 1 year ago
I found that the Unexpected descriptor value length
error also appears on any action if nothing is connected to the board via Bluetooth.
Note: if remove PCF8574
and Wire
code, the issues are still reproducible.
Thank you for taking the time to submit this report!
I have to admit that I haven't really kept up with the ESP32 for the past two years or so. The MIDI BLE code was written for the ESP-IDF v3.2, and the Arduino Core has since upgraded to v4.4.3, with support for new boards etc., so it wouldn't surprise me if some changes to the code are necessary.
That being said, it's not very high up on my todo list at the moment, unfortunately I have to prioritize other things right now. I can try to quickly comment on the points you raised:
ble2902_get_value
function seems to be called with a handle that points to an attribute of length 0, causing the Unknown descriptor value
error. At first sight, this is caused by the BLE client not actually writing the attribute before Control Surface reads it. This is not an issue, so you can safely ignore the message.xRingbufferReceiveFromISR
, which is not a function that Control Surface itself calls directly, and I wasn't able to reproduce it on my end. Could you upload the full source code, the binary and the full stack trace? You can decode it using https://github.com/me-no-dev/EspExceptionDecoder.I did a quick test using the main
version of Control Surface, with arduino-esp32 v2.0.6 (Sparkfun ESP32 Thing), connecting to both the “MIDI BLE Connect” app on Android, and to Ubuntu 22.04. I could send and receive MIDI without issues. This is the code I used:
#include <Arduino.h>
#include <Control_Surface.h>
BluetoothMIDI_Interface bleMidi;
USBDebugMIDI_Interface usbDbgMidi = 115200;
BidirectionalMIDI_PipeFactory<2> pipes;
NoteChordButton chords[] {
{ 0, MIDI_Notes::Db(4), Chords::Major },
};
void setup() {
Control_Surface | pipes | usbDbgMidi;
Control_Surface | pipes | bleMidi;
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}
Hi, thanks for such powerful library/framework!
I'm building a MIDI keyboard using ESP32-S (the ESP32-Cam board) and want to use Bluetooth as an interface. But I encountered a few issues.
Testing environment:
toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
in a build log)Issues: 1) Unstable connection Phone connects to the board from the second time. I do it using Bluetooth MIDI Connect. For the first time I connect and immediately the connection disappears, on the second time it connects successfully. But sometimes I need to repeat this algorithm several times to make it work.
2)
[ble2902.c:32] ble2902_get_value(): [MIDIBLE] Unexpected descriptor value length (0)
error When connection is successful, there is this error in the log. But everything works, I can play notes. Sometimes it appears in the log during playing, but I couldn't find a pattern.3) Pipes don't work The board starts, but if I try to do any action it crashes, for example: If I try to press a button, it crashes and reboots. If I try to pair to the board, it also crashes with another error and prints a dump, I can attach it if you are interested. I didn't use any other interface except the usb debug one, so probably this is only a ble problem. The log for the button case:
My code: This is the code that I used to reproduce the third issue, but if you comment out
usbDbgMidi
and pipes code, it will be the code that I used for issues 1 and 2. I can attachPCF8574.h
code as well if you think it's important.