Binary protocol reference
The SDK speaks the same binary protocol as the Rust firmware. The canonical
definition lives in omnitiles/src/protocol/messages.rs; this page mirrors
it for reference.
Packet format
[START_BYTE] [msg_id] [payload bytes...] [checksum]
0xA5 u8 0, 1, or 3 bytes u8
checksum is the 8-bit sum of msg_id and every payload byte (wrapping).
The SDK helper is:
from omnitiles.protocol import encode, checksum, MessageId
encode(MessageId.M1_EXTEND, bytes([200]))
# b'\xa5\x30\xc8\xf8'
Command IDs
Name |
ID |
Payload |
Notes |
|---|---|---|---|
|
0x30 |
|
PWM 0–255 |
|
0x31 |
|
|
|
0x32 |
— |
|
|
0x33 |
|
Target along stroke, 0–255 |
|
0x40 |
|
|
|
0x41 |
|
|
|
0x42 |
— |
|
|
0x43 |
|
|
|
0x50 |
— |
Connectivity check |
|
0x60 |
— |
Response-only |
|
0x70 |
|
vx, vy, omega |
|
0x71 |
— |
Telemetry variants
Telemetry packets are identified by total length. The parser validates the
checksum and returns a typed
Telemetry dataclass.
Length |
Fields |
|---|---|
7 bytes |
|
15 bytes |
Above + |
17 bytes |
Above + |
53 bytes |
Above + 6-axis IMU + 4 M1 ADCs + 2 M2 ADCs |
Invalid UWB ranges and ToF readings are encoded on-wire as 0xFFFF. The
parser normalizes them to Python None.
Extending the protocol
When adding a new message ID to the firmware:
Update
omnitiles/src/protocol/messages.rs.Add the corresponding entry to
omnitiles.protocol.messages.MessageId.If it’s a command, add a method to
Tileinsdk/src/omnitiles/tile.py.If it’s a new telemetry variant, add its byte length to
_TELEMETRY_LENGTHSinsdk/src/omnitiles/protocol/parser.pyand extend_try_parse.Add a unit test in
sdk/tests/test_protocol.py.