Showing results for 
Search instead for 
Did you mean: Machine learing with Unico GUI

Associate III

Hello everyone,

I'm trying to use the sensortile box pro for an ML alghoritm.

My idea is to have a machine learning algorithm that can identify two types of vibrations: correct and fault.

Using the firmware loaded on the Sensortilebox Pro Datalog 2.1.1, I was able to obtain the values from the accelerometer and gyroscope lsm6dsv16x_gyro.csv and lsm6dsv16x_acc.csv along with those from all other sensors such as the magnetometer lis2mdl_mag.csv.

Using a Python script, I then verified that the timestamps for the accelerometer and gyroscope were the same and merged the CSV files but i cannot do the same with the magnetometer.

 To create a decision tree, I have split the merged CSV into two different CSV files, one for each type of vibration: lsm6dsv16x_all_correct and lsm6dsv16x_all_fault.

Using the Unico_GUI software, I would like to generate the UCF file needed by the Sensortile to distinguish these vibrations. I followed the guide on GitHub for machine learning:


I select this configuration


Following the step this error occur to me but clicking yes it goes on



I upload both files with the correct label and fault label and here comes the first doubt, 
If i upload the magnetometer file it gives me no data even if the file cvs is full, how can i upload the data from magnetometer?


Moving forward, I use this configuration:


with one decision tree, windows lenght of 52, no filter and the mean of acceletometer and gyroscope 



The arff file is the generated without problem and same things with the ucf file that i call ml.ucf,

The problem arises when I try to upload the UCF file to the Sensortile (whether it's the Sensortile Box or the Sensortile Box Pro). I tried using Unicleo, but neither of the Sensortiles is recognized by the PC via Bluetooth, although they are recognized via USB, which Unicleo doesn't seem to use (?).

I then tried to upload the UCF file via the app (both Android and iPhone), but I get this error:


Someone can please help me? what did i do wrong?

Federica Bossi
ST Employee

Hi @Frabbit ,

How did you configure the sensors ODR and FS?


For the magnetometer issue, you want to use the MLC feature with the sensor hub interface to include the magnetometer data right? In that case the log data should not be two different csv files but a single csv file with all 3 sensors. Somehthing like this for example:




Then, in Unico, when selecting the MLC inputs make sure to select also the external sensor option and include the desired features.  


You can also check this application note that explains how to configure the MLC sensor with the Sensor Hub interface for including magnetometer data. However if your goal is to use it on the SensorTile BOX.Pro is not possible to connect the sensors together using the SensorHub features given the hardware design. 


For the UCF error, did you also try it using the ST BLE Sensor app (not the Classic version)? If the error is still present, can you copy the UCF file so that we can replicate the error? 

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.
Associate III

Hi Federica,

To be as clear as possible, I'm sending you both the CSV files and the generated UCF file. I originally intended to create a single file that included all three sensors, but the sampling rate of the magnetometer is different from that of the accelerometer and gyroscope, so I may need to re-acquire the data.

I'm using the SensorTile Box Pro with Datalog2 inside, and I used the basic configuration to collect data:

  • Magnetometer ODR 100 FS 50
  • Accelerometer ODR 7680 FS 16
  • Gyroscope ODR 7680 FS 4000

My idea is to use the SensorTile Box Pro, but since I'm having some problems, I might also be able to use the regular SensorTile Box if it can use all three sensors together.

For the UCF file, I used both applications (STBle for the SensorTile Box Pro and STBle Classic for the regular SensorTile). Both give me this problem.
P.S. Since the website doesn't allow me to upload UCF files, I'm sending you the file in TXT format.

Hi @Frabbit ,

Even if the ODR is different you can log the data using the highest frequency. The sensor will the slowest frequency will just be oversampled. 


Using the SensorTileBOX, its not possible to configure their IMU to use the Sensor Hub (so no possible integration of the Magnetometer in the MLC) given the Hardware Design. Same happens with the SensorTileBOX.Pro.


If the Magnetometer data is mandatory for your application, you will need to use a different setup.


For instance, the UCF was done for the LSM6DSOX, and using the app connected with the SensorTileBOX.Pro you need the UCF for the LSM6DSV16X. By generating the correct UCF and connecting the Pro board, the application error should be fixed. 

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.
Associate III

Thanks very much!

i've now made the right ucf file, could you please tell me how can i insert it in the SensortileBox pro? the same ucf can be inserted in the sensortile box? 
Because in the app STBLE sensor i cant apply a new flow with datalog2

Associate III

Hi Federica,
I just realized that the tool only accepted CSV files with accelerometer data followed by gyroscope data. So, I have recreated the CSV files so that they can be read correctly by the tool.
So now i select the iNemo inertial module (is that correct?) with device LSM6DSV16X


i then select the two different csv one for fault and the other for correct


with this configuration 



this decision tree pop up


and generates this ml.ucf 
But still i have the same problem when i try to upload it in a new folw throw the app STBLE classic into the sensortile "The selected ucf configuration cannot be parsed correctly"


Federica Bossi
ST Employee

Hi @Frabbit ,

First of all to clarify:


  • The SensorTile.BOX has the LSM6DSOX sensor inside and is used mainly with the ST BLE Sensor Classic App.
  • The SensorTile.BOX Pro has the LSM6DSV16X sensor inside and is used mainly with the ST BLE Sensor App.
  • For each board, generate the UCF file for the corresponding sensor. 


Having on your phone the UCF file generated for the sensor LSM6DSV16X, connect to you SensorTile.BOX Pro board using the ST BLE Sensor App. Open the Flow option:

Expert view >> New App >> Select Input Source >> MLC Virtual Sensor >> Choose Output >> Stream to Bluetooth. Click on the gear next to the MLC Virtual Sensor >> add .UCF FILE. 

In this way you should be able to load the app.

In addition, you are using the wrong UCF file for the SensorTile.BOX since it should be the one generated for the LSM6DSOX.

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 federica! 

Since I was not able do make any further step on i tried to upload the ucf file generated by the datalog in the git repository:
i was following the steps for the sensortile (not sensortile pro):
So I downoad the file, upload them in the Unico GUI(selecting LSM6DSOX)


I have followed the instruction said in the readme file


the ucf file was generated, i send it to my phone in the STBLESensor Classic app then create app>>SensorTile.Box>>Expert view>>New APP>>Select input>>MLC Virtual Sensor
then in settings>>Select a .UCF file, i select the one generated before and the same warning pop up... what can i do now?






  I send you the ucf file