Skip to content

Add support for BP5360 / HEM-7377T1-ZAZ (+ Linux scan-during-connect)#69

Merged
userx14 merged 5 commits into
userx14:mainfrom
ojermo:add-hem-7377t1
May 25, 2026
Merged

Add support for BP5360 / HEM-7377T1-ZAZ (+ Linux scan-during-connect)#69
userx14 merged 5 commits into
userx14:mainfrom
ojermo:add-hem-7377t1

Conversation

@ojermo
Copy link
Copy Markdown
Contributor

@ojermo ojermo commented May 17, 2026

Implements BP5360 (HEM-7377T1-ZAZ) support discussed in #67.

Five commits, separable for review:

  • f049488 — Device driver (deviceSpecific/hem-7377t1.py) + Linux scan-during-connect block in omblepy.py main()
  • 152c907 — Empty-slot detection + time sync (byte-14 checksum, matches HEM-7361T's convention)
  • 384ac31--adapter CLI flag for multi-adapter Linux setups
  • 1635fd1 — Driver docstring update with the empirical user-ID finding (byte 13: 0x01 = User 1, 0xFF = User 2)
  • 16318b0 — README device support matrix entry

See #67 for the protocol notes (byte-14 checksum, pair-mode-only "okay"/"Err" display behavior, guest-not-stored, user-ID encoding) and the Linux scan-during-connect rationale.

Happy to split the Linux scan-during-connect change into its own PR if you'd prefer to review it separately from the BP5360 driver.

ojermo and others added 5 commits May 16, 2026 15:41
New device driver `deviceSpecific/hem-7377t1.py` for the Omron BP5360
(internal model HEM-7377T1-ZAZ, FCC ID Q6ZHEM7377T1). Same Omron service
UUID (0000fe4a) and channel UUIDs as HEM-7380T1, HEM-7361T-family record
bit layout, OS-managed bond (no token auth required). 100 records per user
× 2 users at 0x01CC and 0x080C. Time sync intentionally not implemented
yet — the BP5360 firmware requires a non-obvious byte-14 increment quirk
in the time-sync write at 0x0088, which doesn't fit cleanly into the
existing settings-cache flow without further work; raises a clear
ValueError pointing this out.

Verified end-to-end on Linux/BlueZ: pulls all 77 stored records, parses
correctly, communication completes cleanly (3 of 4 runs — comparable to
existing reliability for other Omron devices over BLE).

Bundled with: Linux/BlueZ scan-during-connect workaround in main(). On
multi-adapter Linux, BleakClient(MAC).connect() can time out even when
the device is actively advertising (verified: 52 ad packets in 90s,
RSSI -50, BlueZ Connect still timed out). Running an active BleakScanner
in parallel keeps BlueZ in receive mode, so it acts on the next ad packet
immediately. Scanner is started on Linux only (sys.platform check) and
stopped in the existing finally block. Adapter is extracted from the
BLEDevice's BlueZ path. NOTE: scanner is currently pinned to hci1 — needs
to become a CLI arg or auto-detect before merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two improvements to the BP5360 driver beyond the initial proof of concept:

1. Empty-slot detection in deviceSpecific_ParseRecordFormat. BP5360's
   unused user slot contains daily-summary or similar metadata that decodes
   to nonsense dates if pushed through the full parser, producing a stream
   of cryptic warnings ("month must be in 1..12, not 0"). Early-exit checks
   on year (>= 2020), month/day/hour/minute ranges, and physiological BP
   ranges now raise ValueError("record slot is empty") for invalid slots,
   matching HEM-7380T1's convention.

2. Time sync (--timeSync) implementation. BP5360 stores its time block at
   EEPROM 0x0040 (read) and accepts writes at 0x0088. Settings region
   addresses are configured accordingly; settingsUnreadRecordsBytes is set
   to a zero-length range as a placeholder until the unread-records counter
   location is mapped (--newRecOnly is a follow-up).

   The byte-14 quirk turns out NOT to be the running counter implied by the
   original reverse engineering: byte 14 is a CHECKSUM of bytes 0-13,
   matching the convention HEM-7361T uses. The earlier additive formula
     new_byte14 = (old_byte14 + (new_sec - old_sec) + 1) & 0xff
   was a coincidence: when only the second byte changes (and byte 4 changes
   from 0x00 to 0x01), the checksum delta IS exactly N+1, so the additive
   formula matched in the common case. It breaks when seconds wrap (delta
   negative) or when other date components change. Computing the checksum
   directly works in all cases. Verified: cuff returns success status
   (no 0xe5 error) and "okay" display on 2/2 runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Linux scan-during-connect block previously hardcoded
bluez={"adapter": "hci1"} for development testing. Replace with an
optional --adapter argument so users on multi-adapter systems can pin
the controller their cuff is bonded on. When omitted, BlueZ picks the
default — works on single-adapter setups and on multi-adapter setups
where the default controller is also the bonded one.

The BleakClient call in the same block already auto-extracts the
adapter from the discovered BLEDevice's BlueZ path, so this CLI flag
only governs the scanner's controller selection.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Empirically verified: BP5360 stores both cuff-User-1 and cuff-User-2
measurements in the same slot index (0x080C). They're distinguished by
metadata bytes within the 16-byte record — byte 13 is consistently 0x01
for User 1 records, 0xFF for User 2 records. Guest measurements are not
stored to EEPROM at all. The slot at 0x01CC is reserved but appears
unused on the sample tested.

This replaces the earlier docstring's "may not match cuff display"
hedge with the actual mechanism.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the BP5360 row per maintainer request in issue userx14#67. Inserted next to
HEM-7380T1 since both use OS-bonding (n/a in pairing column). Features:
basic readout ✔, time sync ✔ (verified — see issue thread for byte-14
checksum details), new record counter ❌ (deferred — counter location not
yet mapped for this device).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@userx14
Copy link
Copy Markdown
Owner

userx14 commented May 25, 2026

From testing with bluez-5.84, there are no problems with your scan-during-connect modification, when testing with single adapter and hem-7322-t. Thanks for adding support for HEM-7377T and multi adapter.

@userx14 userx14 merged commit 32f34dc into userx14:main May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants