Skip to content

Huawei AH100/CH100: user record is sent with weight 0, scale re-requests it 127x per session #1449

Closed

Description

@martinriedel

Preflight Check (Required)

  • I tested the latest dev version
  • The issue still occurs in the dev version
  • I searched the existing open and closed issues
  • This issue has not already been reported or fixed

Bug Description

HuaweiAhCh100Handler sends a user record with weight 0 to the scale, and the
scale answers by re-requesting it in a tight loop: 127 USER_CHANGED (op 0x20)
round trips in 33 seconds
, each answered with a byte-identical encrypted
USER_INFO frame. The loop only stops once an actual measurement completes.

Cause is in sendUserInfo:

val w = (weightTenthKg ?: (user.initialWeight * 10f).toInt()).coerceAtLeast(0)

weightTenthKg comes from lastMeasuredWeightTenthKg, which is -1 until the
first measurement of the session, so on connect it falls back to
user.initialWeight — and that is 0f for a freshly created profile.

Decrypting the USER_INFO we send (XOR with the scale MAC, then AES-CTR with the
session magic key) confirms it:

11 22 33 44 55 10 01 | 29 | B9 | 00 | 00 00 | FF FF | 1C E2
auth token             41y  185cm pad  weight  resist  const
                                       = 0 kg

HuaweiCH100SHandler.sendUserInfo has the identical line and the same defect.

The measured values themselves are correct — this is not #1206 / #1280 resurfacing.
Weight, body fat, timestamp and weekday all decode exactly as the scale's own
display showed them.

Steps to Reproduce

  1. Fresh install, create a user profile without entering an initial weight.
  2. Add a Huawei AH100 / CH100 (mine advertises as CH100, Chipsea CST34M97).
  3. Connect and watch the log before stepping on the scale.
  4. op=0x20 / CMD* 0x09 repeat roughly every 250 ms until a measurement lands.

Debug Log (Required)

openScale 3.1.2 built from master 7a170e40, Pixel 10 Pro, Android 17 (API 37).

10:01:03.750 D/HuaweiAhCh100Handler: ← op=0x20 len=1 7D
10:01:03.752 D/HuaweiAhCh100Handler: → CMD* 0x09 len=16 (encrypted)
10:01:03.838 D/GattScaleAdapter: → write to chr=…faa1 len=19 payload=[DC 10 09 BB 27 B1 6E 64 C1 A2 43 4F 99 D0 FD B5 F9 95 96]
10:01:04.136 D/GattScaleAdapter: ← received data chr=…faa2 len=4 payload=[BD 01 20 21]
10:01:04.138 D/HuaweiAhCh100Handler: ← op=0x20 len=1 7D
10:01:04.141 D/HuaweiAhCh100Handler: → CMD* 0x09 len=16 (encrypted)
   … 125 more identical cycles …
10:01:40.294 I/HuaweiAhCh100Handler: Measurement: 126.6 kg, fat=33.8%, impedance=306 Ω, userId=1

Note the payload= bytes are identical in every cycle.

With a fallback chain (last stored measurement → profile initial weight →
BMI-22 estimate from body height, never 0) the same hardware drops to 5 cycles.
Verified on the device, not only in unit tests. Happy to open a PR.

Activity

  1. martinriedel commented on Aug 10, 2026

    @martinriedel
    ContributorAuthor

    Edited after testing on hardware. Both retractions below are kept in full; what changed is that the second claim in this comment has since been retracted too, and the length-byte claim now cites a source anyone can check.

    Correction 1 — the "127 → 5 cycles" claim in the report above does not hold.

    The USER_CHANGED loop runs until a measurement arrives, so the cycle count mostly measures how long the user takes to step on the scale. It is a metric that could not have come out against the hypothesis it was cited for.

    Correction 2 — the replacement claim, that the length byte makes the scale poll four times slower, does not hold either.

    That rested on this table:

    user record length byte polls duration median interval
    weight 0 0x10 127 32 s 245 ms
    weight correct 0x10 1026 274 s 266 ms
    weight correct 0x0E 533 532 s 1001 ms

    Re-measured properly — one phone, one scale, one profile, two runs six minutes apart, the length byte the only variable:

    length byte polls duration median interval
    0x0E (14) 139 36.3 s 300 ms
    0x10 (16) 259 72.0 s 300 ms

    Identical, in every 10-second block of both runs, whether or not someone is standing on the scale. The 1001 ms row came from a different phone and is most likely its BLE connection interval, not the scale reacting to the record.

    What survives, and can be checked without trusting my captures.

    openScale 2.5.4 built a 16-byte USER_INFO payload and declared 14: BluetoothHuaweiAH100.java#L514-L524 passes the literal 14, and #L674-L684 writes it as {0xDC, len + 0, cmd}. The trailing 0x1C 0xE2 is transmitted but not counted. HuaweiCH100SHandler agrees independently: no trailer, declares its full 14 bytes. The hardware confirms the scale accepts the record at 0x0E — the measurement completes normally and matches the scale's display.

    And the weight-0 defect in the report above is real: a user record claiming the user weighs nothing is wrong data regardless of how the firmware reacts.

    So both fixes in #1450 stand, and neither changes the scale's behaviour. Two of the three numbers I originally offered as evidence measured something other than what I claimed; the case rests on the vendor's own byte layout and on not sending zeros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions