Skip to content
Pulse
Lab · Foundations

The direct strap connection

How Pulse reads a WHOOP 5.0 / MG strap over Bluetooth: GATT layout, frame format, the commands it sends (and never sends), and the decoded fields: heart rate, RR intervals, accelerometer, steps @49, skin temperature @65, battery.

Built from docs/strap-direct.md

Pulse's main data source is the WHOOP 5.0 / MG strap itself, over Bluetooth, using a reverse-engineered protocol. The WHOOP cloud API (ios/Pulse/Cloud/WhoopSync.swift) is a secondary source: WHOOP's own scores (recovery, sleep stages, strain, workouts, daily steps) and history from before Pulse existed. When a question is about heart rate, beats, HRV, steps, battery, charging, sleep detection or "the strap", the answer is in this document and the BLE code, not in the API.

Strap tested: WHOOP MG, firmware 50.43.2.0, paired with the user's iPhone. Offsets below were decoded from that device; treat anything marked (ours) as our own finding, confirmed on real data but not published elsewhere.

Where the code is

WhatFile
Frame format, CRCs, commands, UUIDs, reassemblyios/WhoopKit/Sources/WhoopKit/Protocol.swift
Decoding frames into valuesios/WhoopKit/Sources/WhoopKit/Parsers.swift
Connection, subscriptions, modes, offload, live ingestios/Pulse/BLE/StrapManager.swift
Storage (SQLite)ios/Pulse/Store/Database.swift
Tests (incl. real captured frames)ios/WhoopKit/Tests/WhoopKitTests/
Same codec in Python, for experiments on a Macsrc/whoop_ble/protocol.py, cli.py (uv run whoop-ble …)

Why an iPhone app (and not the Mac)

The strap's custom service needs an authenticated (encrypted) bond. macOS / CoreBluetooth can't start one for this device, so subscribing fails with Authentication is insufficient. The iPhone already has the bond from the WHOOP app, and any app on that phone inherits it. That's the whole reason Pulse is an iOS app. (Linux/BlueZ bluetoothctl pair is the other way.) If the custom channel shows Locked, open the WHOOP app once, or use Pair in settings, which re-subscribes and makes iOS show its pairing sheet.

GATT layout

Service / characteristicUUIDUse
Custom service (gen5)FD4B0001-CCE1-4033-93CE-002D5875F58Aeverything below
0002FD4B0002-…write (with response): commands to the strap
0003FD4B0003-…notify: command responses
0004FD4B0004-…notify: events (battery, wrist, etc.)
0005FD4B0005-…notify: data (live 0x28, history 0x2F, metadata 0x31)
0007FD4B0007-…notify: memfault / console
Standard Heart Rate180D / 2A37BPM + R-R, fallback for live HR
Battery180F / 2A19integer %
Device info180Amodel, firmware
Gen4 service (not used)61080001-8D6D-82B8-614A-1C8CB0F8DCC6WHOOP 4.0

Subscribe order matters: 0004 → 0007 → 0005 → 0003 (WhoopUUID.notifyOrder).

Frame format (gen5)

AA 01 <len u16 LE> <field u16> <crc16 MODBUS of bytes 0..5> <inner …> <crc32 zlib of inner>
  • len covers everything from the field to the end of inner, so a frame's total length is len + 8.
  • field 00 01 = phone → strap, 01 00 = strap → phone.
  • Notifications arrive in chunks; Reassembler joins them and resyncs on 0xAA.
  • Inner = <type> <seq> <cmd> <…>. Types (PacketType): 0x23 command, 0x24 command response, 0x28 realtime, 0x2B raw realtime, 0x2F history record, 0x30 event, 0x31 metadata, 0x32 console log, 0x36 identity.

Commands we send (WhoopCommand)

Inner: 23 <seq> <cmd> <b3> <payload>. The wrong b3 is silently ignored by the strap.

cmdnameb3payload
0x91GET_HELLO01none
0x8DGET_ADVERTISING_NAME01none
0x78SET_CONFIG0140 bytes: flag name (32, zero-padded) + value + 7 zeros
0x22GET_DATA_RANGE00none
0x16SEND_HISTORICAL_DATA00none
0x17HISTORICAL_DATA_RESULT (ack)01the 8-byte cursor
0x03TOGGLE_REALTIME_HR01 = on, 00 = offnone. Inner 23 <seq> 03 01; live 0x28 frames start ~0.3 s later. The WHOOP app sends "on" twice
0x14ABORT_HISTORICAL00none (strap log: "Command Abort Historical Transmits")
0x75GET_CONFIG_COUNT (seen)01none; reply carries the count (19)
0x76GET_CONFIG_BY_INDEX (seen)01none; reply: index, value, flag name
0x97GET_IDENTITY (seen)01none; reply: BT address + serial (e.g. WBB5AP…)
0x45unknown (seen once at connect)0201 00 00 00

