Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with M7 Inteli #1

Closed
RobertWojtowicz opened this issue Jun 16, 2024 · 5 comments
Closed

Problem with M7 Inteli #1

RobertWojtowicz opened this issue Jun 16, 2024 · 5 comments

Comments

@RobertWojtowicz
Copy link

RobertWojtowicz commented Jun 16, 2024

Hi @evnleong

I tried to use your blue.py script with Omron M7 Inteli, after changing from

DEVICE_MAC_ADDRESS = os.environ.get("BP7450_MAC_ADDRESS")

to

DEVICE_MAC_ADDRESS = "28:FF:B2:32:E0:19"

It started to work but I still have the problem:

Bluetooth device disconnected. Attempting Reconnection in 5 seconds...
Attempting reconnection
Bluetooth device disconnected. Attempting Reconnection in 5 seconds...
Attempting reconnection

The question is whether you need to pair the device, because when pairing unfortunately without success (the app on the phone pairs without a problem):

bluetoothctl pair 28:FF:B2:32:E0:19
Attempting to pair with 28:FF:B2:32:E0:19
Failed to pair: org.bluez.Error.AuthenticationFailed

Maybe you have an idea how to solve this problem?

BR,
Robert

@RobertWojtowicz
Copy link
Author

BT 4.0 works better than BT 5.3, at least with bluetoothctl:

[bluetooth]# connect 28:FF:B2:32:E0:19
Attempting to connect to 28:FF:B2:32:E0:19
[CHG] Device 28:FF:B2:32:E0:19 Connected: yes
Connection successful
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0100
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0100/char0110
        00002a05-0000-1000-8000-00805f9b34fb
        Service Changed
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0100/char0110/desc0112
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200
        0000180a-0000-1000-8000-00805f9b34fb
        Device Information
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0210
        00002a23-0000-1000-8000-00805f9b34fb
        System ID
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0220
        00002a24-0000-1000-8000-00805f9b34fb
        Model Number String
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0230
        00002a25-0000-1000-8000-00805f9b34fb
        Serial Number String
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0240
        00002a26-0000-1000-8000-00805f9b34fb
        Firmware Revision String
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0250
        00002a27-0000-1000-8000-00805f9b34fb
        Hardware Revision String
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0260
        00002a28-0000-1000-8000-00805f9b34fb
        Software Revision String
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0270
        00002a29-0000-1000-8000-00805f9b34fb
        Manufacturer Name String
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0200/char0280
        00002a2a-0000-1000-8000-00805f9b34fb
        IEEE 11073-20601 Regulatory Cert. Data List
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300
        ecbe3980-c9a2-11e1-b1bd-0002a5d5c51b
        Vendor specific
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0310
        b305b680-aee7-11e1-a730-0002a5d5c51b
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0310/desc0312
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0320
        db5b55e0-aee7-11e1-965e-0002a5d5c51b
        Vendor specific
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0330
        e0b8a060-aee7-11e1-92f4-0002a5d5c51b
        Vendor specific
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0340
        0ae12b00-aee8-11e1-a192-0002a5d5c51b
        Vendor specific
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0350
        10e1ba60-aee8-11e1-89e5-0002a5d5c51b
        Vendor specific
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0360
        49123040-aee8-11e1-a74d-0002a5d5c51b
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0360/desc0362
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0370
        4d0bf320-aee8-11e1-a0d9-0002a5d5c51b
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0370/desc0372
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0380
        5128ce60-aee8-11e1-b84b-0002a5d5c51b
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0380/desc0382
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0390
        560f1420-aee8-11e1-8184-0002a5d5c51b
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char0390/desc0392
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char03a0
        8858eb40-aee8-11e1-bb67-0002a5d5c51b
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0300/char03a0/desc03a2
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0400
        0000180f-0000-1000-8000-00805f9b34fb
        Battery Service
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0400/char0410
        00002a19-0000-1000-8000-00805f9b34fb
        Battery Level
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0400/char0410/desc0412
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0500
        00001805-0000-1000-8000-00805f9b34fb
        Current Time Service
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0500/char0510
        00002a2b-0000-1000-8000-00805f9b34fb
        Current Time
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0500/char0510/desc0512
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0600
        5df5e817-a945-4f81-89c0-3d4e9759c07c
        Vendor specific
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0600/char0610
        00002a52-0000-1000-8000-00805f9b34fb
        Record Access Control Point
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0600/char0610/desc0612
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0600/char0620
        c195da8a-0e23-4582-acd8-d446c77c45de
        Vendor specific
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0600/char0620/desc0622
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700
        0000181c-0000-1000-8000-00805f9b34fb
        User Data
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700/char0710
        00002a99-0000-1000-8000-00805f9b34fb
        Database Change Increment
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700/char0710/desc0712
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700/char0720
        00002a9a-0000-1000-8000-00805f9b34fb
        User Index
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700/char0730
        00002a9f-0000-1000-8000-00805f9b34fb
        User Control Point
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700/char0730/desc0732
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0700/char0740
        00002a85-0000-1000-8000-00805f9b34fb
        Date of Birth
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0800
        00001810-0000-1000-8000-00805f9b34fb
        Blood Pressure
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0800/char0810
        00002a35-0000-1000-8000-00805f9b34fb
        Blood Pressure Measurement
