Parsing Shimmer SD Card Logs in C#
As of Version 1.3.11, The Shimmer C# API has been extended to support parsing SD card data logged by Shimmer3 and Shimmer3R devices. This allows developers to programmatically access data recorded on the device and integrate it into custom analysis workflows alongside Bluetooth-streamed data.
This post outlines how SD logging and Bluetooth streaming coexist in Shimmer devices, how the recorded data relates across both paths, and how the C# API examples can be used to work with each.
Scope of SD Log Support in the C# API
The C# API only supports basic parsing of Shimmer3/3R binary SD card log files. Users who want to use SD Log Inter-device Sync will require using ConsenysPRO.
SD Logging and Bluetooth Streaming as Complementary (Paths)
Shimmer devices running log and stream firmware can support two concurrent data paths:
- SD card logging, where samples are written to on-device storage
- Bluetooth streaming, where samples are transmitted in real time
Both paths originate from the same acquisition process on the device. When a sensor sample is generated, it is:
- Timestamped using the Shimmer internal clock
- Logged to the SD card
- Sent over Bluetooth
Neither path changes how data is sampled or represented.
In practice:
- Bluetooth streaming is typically used for live monitoring or feedback
- SD logging provides a complete record of the acquisition for later retrieval
These mechanisms are designed to be used together, not as substitutes for one another.
Handling Packet Loss Without Changing the Data Model
Bluetooth transport can result in missing samples during streaming. This does not affect the data recorded on the SD card, which captures each sample produced by the device.
Because the same internally timestamped samples are both logged and streamed, the SD data can be used to:
- Identify gaps in streamed data
- Reconstruct continuous datasets for post-session analysis
Importantly, this does not imply that SD logging is “higher quality” data. The sensor data itself is identical; the SD log simply reflects the complete set of samples generated during the session.
Aligning Streamed and Logged Data Using Device Timestamps
Alignment between Bluetooth-streamed data and SD-logged data can be achieved using the Shimmer internal clock.
Since each sample carries the same timestamp regardless of its destination:
- Streamed and logged data share a common time base
- Samples can be matched directly using clock values
This enables developers to combine:
- Partial Bluetooth streams
- Complete SD logs
into a single, time-aligned dataset.
Example: Streaming and Logging
ShimmerCapture example
https://github.com/ShimmerEngineering/Shimmer-C-API/tree/master/ShimmerCapture
This example demonstrates how to:
- Start Bluetooth streaming
- Enable SD logging at the same time
- Stop streaming while continuing to log to SD, or stopping both simultaneously.
Example: Parsing SD Card Logs
ShimmerSDLogExample
https://github.com/ShimmerEngineering/Shimmer-C-API/tree/master/ShimmerSDLogExample
This example shows how to:
- Load a binary SD log file
- Parse the binary file to ObjectClusters
- Write ObjectClusters to CSV file
Its primary objective is to show how to use the ShimmerSDLog class to parse binary log files.
Summary
With SD log parsing support added to the Shimmer C# API, developers can:
- Access on-device logged data programmatically
- Work with SD-logged and Bluetooth-streamed data in a consistent, timestamped format
- Combine real-time monitoring with complete post-session datasets
SD logging and Bluetooth streaming address different aspects of data acquisition and are intended to be used together as part of a single workflow.