Never send 0x42 (SET_ALARM_TIME, makes the strap buzz) or 0x19 (FORCE_TRIM, deletes stored data). They are deliberately not in the enum.

The 15 SET_CONFIG flags (enableFlags) are what the official app sends to unlock the r22 history records: enable_r22_packets, …v2…v8, wear_detect_bias, hr_ch_switching, ir_hw_switching, enable_passive_strap_fit_gen5, enable_sig11_during_sleep, dorset_inhibit_wpt, make_hrfm_visible, disable_pip_r26_packets (value 0x32, a few 0x31).

Two ways Pulse gets data (StrapManager.Mode)

1. Companion (default): listen in

The WHOOP app owns the strap and runs its syncs; Pulse only subscribes and sends nothing. Because both apps are subscribed to the same notifications, Pulse receives:

  • live frames (0x28, ~1 Hz, and standard 2A37 heart rate) while WHOOP's live stream is on,
  • every history chunk WHOOP downloads (0x2F records, about every 10 minutes when WHOOP syncs),
  • battery and other events (0x30).

Exception, the live stream: the WHOOP app turns the live stream (0x28) on and off with 0x03 TOGGLE_REALTIME_HR when its heart-rate screen opens and closes. We saw this as strap responses 24 <seq> 03 <reqSeq> 01 00 00 00 on 0003 right before every live start and stop (29 Nov). The exact request bytes came from an iPhone HCI capture (below), so with "Keep live heart rate on" (default) it sends 0x03 itself: on connect, every minute while the app is in front or a workout records, and off when it goes to the background. This is the only command companion mode sends.

Consequences without it: live HR depends on the WHOOP app (after a phone reboot nothing flows until WHOOP is opened once), and history arrives in bursts about 5–10 minutes behind real time. iOS state restoration (pulse.central) and the bluetooth-central background mode keep Pulse receiving in the background.

2. Direct (opt-in setting): Pulse downloads the history itself

For when the WHOOP app isn't there (e.g. the membership ends). On connect and every 30 minutes:

  1. subscribe in order, then send GET_HELLO, GET_ADVERTISING_NAME, the 15 SET_CONFIGs, GET_DATA_RANGE, SEND_HISTORICAL_DATA (one write at a time; the next leaves when the previous is acknowledged);
  2. the strap streams history records (0x2F) and, after each chunk, a metadata frame (type 0x31, sub 0x02) with an 8-byte cursor at inner[13..<21];
  3. echo each cursor back as HISTORICAL_DATA_RESULT (0x17), otherwise the stream stalls;
  4. watchdog: re-ask once if nothing arrives in 12 s; finish after 25 s of silence.

Caveat: acknowledging moves the strap's shared read pointer, so chunks Pulse acknowledges are not given to the WHOOP app (and WHOOP's cloud won't have them). That's why Direct is off by default.

Decoding (all little-endian; offsets are into inner)

History record: type 0x2F, 112-byte inner, version byte inner[1] == 18, one per second

OffsetFieldNotes
7timestamp u32 (Unix s)
14heart rate u8
15R-R count(ours)
16…R-R intervals u16 ms × count(ours) the clean beats in that second; dense while still or asleep
29second HR u8community guess
37accelerometer 3 × f32 (g)motion = abs(|a| − 1)
49step counter u16, wraps(ours) climbs only for real walking (~110/min on a walk, 0 for fidgets); steps = wrapped deltas
53movement counter u16(ours) climbs for any movement; meaning unconfirmed

Raw frames are always saved too, so new fields can be decoded later from history (see backfills below).

Realtime: type 0x28, 20-byte inner, ~1 Hz (ours, fw 50.43)

ts u32 @2, sub-second u16 @6, HR u8 @8, R-R count @9, R-R u16 ms from @10. Only ~13 % of these carry R-R; none while moving. Preferred over standard 2A37 (strap-timestamped); 2A37 is used only if 0x28 is quiet for 5 s.

Battery event: type 0x30, event 0x03 (ours)

[30][seq][03 00][ts u32 @4]…[len u16 @10 = 20][02 @12][battery ‰ u16 @13][mV u16 @17][charging u8 @21]. Sent every few minutes, every 30 s while charging. Example: 129 ‰ = 12.9 %, 3696 mV, not charging; on the charger the flag flips to 1 and ‰ climbs.

