13: Heartbeat
A message sent to let the receiver know the sender is still active/alive. Can also be used to check if a connection is still active, as the message should be ACKed. Devices currently default to sending a heartbeat every 15 seconds on open links. Arbitrary fields can be added in fields payload 200+
Payload
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 6 | Battery Percent | Devices send battery percentage in heartbeats | uint8 |
Examples
Basic
The most basic heartbeat to keep a connection active. It has no header fields and no payload fields.Including battery %
Devices will automatically add battery % to heartbeats 📡 Real example from RH2 P1 v2287 on 2025-10-09This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor
With message ID 2456632031
Message IDs can be added to heartbeats to increase traceability, but they are not required 📡 Real example from RH2 ESP32 Toit on 2025-10-10This example is captured from an RH2 device, where Toit on the ESP32 co-processor is sending a heartbeat to the RH2 over I2C
With arbitrary data in payload field 108
If you are sending a heartbeat between systems you control You can add arbitrary data in payload fields 108-127 (uint8 length), and 236-255 (uint16 length), Such as these additional bytes, which are "hello" in ascii.Code
For convenience, the following constants can be used to reference this message type.