arduino BLE send/receive simulink problem

26 views (last 30 days)
Paul
Paul on 30 Dec 2025 at 23:35
Commented: Paul ungefär 18 timmar ago
Hello,
I am trying to send /receive BLE data from the sensors on an arduino board in simulink using some predifined BLE peripheral blocks. Then I upload the code on the arduino hardware and run it. So far this works with arduino nano iot 33 as all characteristics are visible.
It does not with BLE, BLE sense, and BLE sense rev2 boards. With the latter, the BLE service does not show up, for example in matlab calling blelist.
I tried with an ESP32 board as well. Here characteristics appear, but it depends on how many have been defined in simulink. Some of them are not accesible and some carry the same uuid although they have been given a different characteristic uuid in Simulink. It gives a erratic impression.
I've looked around on the forum but can't find a solution. This seems to be a simulink incompatability issue...?
Is there perhaps a workaround for this problem ?
Thanks for any help

Accepted Answer

Umar
Umar on 1 Jan 2026 at 23:11

@Paul, After going through some extensive research online into this issue, it looks like you're dealing with a genuine Simulink compatibility problem rather than something you're doing wrong. The Arduino Nano 33 IoT works fine because it's well-supported, but the BLE Sense has known issues where the service doesn't advertise properly even though it's officially listed as supported hardware. The Rev2 isn't even on the supported list at all as mentioned by @Walter Robertson, so that explains why it fails completely. For the ESP32 boards, there's a documented problem with UUID corruption in the BLE stack integration where characteristics end up with duplicate or random UUIDs regardless of what you define in Simulink. A few things worth trying: double-check your BLE properties configuration in Model Settings under Target hardware resources, make sure the Peripheral Device Name and Peripheral Local Name are explicitly set, and try starting with one of the working example models like arduino_BLE_peripheral to see if basic functionality works before adding your custom characteristics. With ESP32, try limiting the number of characteristics initially since you mentioned it's dependent on how many you define. Some people have had success bypassing the BLE blocks entirely and using MATLAB Function blocks with native Arduino BLE library calls, though that's more work. If nothing works, it might be worth sticking with the IoT boards since they're clearly the most stable option, or consider using BLE Sense boards only in central mode where they seem more reliable. This really does seem like a support package gap that MathWorks needs to address, so submitting feedback through the official channels with your specific setup details would probably help get this fixed in future releases.

Let me know how it goes.

More Answers (1)

Walter Roberson
Walter Roberson on 31 Dec 2025 at 3:37
BLE sense rev2 is not supported by the Simulink Support Package for Arduino
Look at the list of supported hardware, https://www.mathworks.com/hardware-support/arduino.html and see that it lists BLE sense but not BLE sense rev2.
  1 Comment
Paul
Paul on 31 Dec 2025 at 12:50
Hi yes, thanks, I know but BLE sense should work and it doesn't, although with arduino iot 33 it does work.
Maybe I am doing something wrong (yet I did not change a single thing in the model). Also, with ESP32 boards seems to not work correctly for BLE...
Just wondering whether somebody had simimar issues.

Sign in to comment.

Products


Release

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!