Other

  • Metadata 0x31 sub 0x02: offload cursor at inner[13..<21] (Direct mode ack).
  • Console 0x32: printable text from inner[3…], shown in the strap log.
  • Standard 2A37: flags byte, HR u8/u16, then R-R in 1/1024 s.

Storage (Database.swift, SQLite on the phone)

TableContents
frames (t, ch, raw)every raw custom-service frame, kept so anything can be re-decoded
hr (t, bpm, motion, src)src 0 = live (0x28 / 2A37), src 1 = strap history (0x2F)
rr (t, ms)live beat intervals
strap_rr (t, ms)beat intervals from history records, kept separate from rr (same heartbeats arrive both ways)
strap_steps (t, c, m)step and movement counters per record
strap_acc (t, x, y, z)the record's accelerometer (g) per second: input of the sleep and activity models. It behaves like a 1-second mean, not a single sample (second-to-second noise asleep matches 1 s means of a 50 Hz watch, not point samples)
strap_temp (t, c)skin temperature °C every 10 s: u16 @65 of v18 records in 0.01 °C (matches WHOOP's nightly skin_temp to 0.01 °C on 29 Nov 2026)
sleep_edits (start, end, action)the user's Keep / Delete on detected sleeps and naps; wins over the detector
w_*WHOOP API data (cycles, recovery, sleep, workouts); see CloudStore.swift
p_workoutPulse-recorded workouts

Backfills at launch re-decode old frames when a new field is learned (backfillFromFrames, backfillStepsFromFrames, keyed by a version in UserDefaults; bump the key to re-run).

What's built on top of strap data

  • Live HR / HRV (StrapManager.ingestLive): live HRV = RMSSD over the last 5 min of beats, seeded from the database at launch.
  • Sleep, naps and stages (WhoopKit/SleepDetection.swift, algorithms/sleep/): boosted trees trained on open PSG datasets over 30 s epochs of strap_acc + heart rate; sessions with ≤ 20 min wake gaps bridged; Viterbi stages. App side: Store/SleepDetector.swift. Falls back to the older heuristic (Metrics.detectSleep) where no accelerometer is stored. A detected sleep WHOOP hasn't published yet starts the new day as an estimate (PendingSleep.swift).
  • Activity detection (WhoopKit/ActivityDetection.swift, algorithms/activity/): still/walk/run/cycle/other per 30 s, fused with the step counter's cadence; bouts feed the "Looks like you went for a walk" notification.
  • Steps (StepStore): strap counter first, WHOOP API daily step_count for backfill, Apple Health/iPhone last.
  • Irregular rhythm (WhoopKit/Rhythm.swift, algorithms/rhythm/): 64-beat windows of strap_rr or rr.
  • Battery / charging badge, "strap not syncing" notification, workout heart rate.

Sources

  • Alec Jude Wilson, Cracking the WHOOP 5 Bluetooth protocol: judes.club/writing/cracking-the-whoop-5-bluetooth-protocol
  • Zë Stuart, Vestigator part 7: MG protocol: zulusierra.co/vestigator-part-7-mg-protocol
  • WHOOP 4.0 background: github.com/jogolden/whoomp

Capturing what the WHOOP app sends (iPhone HCI log)

Another app's writes aren't visible over BLE, but iOS can log every HCI packet in plaintext:

  1. Install Apple's Bluetooth logging profile on the iPhone (developer.apple.com/bug-reporting/profiles-and-logs), restart.
  2. Do the thing in the WHOOP app (open the heart-rate screen, sync, etc.).
  3. From the Mac: xcrun devicectl device sysdiagnose --device <device-id> --destination /tmp/sysdiag (asks for the Mac password; ~5 min).
  4. tar -xzf … --include "*bluetoothd-hci-latest.pklg" then tshark -r …pklg -Y 'btatt.opcode == 0x12 && btatt.handle == 0x099b' -T fields -e frame.time_epoch -e btatt.value lists every command written to fd4b0002 (handle may differ per pairing); decode with decode_frame. Captures stay out of the repo (/tmp). First capture: 29 Nov 2026, 193 writes (see the command table).

References

  1. Alec Jude Wilson. Cracking the WHOOP 5 Bluetooth protocol
  2. Alec Jude Wilson. WHOOP 5.0 protocol spec
  3. Zë Stuart. Vestigator part 7: MG protocol
  4. whoomp (WHOOP 4.0 background)
  5. openwhoop
  6. Apple: Bluetooth logging profile (Profiles and Logs)