cancel
Showing results for 
Search instead for 
Did you mean: 

Error when extracting data .dat files : "Missing packets revealed, data corrupted."

anthonyADV
Associate II

Hello, 

I logged data using the STEVAL-STWINKT1 (flashed with DATALOG2_Release.bin) by connecting the sensor to the iOS app ST BLE Sensor.

Then, I used the Python notebook "nb_stdatalog_converters.ipynb" to convert the .dat files to .csv.

However, for some sensors, I can't retrieve the dataframe, and I get the following errors:

 
Error: No [iis3dwb_acc] sensor available in your selected acquisition folder. Please check the sensor name and try again.
Error extracting data from C:\Users\...\iis3dwb_acc.dat file. Missing packets revealed, data corrupted.
 
Do you know why this problem occurs, or is the data actually corrupted?

I've noticed that the error occurs when processing large files—specifically, data from sensors ism330dhcx_acc, imp23absu_mic, and imp34dt05_mic, which exceed 129,000 KB. This might be related to the issue.

If you'd like to reproduce the problem, the code is provided below, and you can download my .dat files via this WeTransfer link : https://we.tl/t-OFuem7TOyT (let me know if you prefer another transfer method).

Thanks,

Anthony

 

 

 

import sys
import os

# Add the STDatalog SDK root directory to the sys.path to access the SDK packages
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), '..\\..')))

from stdatalog_core.HSD.HSDatalog import HSDatalog

#acquisition_folder = "path/to/your/acquisition_folder"

hsd = HSDatalog()
hsd_version = hsd.validate_hsd_folder(acquisition_folder)
hsd_instance = hsd.create_hsd(acquisition_folder=acquisition_folder)
print(f"HSD Version: {hsd_version}\n")

sensor_names = ["imp23absu_mic", "imp34dt05_mic", # "ism330dhcx_acc" ,"ism330dhcx_gyro","iis3dwb_acc", 
                "lps22hh_press" ,"lps22hh_temp", "stts751_temp", "iis2dh_acc" ,"iis2mdc_mag"
                ]


for sensor_name in sensor_names : #
    print(sensor_name)

    try :
        sensor =  hsd.get_sensor(hsd_instance, sensor_name)
        dataframe = hsd.get_dataframe(hsd_instance, sensor)
        print(dataframe)

    except Exception as e:
        print(f"Error: No [{sensor_name}] sensor available in your selected acquisition folder. Please check the sensor name and try again.")
        print(e)

 

 

0 REPLIES 0