[NEW] Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0800/char0810/desc0812
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_28_FF_B2_32_E0_19/service0800/char0820
        00002a49-0000-1000-8000-00805f9b34fb
        Blood Pressure Feature
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 00001805-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 00001810-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 0000181c-0000-1000-8000-00805f9b34fb
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: 5df5e817-a945-4f81-89c0-3d4e9759c07c
[CHG] Device 28:FF:B2:32:E0:19 UUIDs: ecbe3980-c9a2-11e1-b1bd-0002a5d5c51b
[CHG] Device 28:FF:B2:32:E0:19 ServicesResolved: yes
[CHG] Device 28:FF:B2:32:E0:19 Name: M7 Intelli IT
[CHG] Device 28:FF:B2:32:E0:19 Alias: M7 Intelli IT
[CHG] Device 28:FF:B2:32:E0:19 Appearance: 0x0381

But in your script it only returns:

python3 blue.py
Connected!
Subscribed to handle 2065
Waiting for response...

BR,
Robert

@evnleong
Copy link
Owner

Hi!

Yes, my apologies, I haven't had time to populate the readme for the repository and lay out the steps yet, but it looks like you're on the right track!

Yes, the OMRON device should be paired first to your Pi or PC using the steps laid out by the omblepy repository. Throughout my attempts, I had mixed success using blue.py (It had worked initially, but then I received the same result as you where it establishes a connection, but gets stuck waiting for a response ). Additionally, blue.py did not have a logging module built in to the library that I could use which would have allowed me to debug/trace the interactions with the bluetooth module, so I ended up switching over to using pygatt (gatt.py)) and had some success using pydbus ( dbus.py) as well. I am aware that pygatt is built on gattool which is deprecated, but it has a logging module that is really helpful to see what's happening behind the scenes. I don't have my OMRON device on me right now, but try using pygatt first and let me know if you're able to get any data!

@RobertWojtowicz
Copy link
Author

Hi, @evnleong
Unfortunately, neither gatt.py nor dbus.py works for me, omblepy only works for him on the old RPI0W but with the new Debian 12 32bit (Linux raspberrypi 6.6.31+rpt-rpi-v6) and built-in BT 4.1, he does not want to work with Debian 12 64bit and USB BT 5.3:
userx14/omblepy#25 (comment)

@evnleong
Copy link
Owner

Can you go into more detail about what is not working with gatt.py? Is it a dependency issue? Could you show me what happens when you try to run gatt.py?

@RobertWojtowicz
Copy link
Author

did something but does not display results:

DEBUG:pygatt.backends.gatttool.gatttool:gatttool_cmd=gatttool -i hci0 -I
INFO:pygatt.backends.gatttool.gatttool:Running...
INFO:pygatt.backends.gatttool.gatttool:Connecting to 28:FF:B2:32:E0:19 with timeout=8
DEBUG:pygatt.device:Looking up handle for characteristic 00002a35-0000-1000-8000-00805f9b34fb
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a00-0000-1000-8000-00805f9b34fb, value handle: 0x11
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a01-0000-1000-8000-00805f9b34fb, value handle: 0x21
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a02-0000-1000-8000-00805f9b34fb, value handle: 0x31
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a03-0000-1000-8000-00805f9b34fb, value handle: 0x41
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a04-0000-1000-8000-00805f9b34fb, value handle: 0x51
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a05-0000-1000-8000-00805f9b34fb, value handle: 0x111
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a23-0000-1000-8000-00805f9b34fb, value handle: 0x211
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a24-0000-1000-8000-00805f9b34fb, value handle: 0x221
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a25-0000-1000-8000-00805f9b34fb, value handle: 0x231
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a26-0000-1000-8000-00805f9b34fb, value handle: 0x241
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a27-0000-1000-8000-00805f9b34fb, value handle: 0x251
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a28-0000-1000-8000-00805f9b34fb, value handle: 0x261
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a29-0000-1000-8000-00805f9b34fb, value handle: 0x271
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a2a-0000-1000-8000-00805f9b34fb, value handle: 0x281
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic b305b680-aee7-11e1-a730-0002a5d5c51b, value handle: 0x311
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic db5b55e0-aee7-11e1-965e-0002a5d5c51b, value handle: 0x321
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic e0b8a060-aee7-11e1-92f4-0002a5d5c51b, value handle: 0x331
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 0ae12b00-aee8-11e1-a192-0002a5d5c51b, value handle: 0x341
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 10e1ba60-aee8-11e1-89e5-0002a5d5c51b, value handle: 0x351
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 49123040-aee8-11e1-a74d-0002a5d5c51b, value handle: 0x361
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 4d0bf320-aee8-11e1-a0d9-0002a5d5c51b, value handle: 0x371
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 5128ce60-aee8-11e1-b84b-0002a5d5c51b, value handle: 0x381
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 560f1420-aee8-11e1-8184-0002a5d5c51b, value handle: 0x391
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 8858eb40-aee8-11e1-bb67-0002a5d5c51b, value handle: 0x3a1
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a19-0000-1000-8000-00805f9b34fb, value handle: 0x411
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a2b-0000-1000-8000-00805f9b34fb, value handle: 0x511
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a52-0000-1000-8000-00805f9b34fb, value handle: 0x611
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic c195da8a-0e23-4582-acd8-d446c77c45de, value handle: 0x621
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a99-0000-1000-8000-00805f9b34fb, value handle: 0x711
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a9a-0000-1000-8000-00805f9b34fb, value handle: 0x721
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a9f-0000-1000-8000-00805f9b34fb, value handle: 0x731
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a85-0000-1000-8000-00805f9b34fb, value handle: 0x741
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a35-0000-1000-8000-00805f9b34fb, value handle: 0x811
DEBUG:pygatt.backends.gatttool.gatttool:Found characteristic 00002a49-0000-1000-8000-00805f9b34fb, value handle: 0x821
DEBUG:pygatt.device:Found <Characteristic uuid=00002a35-0000-1000-8000-00805f9b34fb handle=2065>
DEBUG:pygatt.backends.gatttool.gatttool:Sending cmd=char-write-cmd 0x812 0200
INFO:pygatt.backends.gatttool.gatttool:Sent cmd=char-write-cmd 0x812 0200
INFO:pygatt.device:Subscribed to uuid=00002a35-0000-1000-8000-00805f9b34fb
DEBUG:pygatt.backends.gatttool.gatttool:Sending cmd=char-write-req 0x12 0200
ERROR:pygatt.backends.gatttool.gatttool:No response received
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/pygatt/backends/gatttool/gatttool.py", line 573, in char_write_handle
    with self._receiver.event("char_written", timeout=timeout):
  File "/usr/lib/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/usr/local/lib/python3.11/dist-packages/pygatt/backends/gatttool/gatttool.py", line 191, in event
    self.wait(event, timeout)
  File "/usr/local/lib/python3.11/dist-packages/pygatt/backends/gatttool/gatttool.py", line 157, in wait
    raise NotificationTimeout()
pygatt.exceptions.NotificationTimeout: None
INFO:pygatt.backends.gatttool.gatttool:Stopping
INFO:pygatt.backends.gatttool.gatttool:Listener thread finished

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

No branches or pull requests

2 participants