Contents
Last time I left the rower connected and completely silent. It advertises the Nordic UART Service, I can subscribe to its notify characteristic, and then nothing happens no matter how hard I row. The console clearly wants the app to speak first.
So the question is: what does it want to hear?
Standing on someone else’s bike
Before decompiling anything, I googled. “MCF-0000000000” is a pretty unique string, and it turned up codaris/UnderDeskBike, a project for an Exerpeutic under-desk bike that uses the same MyCloudFitness console family. Same service, same naming. The writeup documents the frame format and a full handshake, byte for byte.
The frame format is simple:
F9 <cmd> <len> <payload: len bytes> <checksum>
checksum = (F9 + cmd + len + sum(payload)) & 0xFF
Commands you send are 0xDx, replies from the console are 0xEx. I wrote a tiny framing helper and, because I didn’t trust myself, asserted it against every frame from the writeup before sending anything to the machine:
def frame(cmd: int, payload: bytes = b"", pad_to: int = 0) -> bytes:
body = bytes([0xF9, cmd, len(payload)]) + payload
out = body + bytes([sum(body) & 0xFF])
return out.ljust(pad_to, b"\x00")
CONNECT = frame(0xD0, pad_to=20) # rower ignores it unless padded to 20 bytes
HOLD = frame(0xD1, bytes([0x02, 0, 0, 0, 0]), 20)
INFO1 = frame(0xD3, bytes.fromhex("0100002c00003c00a000000000"), 20)
INFO2 = frame(0xD4, bytes([0x02] + [0] * 12 + [0x1F, 0x0F]), 20)
START = frame(0xD5, bytes([0x01] + [0] * 12), 20)
CONTINUE = frame(0xD5, bytes([0x00] * 13), 20)
# Sanity check against the bytes in the writeup.
assert CONNECT.hex().startswith("f9d000c9")
assert HOLD.hex().startswith("f9d1050200000000d1")
assert START.hex() == "f9d50d01000000000000000000000000dc000000"
assert CONTINUE.hex() == "f9d50d00000000000000000000000000db000000"
assert INFO1.hex() == "f9d30d0100002c00003c00a000000000e2000000"
assert INFO2.hex() == "f9d40f020000000000000000000000001f0f0c00"
You might notice that comment on CONNECT. That comment cost me some time.
The 20-byte gotcha
The bike writeup sends the connect command as just four bytes: f9 d0 00 c9. So that’s what I sent first. The console is supposed to answer with f9 e0 00 d9. Here’s the entire log of that first attempt:
t,dir,hex
2.707,tx connect,f9 d0 00 c9
That’s it. No error, no disconnect, no reply. Just silence.
I wrote a quick script to try a few variants back to back: with and without write response, the “hold” frame, the “start” frame. The bigger frames from the writeup were already 20 bytes long because they had zero padding at the end, and I wondered if that was the difference.
tries = [("connect resp", "f9d000c9", True), ("connect noresp", "f9d000c9", False),
("connect resp padded", "f9d000c9" + "00"*16, True),
("hold", "f9d1050200000000d1", True),
("start", "f9d50d01000000000000000000000000dc000000", True)]
It was. The moment I padded the connect frame out to 20 bytes with zeros, e0 came back. The rower silently drops every frame that isn’t exactly 20 bytes long. The bike apparently doesn’t care, the rower does. 20 bytes is the default BLE ATT payload size (23-byte MTU minus 3 bytes of header), so I’m guessing the firmware reads a fixed-size buffer and simply ignores anything shorter. That’s a guess though, I never confirmed it.
After that, the rest of the handshake just worked:
Note the keep-alive. The console expects a D5 frame roughly every second, and every one of them is answered with a set of four data frames. Stop sending and the data stops too.
Reading the bytes
Each update is four frames, E5 through E8, with 16 payload bytes each. Here’s a chunk of an actual session, a few seconds into rowing, with each line being one update and the four frames separated by |:
5.08 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 09 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00 00 00 00 03 e8 00 00 00 00 00 00 00 00 00 00 | 00 ...
6.07 00 03 00 00 00 01 00 00 00 00 00 00 00 00 00 09 | 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 | 00 00 00 00 03 e8 00 00 00 00 00 00 00 00 00 00 | 00 ...
9.13 00 06 00 01 00 02 00 00 00 00 00 00 00 00 00 09 | 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 | 00 11 02 38 03 e8 00 00 00 00 00 00 00 00 00 00 | 00 ...
15.10 00 0c 00 02 00 05 00 00 00 00 00 00 00 00 00 09 | 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 | 00 13 02 25 03 e8 00 00 00 00 00 00 00 00 00 00 | 00 ...
Even without knowing anything, a few things pop out:
E5[0..1]is clearly a clock:00 02,00 03,00 06,00 0c. Minutes and seconds.E6[13]goes 0, 1, 2, 4. That’s the stroke count.E7[1]shows up once there are two strokes to measure between:0x11= 17, then0x13= 19. Strokes per minute.E7[2..3]is02 38= 2:56 at 17 spm and02 25= 2:37 at 19 spm. That looks like pace per 500 m, formatted as minutes and seconds.E7[4..5]is03 e8= 1000 and never moves.E5[15]is09and never moves.
This is where probe.py’s Enter-for-marker trick earned its keep. Row three strokes, hit Enter, look at what changed. Speed up, hit Enter, look again. A couple of sessions like that and most of the live fields were obvious.
The two fields I got wrong were in E5[2..5]. One went up about 0.6 per stroke, the other about 1.4 per stroke. I had them labeled as “calories-ish” and “distance in meters”, and the calories one never quite matched what the console displayed.
Getting the real names
At this point I wanted to stop guessing. MyCloudFitness 3.0.2 for Android is still floating around on APK mirrors, so I grabbed it and ran it through jadx. Happily, the BLE library inside (com.mcf.deviceslib) isn’t obfuscated at all. It has class names like InitialConnectionRequest, SetDeviceInfo, SetUserInfo and SetProgram, plus a response handler that parses each data frame field by field with readable names.
That turned my guesswork into an actual table. The commands I’d copied from the bike writeup without understanding them suddenly had meanings:
| Cmd | App name | What we send |
|---|---|---|
| D0 | InitialConnectionRequest | (empty) |
| D1 | SetDeviceInfo | units: 01 = km, 02 = miles |
| D3 | SetUserInfo | age 44, gender 0, weight 60, height 160 |
| D4 | SetProgram | mode 2 (goal), no goal, display flags |
| D5 | NoUpdate / SetStarted / SetPaused / SetStopped / … | first byte picks the action |
Fun detail: the D3 bytes from the writeup tell the console I’m a 44 year old of gender 0 (which isn’t valid, the app uses 1 for male and 2 for female) who weighs 60 kg and is 160 cm tall. Whoever captured those bytes for the bike writeup, hi. It turns out not to matter, as you’ll see in a second.
And it corrected my two wrong fields: E5[2..3] is distance / 100 and E5[4..5] is calories / 10. I had them swapped. The decoded calories matched the console exactly (1.2 kcal at 9 strokes).
The letdown: E1
The most interesting thing in the decompiled app was the parser for E1, the device info the console sends back after D1. On my rower it looks like this:
07 0a 4c 05 00 00 00 00 08 20 01 00 01 d6 e0 00
Decoded using the app’s own field names, it says:
- Model 2636 (
0x0a4c), equipment type 5. - Supported goals: calories, distance, time.
- Max resistance 0. Resistance, speed and slope are not electronically controlled.
- Watt data: no. Heart rate: no. Biometrics (age, weight, height, gender): no.
- Features: distance, time, calories, stroke count, strokes per minute, an “end-workout predictor” and drive length.
So the console itself is telling me it has no power measurement, no heart rate, and doesn’t care about my (fake) user info. That’s why the D3 values never mattered.
It gets worse once you look at the “features” more closely:
- The pace field is just
3000 / spm. 17 spm gives 2:56, 20 gives 2:30, 22 gives 2:16, all within rounding. It’s not measuring anything about how hard you pull. In the app’s code it’s even called the end-workout predictor, which tells you how seriously to take it. - Drive length is that constant
03 e8: 10.00, always. - Distance and calories both grow by a fixed-ish amount per stroke. They’re formulas on top of the stroke count.
And then I tested the tension knob. The rower has a dial from 1 to 14 that moves a magnet closer to the flywheel. If anything was going to show up in the data, it’s that. I rowed for 90 seconds, sweeping the knob from 1 up to 14 and back down to 1, hitting Enter at each change.
Not a single byte changed. E5[15] stayed 09, E7[4..5] stayed 1000, everything else that was zero stayed zero. The knob is purely mechanical, and the console has no idea where it is.
So after all that, here’s what this rower actually measures:
time
stroke count
strokes per minute
Everything else on the display is math on those three numbers. Rowing at tension 14 and rowing at tension 1 at the same stroke rate gives you the same “distance” and the same “calories”. Which, honestly, I kind of suspected from using it, but now I know for sure.
I will try to figure out a way of handling this later on. Maybe try to measure what the tension actually is at the various levels, and incorporate that into the various formulas later on.
One thing I still don’t understand
Later I captured a session from my own web app in Chrome (more on that in post 4) and two values were different from my Python sessions. E5[15] was 01 instead of 09, and distance went up 1 per stroke instead of about 0.6. The low bits of E5[15] are status (0 idle, 1 running, 2 paused) and the rest are mode bits, so something in how the session was set up changed the console’s mode. My best guess is the slightly odd D3 and D4 values I copied from the bike writeup. Switching D4 to mode 0 (manual) and giving D3 a valid gender might sort it out. I haven’t gotten around to testing that yet, and since distance is a made-up number anyway it’s pretty low on the list.
What this means for the app
This changed how I thought about the app quite a bit. I’d been picturing watts graphs and resistance-based programs. For the rower that’s off the table: there is no resistance control and no force measurement.
What I do have is a very reliable stroke counter and stroke rate. That’s actually enough for real training. Rowing workouts are commonly built around stroke rate anyway: steady state at 22, pyramids, rate intervals. And it means the app should be honest. If the console doesn’t measure calories, the app shouldn’t pretend it does. That ended up shaping a lot of decisions, which I’ll get to in posts 5 and 6.
Here’s the same framing logic as it ended up in the web app, in TypeScript:
const FRAME_LEN = 20
export function frame(cmd: number, payload: number[] = []): Uint8Array {
const out = new Uint8Array(FRAME_LEN)
const body = [0xf9, cmd, payload.length, ...payload]
out.set(body)
out[body.length] = body.reduce((a, b) => a + b, 0) & 0xff
return out
}
Allocating a fixed 20-byte buffer up front means it’s impossible to send a short frame by accident. Lesson learned.
The rower was the easy one. The elliptical doesn’t speak BLE, its serial port ignores everything, and the only thing that responds is a channel that wants to talk to an Apple device. So, naturally, I became an iPad.
