Skip to content

Conversation

@deviantintegral
Copy link

My reader glitched out and somehow stopped incrementing time, and I had to reset it. While I was able to get it pairing years ago, either something changed in macOS or I forgot the exact incantations to make it work.

I grabbed the packet log pairing with the official app using Apple's bluetooth profile and pointed an AI at it which identified the difference in the pairing flow. Now:

  • The normal macOS pairing dialog shows correctly.
  • You can pair manually by passing in the UUIDs Core Bluetooth uses.
  • You no longer need to hack the code to set a custom key, and I set it to show the one for UBPM as an example.

I still need to check this is working correctly on Linux.

# Enable RX channel notifications first - this triggers the device to send
# an SMP Security Request, which kicks off the BLE pairing process
logger.debug("Enabling RX channel notifications to trigger pairing")
await bleClient.start_notify(self.deviceRxChannelUUIDs[0], lambda h, d: None)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if the other UUIDs in this are for different devices, and if this has to actually trigger this on multiple UUIDs and gracefully ignore errors?

Actually, I think we can do that already by calling _enableRxChannelNotifyAndCallback().

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the omron devices I have seen have at least the first RX channel as a bluetooth characteristic.
Some of the newer device have a different root uuid like HEM7144t, but I did not include the support for this one in the main branch, as I have not yet found a clean way to include all required changes.

if args.key is not None:
if len(args.key) != 16:
raise ValueError(f"Pairing key must be exactly 16 characters, got {len(args.key)}")
pairingKey = bytearray(args.key.encode('ascii'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the pairing key is directly derived from ascii characters, it will be impossible to specify some keys. Either because one cannot type the character in the terminal, or the values outside of ascii range. Would it be possible to enter the key in hexadecimal representation instead?

logger.info(f"Attempt connecting to {bleAddr}.")
await bleClient.connect()
await asyncio.sleep(10) #time delay for user to accept os pairing dialog on win11
await bleClient.pair(protection_level = 2)
Copy link
Owner

@userx14 userx14 Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to confirm this, but I suspect that the pairing command here might be required on windows and linux.
Maybe we need to introduce an os dependent codepath here.

@userx14
Copy link
Owner

userx14 commented Jan 13, 2026

Really nice that you got it working for mac-os 👍, thanks a lot for the pull request.
I will try to check if the changes still work on other platforms or how to combine this.

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