adafruit / adafruit/Adafruit_nRF52_Arduino

BLE MIDI split SysEx messages read problem

Open
#172 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
699
Forks
570
PR merge metrics
No merged PRs in 30d

Description

I am using the nRF52 Feather as peripheral device for two way MIDI communication (MIDI foot controller).

Reading messages seems to cause occasional errors:

The central device is sending packets and sometimes another message appears before the message is fully received.

For example sends three packets (one message split in 3):

-8f 8e f0 00 20 33 00 00 03 00 00 01 53 61 6c 76 61 74 69 6f
-8f 6e 20 44 65 6c 75 78 65 20 50 75 73 68 65 64 20 56 33
-8f 30 00 8e f7

then it sends three other SysEx messages
-8f e8 f0 00 20 33 00 00 07 00 00 00 01 00 00 58 6f 76 65 72
-8f 20 6c 69 76 65 00 e8 f7

-90 a4 f0 00 20 33 00 00 07 00 00 00 01 00 01 6d 61 69 6e 00
-90 a4 f7

-90 e0 f0 00 20 33 00 00 07 00 00 00 01 00 02 73 65 63 6f 6e
-90 64 00 e0 f7

and the MIDI.read() on the peripheral device returns:

F0 00 20 33 00 00 03 00 00 01 53 61 6C 76 61 74 69 6F 6E 20 F0 00 20 33 00 00 07 00 00 00 01 00 02 73 65 63 6F 6E 64 00 F7

Some messages are somehow lost.

Did anybody else seen this behaviour?

Could that be a design problem? Should I switch the Central and Peripheral roles if the Central device sends more data to the Peripheral?
For most of the communication it works well. Interesting is, that I can reproduce this. The data is sent from the Central device with response required. I log the messages before sending and they are sent correct. The problem is most probably on the receiving side (Peripheral BLEmidi read).

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by reproducing the reported packet sequence on the nRF52 Feather peripheral and inspect the BLE MIDI receive path around MIDI.read(); done means each split SysEx message is returned completely without bytes being lost or merged.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
audio-video-rtc, embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.