Data transfer via BLE to mobile app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-26 10:25 PM
I'm working on sensor data transfer via BLE to mobile app (like nrf connect). My STM32WB board gets connected with the app, but the data is not transmitted. When I give functions in the main while loop for transmitting, it stop the device advertisement at mobile app. How to transfer the data to mobile app? I need to send continuous sensor data to mobile app.
I've also tested timer function as well. But still, it's impossible for me to transfer the data.
I'm attaching the image of mobile app connection, there you can see that the value is 0. There, I need sensor data to be printed.
Can anyone help me to resolve this issue? Thanks in advance!
Solved! Go to Solution.
- Labels:
-
BLE
-
STM32WB series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-27 9:44 AM
Hello @barathi_0206
I suggest you to take a look at this application and compare it to your configuration. It should be really helpful.
Dont forget to read the readme file of this project and take a look at the wiki pages mentionned there. It should be helpful too.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-27 9:44 AM
Hello @barathi_0206
I suggest you to take a look at this application and compare it to your configuration. It should be really helpful.
Dont forget to read the readme file of this project and take a look at the wiki pages mentionned there. It should be helpful too.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-05 2:06 AM - edited ‎2024-12-05 2:10 AM
Thankyou @STTwo-32! It works. However it works for static continuous data. But with varying data (like from sensors), it doesn't receive it. In mobile app I receive data like 2E-16-00-00-00. I have also increased my UUID type into 128 bits. Still it receive like this. How to solve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-20 12:32 AM
Hii Barathi_0206,
i am new with BLE can you help me with steps in stm32cube ide how to transmit and receive data through BLE,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-20 12:45 AM
Hi @mihirsinha_
You can go through this wiki link for better understanding and practice this procedures. let me know if you need help at any particular areas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-20 12:55 AM
Thank you, Barathi_0206.
This will help me a lot. Actually, I already generated the code by following some tutorials, and I can see my device name on my mobile. But I want to send some data as well. Can you help me with the code where and what should I write to continuously send data like "Hello, World" for now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-20 2:20 AM
Try this for sending data via BLE to mobile app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-21 12:03 AM
Hi Barathi_0206,
Thanks for this tutorial — it's working!
Actually, what I'm working on involves using multiple ADCs with my mcu stm32wb55cgu6. Earlier, I was printing the data to the serial monitor via USB. Now, I want to use BLE instead of serial print. In main.c, I have done some calculations and all the initialization steps.
After using this tutorial, I saw that data is sent using a button press. But when I try to send the data directly from the main function, either it goes to the" void HardFault_Handler()" or the value is not advertised.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-22 12:18 AM
Yes, I’ve faced this issue too. To resolve it, you should use a timer to handle your ADC readings. For continuous data transmission over BLE, go to custom_app.c and locate the Custom_YourCharacteristicName_Update_Char() function. This is where the BLE data gets updated.
Inside this function, you’ll find a line responsible for updating the characteristic value—comment that line out. Instead, move that line into your timer callback function. Then, simply call the timer callback from within the update function.
This approach worked for me, and I hope it helps you too!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-22 5:10 AM
Thank you Barathi_0206,
it is working.
Will you help me with one more doubt? I also want to send commands through my mobile. Can you tell me where and how to store that command in a variable.
