X-Dream Bike serial communications (input/output packet content) #32
drmason789
started this conversation in
General
Replies: 1 comment
-
Resistance is sent to the bike in a 6-byte block of data, not rendered to text like the incoming data. This must be resent at regular intervals, e.g. 10ms (this is a guess that works) otherwise the bike drops the resistance back to 0. There are 250 resistance levels. Each resistance packet is as follows:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
Here's what I have so far. Many thanks to the author of this repo for a helpful start.
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. See XDreamControllerButtons.cs
Flywheel revolution time F: RPM = 600000/F approximately. #40
Crank revolution time C: RPM = 1/(C * 0.000006) approximately. #19
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:
Beta Was this translation helpful? Give feedback.
All reactions