cancel
Showing results for 
Search instead for 
Did you mean: 

Easier BLE trials instead of implementing whole GATT structure?

CWang.14
Associate II

Hi all,

I'm currently working with wb55 for developing a real-time imu data streaming service via bluetooth connections. I've looked through the documentation on https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB_HeartRatehttps://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB_HeartRate which is an example of creating a heart rate monitor. Also, I've downloaded the code example from github and burn onto my own wb55 for trials.

The questions right now I have is that, instead of going through the formal steps like creating that many files (in the figure), 0693W00000VOr3tQAD.pngis there a simpler way of doing bluetooth development on wb55, for example directly use some HAL functions for establishing the advertise/scan/discoverable mode of the device, set the MAC address, and send data through saving data on some local data buffer first. what i want to achieve is to stream real-time imu readings gathered via the M4 core and send to whatever devices connect to it. (like probably with transmission rate as 70Hz)

Let's say, to make it easiet, how to let my wb55 send "Hello World!\n" every 50 ms through a visible bluetooth MAC address, and could be received by my laptop using python bluetooth libs like following?

import bluetooth
 
host = "E4:5F:01:42:E0:F8" # The sample addr simulating the wb55 MAC
port = 1
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((host, port))

Also, I have followed steps from https://www.youtube.com/watch?v=i10X4Blr8ns to initialize a basic BLE application which could be recognized by ST's BLEToolbox, question right now is how to add the features that I want. The follow graph shows the directory of the simple app.0693W00000VOrClQAL.png 

Any Help would be appreciated!

Cody

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

You can look BLE_Peripheral_Lite example available in STM32CubeWB package. This example is to demonstrate simple BLE peripheral operation with bidirectional communication with minimalistic CPU2 configuration flow and Lite service support with minimum needed features activation (not including e.g. Tasks Sequencer, Timer Server, Low-Power Manager).

To send data every 50 ms, you have to create a characteristic with a length of your data and notification property and send a notification every 50 ms, in BLE_HeartRate example the heart rate measurement is send every 1s for example.

Best Regards