The data comes in from the serial port at baud rate 115200 as 32-character text strings of characters 0-9 and a-f (lower case), i.e. hexadecimal text for 16 bytes. The bike this was measured on delivers packets at a rate of about 1 every 13ms.
Header is always 0x6a
Steering [0, 255]
Crank Position [1,60]
Left Brake [135, 250] (250 when released)
Right Brake [135, 250] (250 when released)
Button Flags are a bitmapped field.
Flywheel revolution time F: RPM = 576000.0/F approximately.
Crank revolution time C: RPM = 1/(C * 0.000006) approximately.
Heart rate is in beats per minute.
Unknowns 02, 06, 07 are always 128, 255 and 255.
0F is the XOR of the first 15 bytes.
Button flags combined into 1 16-bit unsigned integer and subtracted from 65535 form a bitmapped field:
For Zwift, preferences would be steering, heart rate, cumulative crank and flywheel rotations calculated from time between samples and the speed and cadence themselves.
The bike supports 251 resistance levels, and these are maintained by pushing an array of 6 bytes to the bike every 10ms or so. A resistance level of 0 is maintained by sending nothing.
Full Details
The data comes in from the serial port at baud rate 115200 as 32-character text strings of characters 0-9 and a-f (lower case), i.e. hexadecimal text for 16 bytes. The bike this was measured on delivers packets at a rate of about 1 every 13ms.
Header is always 0x6a Steering [0, 255] Crank Position [1,60] Left Brake [135, 250] (250 when released) Right Brake [135, 250] (250 when released) Button Flags are a bitmapped field. Flywheel revolution time F: RPM = 576000.0/F approximately. Crank revolution time C: RPM = 1/(C * 0.000006) approximately. Heart rate is in beats per minute. Unknowns 02, 06, 07 are always 128, 255 and 255. 0F is the XOR of the first 15 bytes.
Button flags combined into 1 16-bit unsigned integer and subtracted from 65535 form a bitmapped field:
For Zwift, preferences would be steering, heart rate, cumulative crank and flywheel rotations calculated from time between samples and the speed and cadence themselves.
The bike supports 251 resistance levels, and these are maintained by pushing an array of 6 bytes to the bike every 10ms or so. A resistance level of 0 is maintained by sending nothing.
Each resistance packet is as follows:
Unlike the incoming data, which is hexadecimal text, this outgoing data is sent as the actual bytes specified above.