Simulink problem and the “BLE Receive” block

5 visualizzazioni (ultimi 30 giorni)
Sébastien AZZOLA
Sébastien AZZOLA il 24 Dic 2023
Good morning,
I cannot receive data from a Bluetooth Low Energy sensor with simulink and the "BLE Receive" block.
I use an ESP WROOM 32 ESP card. It is recognized under Matlab and communication works.
I can scan and find the device and select the feature to read. But there is no feedback?
With direct commands (ble, blelist, etc.) I can recover the data.
It looks like I can't subscribe to the service?
Do you have an example to offer me?
Thanks for your help.
Best regards
Sebastian

Risposte (1)

Shubham
Shubham il 17 Gen 2024
Hey Sebastien,
It seems that you can use direct commands with your “ESP WROOM 32 ESP card” however you are unable to receive data from a Bluetooth Low Energy sensor using a BLE receive block in Simulink.
Since you can retrieve data using direct commands, I am assuming you are able to set up a connection. However please refer to the following:
2. For using ESP32 board properties, set the variant you are using: https://www.mathworks.com/help/supportpkg/arduino/ref/arduino-esp32-wroom-board-properties.html
Please note that you would require to install Support package for Arduino: https://www.mathworks.com/help/supportpkg/arduinoio/ug/intro.html#bvnykwy
Next you need to configure BLE Receive block by setting the “Mode” to “Central” to scan nearby devices in Simulink to connect with the ESP32 module. You can have a look at these examples using BLE receive block:
Lastly, if BLE Receive block does not work, you can try writing a MATLAB Function block to receive data since you are able to retrieve data from MATLAB. You can connect the output of this MATLAB function to wherever you need the data in your Simulink model.
Hope this helps.
  1 Commento
Sébastien AZZOLA
Sébastien AZZOLA il 18 Gen 2024
Good morning,
Thank you for your help.I followed this procedure to connect my ESP32 board and the test is OK.
I can scan Bluetooth devices with the ESP32 card and retrieve the "services and characteristics".
I can even read the name of the hardware. But when I want to receive the "Cycling Speed and Cadence" service with CharacteristicName "CSC Measurement", the data is incorrect and does not update?
I made a request to support and there is a problem with the "BLE receive" block.
I'm waiting for the correction.
Thanks again for the response.
Best regards

Accedi per commentare.

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by