57: Accelerometer Data โ
๐งช Alpha
API is still evolving and may gain additional fields in future firmware versions.
Accelerometer metrics captured over time + events. Most values are time based (averages, highest value since X) or threshold based (highest value since the last one) - you can use the SET method to reset thresholds & baselines. Values are generated on-device from FIFO samples and include tilt and g-vector summaries. Everything is in 0.1g or degrees for clarity: whilst higher precision data is available, the accuracy can only really be trusted up to 0.1g or 1deg increments, and this keeps the payload size down. **Partial messages:** When only one or more of the per-axis maximum G component fields (keys 9/10/11) change and all other fields are unchanged, the device emits two messages back-to-back. First, a sparse MT_ACCEL_DATA message containing only the changed component field(s) at Q_ChangesOnly level, allowing subscribers to react immediately to axis-level changes. Second, a full MT_ACCEL_DATA message (all fields) at Q_Valid level. In all other cases only one full message is emitted, at Q_ChangesOnly if any field changed or Q_Valid if the store is unchanged.
Payload โ
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 1 | Version | Payload version / flags. Currently 0. | uint8 | |
| 2 | Latest Tilt | Latest tilt angles as signed int8 [x, y, z] in degrees. | bytes | |
| 3 | Baseline Tilt | Baseline tilt angles as signed int8 [x, y, z] in degrees. | bytes | |
| 4 | Maximum Tilt | Tilt angles as signed int8 [x, y, z] at the maximum observed tilt delta from baseline. | bytes | |
| 5 | Maximum Tilt Time | Unix timestamp for the maximum tilt event. | uint32 | s since epoch |
| 6 | Average G Vector | Average vector as signed int8 [x, y, z, magnitude] in 0.1g units. | bytes | |
| 7 | Maximum G Vector | Maximum magnitude vector as signed int8 [x, y, z, magnitude] in 0.1g units. | bytes | |
| 8 | Maximum G Time | Unix timestamp for the maximum g event. | uint32 | s since epoch |
| 9 | Maximum G Component X | Per-axis absolute maximum on X in 0.1g units. | int8 | |
| 10 | Maximum G Component Y | Per-axis absolute maximum on Y in 0.1g units. | int8 | |
| 11 | Maximum G Component Z | Per-axis absolute maximum on Z in 0.1g units. | int8 | |
| 12 | Variance | Variance indicator derived from the running standard deviation magnitude, clamped to 0..255 mg. | uint8 | mg |
Code โ
For convenience, the following constants can be used to reference this message type.