cancel
Showing results for 
Search instead for 
Did you mean: 

STEVAL-MKBox Pro – BLE Sensor Logging & Data Transfer to Raspberry Pi

Dali_Aamira
Associate II

Hi everyone,

I'm working on a project involving the STEVAL-MKBox Pro and would love some guidance from the community, especially since I'm still relatively new to this ecosystem.

Here's what I'm trying to achieve:

• Configure sensors on the STEVAL-MKBox Pro via Bluetooth using PnPL commands
• Control data logging (start/stop) remotely over BLE
• Save the collected data locally on the SD card
• Once logging is complete, transfer the data to a Raspberry Pi 4 via BLE

The reason I chose to log first and transfer later rather than streaming directly over BLE  is the bandwidth limitation of BLE. My application requires high-frequency data acquisition, so buffering to SD card first and transferring afterward seems like the more reliable approach.

My main question is: where should I start?

Should I build on top of an existing firmware like FP-SNS-DATALOG2, or would it make more sense to start from scratch given my specific requirements?

I have a basic understanding of the tools involved, but I'd really appreciate any advice on the best approach, potential pitfalls to watch out for, or existing examples that might point me in the right direction.

Thanks in advance for your help! 

6 REPLIES 6
Smithson
Associate III

If you read the post immediately after your one, you will see some interesting stuff on the problems. 

I would start with a USB cable or the SD card.  

You should be able to get my c# code running on mono on the Pi - I think.

SimonePradolini
ST Employee

Hello @Dali_Aamira 

FP-SNS-DATALOG2 is the ideal solution to collect your data and create heterogeneous datasets.

The firmware is complex, but as a starting point you could use it as-it-is. It’s already supporting the features that you’re searching for:

  • Sensor control and configuration via PnPL commands through Bluetooth®, using the STBLESensor app
  • Data logging on SD card (be aware of SD card limitation described in the User Manual chapter 2.2.7)

On the Raspberry Pi side, ST is also providing a Python SDK called STDATALOG-PYSDK. It has been developed to support DATALOG2 natively. You can build up your host application on top of it or by checking and modifying the ready-to-use scripts released there. The SDK is also helping you plotting the data and saving and processing the dataset as you need.

Another user has already discussed here and developed a BLE-based solution for Raspberry Pi. I wish this thread could help you.

 

Best regards,

Simone

In order 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.

Hi @SimonePradolini 
thank you for your respond, i just want to ask is it possible to duplicate the communication between the STBLESensor app and the FPS-SNS-DATALOG2 with a python script ?
if yes, from where can i get the information i need ( protocol of communication/ the UUIDs ...etc)

Best regards,
Dali



Hi @Smithson,
I really appreciate your respond and i will consider it
Best regards,
Dali

Hello @Dali_Aamira 

As stated in my previous comment, another user has already discussed a similar use case here. They developed a BLE-based solution for Raspberry Pi on top of the STDATALOG-PYSDK. There’s no ready-to-use script example for your specific application, but you can take a look to the whole thread discussion. You'll find all the steps and the details on the protocols there.

 

Best regards,

Simone

 

In order 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.
tomsmite
Associate II
 

Great project, your approach of logging to SD first and transferring later over BLE makes a lot of sense given the bandwidth limits.

I’d strongly recommend starting with FP-SNS-DATALOG2 rather than building from scratch. It already supports sensor configuration and SD card logging, and it integrates with PnPL, which should save you a lot of development time. You can then extend it to handle your specific BLE transfer workflow to the Raspberry Pi.

For BLE control, check how PnPL commands are exposed over BLE in the existing firmware you may just need to customize or add commands for start/stop logging and file transfer.

One thing to watch out for: BLE file transfer can still be slow for large datasets, so you might want to implement chunking and, depending on your data size, compression.

Also, worth exploring if the Raspberry Pi can act as a BLE client efficiently for your use case, especially for handling larger transfers reliably.

Overall, building on what’s already there and then customizing it will save you a lot of time and headaches.

Good luck!