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 disconnect Polar H10 and OH1 on iOS #190

Closed
3 of 10 tasks
avik-efcom opened this issue Sep 12, 2021 · 5 comments
Closed
3 of 10 tasks

problem with disconnect Polar H10 and OH1 on iOS #190

avik-efcom opened this issue Sep 12, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@avik-efcom
Copy link

avik-efcom commented Sep 12, 2021

Platform on which you observed the bug:

  • Android
  • iOS
  • Other
  • Platform is not relevant for this bug

Device on which you observed the bug:

  • Polar OH1
  • Polar Verity Sense
  • Polar H10
  • Polar H9
  • Other
  • Device is not relevant for this bug

Describe the bug
Hi,
when I initiate disconnect from the devices it works, but if the device is disconnect (long-distance or turns off(OH1)), the function "devcieDisconected" is not called.
I try to put a print command on disconnect but it never shows
I don't use the auto-connect function so I turn it off
image

when I try to read the exercise list I got this error
image

How to Reproduce
only connect and disconnect by long-distance or turn the device off and the function should be called

Expected behavior
the function "devcieDisconected" should call after the device disconnected

Screenshots and logs
image
on the log, you can see the HR notification stop but the function deviceDisconnected not called
image

thanks very much

@avik-efcom avik-efcom added the bug Something isn't working label Sep 12, 2021
@JOikarinen
Copy link
Contributor

Hi @avik-efcom,

I tried to reproduce the bug you explained. I took the example app and tried these steps with OH1 and H10:

STEPS:

  1. Connect to OH1
  2. Pressed OH1 button to shut it down
  3. Followed the console logs to see whether deviceDisconnected callback is called

OBSERVATION:

  • 2021-09-13 12:04:52.792808+0300 iosBleSdkTestApp[1625:1323635] DISCONNECTED: (deviceId: "58A0EB20", address: 47D0734A-A5CB-58D9-39DE-B5527DCDC576, rssi: -55, name: "Polar OH1 58A0EB20", connectable: true)

STEPS:

  1. Connect to H10
  2. H10 goes out of range
  3. Followed the console logs to see whether deviceDisconnected callback is called

OBSERVATION:

  • 2021-09-13 12:02:35.400766+0300 iosBleSdkTestApp[1621:1322550] DISCONNECTED: (deviceId: "3D474722", address: 1E1B9E05-0755-7911-A1CC-C7A24E5E2B76, rssi: -70, name: "Polar H10 3D474722", connectable: true)

Could you double check you have registered the PolarBleApiObserver for the PolarBleSDK? Done like this in the example code: api.observer = self

@avik-efcom
Copy link
Author

avik-efcom commented Sep 13, 2021

image

I add now all the api-self functions from the example
image

the connected function works ok
I attach the full log

deviceConnecting (deviceId: "80919F24", address: EC247EE7-23B4-4C7C-4C22-3A58F4FAC340, rssi: -20, name: "Polar OH1 80919F24", connectable: true)
deviceConnected (deviceId: "80919F24", address: EC247EE7-23B4-4C7C-4C22-3A58F4FAC340, rssi: -20, name: "Polar OH1 80919F24", connectable: true)
HR READY
battery level updated: 100
HR notification: 90 rrs: []
Feature acc is ready.
Feature ppg is ready.
Feature ppi is ready.
HR notification: 90 rrs: []
HR notification: 90 rrs: []
OP: list exercises completed
HR notification: 89 rrs: []
HR notification: 90 rrs: []
HR notification: 90 rrs: []
HR notification: 90 rrs: []
HR notification: 90 rrs: []
HR notification: 90 rrs: []
HR notification: 89 rrs: []
HR notification: 89 rrs: []
HR notification: 88 rrs: []
HR notification: 88 rrs: []
**//turn off the OH1 here**
HR notification: 0 rrs: []
**//suppost to get the disconnected print**
**//after a while ask for the exercise list (I did not know the device is disconnected from the code)**
failed to list exercises: PolarBleSdk.DeviceNotConnected

image

@avik-efcom
Copy link
Author

avik-efcom commented Sep 13, 2021

I add the logger and got this
image

it seems is the device disconnected but I don't know why I did not get it from the deviceDisconnected function

I attach the full log from the connection to the disconnection:


deviceConnecting (deviceId: "80919F24", address: EC247EE7-23B4-4C7C-4C22-3A58F4FAC340, rssi: -62, name: "Polar OH1 80919F24", connectable: true)
Polar SDK log:  [BLE] default session state update from:  sessionClosed  to:  sessionOpening
deviceConnected (deviceId: "80919F24", address: EC247EE7-23B4-4C7C-4C22-3A58F4FAC340, rssi: -62, name: "Polar OH1 80919F24", connectable: true)
Polar SDK log:  [BLE] didConnect:  <CBPeripheral: 0x282b4b020, identifier = EC247EE7-23B4-4C7C-4C22-3A58F4FAC340, name = Polar OH1 80919F24, mtu = 232, state = connected>
Polar SDK log:  [BLE] default session state update from:  sessionOpening  to:  sessionOpen
Polar SDK log:  [BLE] MTU SIZE(WithoutResponse): 229
Polar SDK log:  [BLE] service discovered:  Device Information
Polar SDK log:  [BLE] service discovered:  FEEE
Polar SDK log:  [BLE] service discovered:  Heart Rate
Polar SDK log:  [BLE] service discovered:  Battery
Polar SDK log:  [BLE] service discovered:  FB005C20-02E7-F387-1CAD-8ACD2D8DF0C8
Polar SDK log:  [BLE] service discovered:  6217FF4B-FB31-1140-AD5A-A45545D7ECF3
Polar SDK log:  [BLE] service discovered:  FB005C80-02E7-F387-1CAD-8ACD2D8DF0C8
Polar SDK log:  [BLE] send next att notify: <CBCharacteristic: 0x283e74960, UUID = FB005C51-02E7-F387-1CAD-8ACD2D8DF0C8, properties = 0x1C, value = {length = 67, bytes = 0x0208b6b3 81181a14 0a1091ba 9e863758 ... 12180820 fd041800 }, notifying = NO>
HR READY
Polar SDK log:  [BLE] GATT Base notifyDescriptorWritten for chr: FB005C51-02E7-F387-1CAD-8ACD2D8DF0C8 enabled: true err 0
Polar SDK log:  [BLE] send next att notify: <CBCharacteristic: 0x283e747e0, UUID = FB005C52-02E7-F387-1CAD-8ACD2D8DF0C8, properties = 0x10, value = {length = 2, bytes = 0x0207}, notifying = NO>
Polar SDK log:  [BLE] BleBasClient process data. chr: 2A19 battery percentage: 100
battery level updated: 100
Polar SDK log:  [BLE] GATT Base notifyDescriptorWritten for chr: FB005C52-02E7-F387-1CAD-8ACD2D8DF0C8 enabled: true err 0
Polar SDK log:  [BLE] send next att notify: <CBCharacteristic: 0x283e74a20, UUID = 2A37, properties = 0x10, value = {length = 2, bytes = 0x0000}, notifying = NO>
Polar SDK log:  [BLE] GATT Base notifyDescriptorWritten for chr: 2A37 enabled: true err 0
Polar SDK log:  [BLE] send next att notify: <CBCharacteristic: 0x283e74ea0, UUID = Battery Level, properties = 0x12, value = {length = 1, bytes = 0x64}, notifying = NO>
Polar SDK log:  [BLE] GATT Base notifyDescriptorWritten for chr: Battery Level enabled: true err 0
Polar SDK log:  [BLE] send next att notify: <CBCharacteristic: 0x283e752c0, UUID = FB005C81-02E7-F387-1CAD-8ACD2D8DF0C8, properties = 0x2A, value = {length = 17, bytes = 0x0f0e000000000000000000000000000000}, notifying = NO>
Polar SDK log:  [BLE] GATT Base notifyDescriptorWritten for chr: FB005C81-02E7-F387-1CAD-8ACD2D8DF0C8 enabled: true err 0
Polar SDK log:  [BLE] send next att notify: <CBCharacteristic: 0x283e75320, UUID = FB005C82-02E7-F387-1CAD-8ACD2D8DF0C8, properties = 0x10, value = (null), notifying = NO>
Feature ppg is ready.
Feature ppi is ready.
Feature acc is ready.
Polar SDK log:  [BLE] GATT Base notifyDescriptorWritten for chr: FB005C82-02E7-F387-1CAD-8ACD2D8DF0C8 enabled: true err 0
HR notification: 0 rrs: []
HR notification: 73 rrs: []
Polar SDK log:  [BLE] PS-FTP new request operation
Polar SDK log:  [BLE] commandState state:IDLE action: ADMIN_STOP_SCAN
Polar SDK log:  [BLE] commandState state:IDLE action: EXIT
Polar SDK log:  [BLE] commandState state:STOPPED action: ENTRY
Polar SDK log:  MTU send  HEX 02 09 00 08 00 12 05 2F 55 2F 30 2F
Polar SDK log:  MTU in  HEX 02 0A 0C 0A 08 44 42 44 43 2E 44 41 54 10 01 0A 0E 0A 0A 55 53 45 52 49 44 2E 42 50 42 10 42 0A 06 0A 02 53 2F 10 00 0A 0D 0A 09 32 30 32 31 30 34 31 39 2F 10 00 0A 0D 0A 09 32 30 32 31 30 35 33 30 2F 10 00 0A 0D 0A 09 32 30 31 37 30 31 30 32 2F 10 00 0A 0D 0A 09 32 30 32 31 30 39 31 33 2F 10 00
Polar SDK log:  [BLE] RFC76 message has read successfully
Polar SDK log:  [BLE] PS-FTP request operation DISPOSED
Polar SDK log:  [BLE] PS-FTP new request operation
Polar SDK log:  MTU send  HEX 02 12 00 08 00 12 0E 2F 55 2F 30 2F 32 30 32 31 30 34 31 39 2F
Polar SDK log:  [BLE] commandState state:STOPPED action: ADMIN_START_SCAN
Polar SDK log:  [BLE] commandState state:STOPPED action: EXIT
Polar SDK log:  [BLE] commandState state:IDLE action: ENTRY
Polar SDK log:  [BLE] commandState state:IDLE action: ADMIN_STOP_SCAN
Polar SDK log:  [BLE] commandState state:IDLE action: EXIT
Polar SDK log:  [BLE] commandState state:STOPPED action: ENTRY
Polar SDK log:  MTU in  HEX 02 0A 0D 0A 09 50 48 59 53 44 41 54 41 2F 10 00 0A 06 0A 02 45 2F 10 00
Polar SDK log:  [BLE] RFC76 message has read successfully
Polar SDK log:  [BLE] PS-FTP request operation DISPOSED
Polar SDK log:  [BLE] PS-FTP new request operation
Polar SDK log:  [BLE] commandState state:STOPPED action: ADMIN_START_SCAN
Polar SDK log:  [BLE] commandState state:STOPPED action: EXIT
Polar SDK log:  [BLE] commandState state:IDLE action: ENTRY
Polar SDK log:  [BLE] commandState state:IDLE action: ADMIN_STOP_SCAN
Polar SDK log:  MTU send  HEX 02 12 00 08 00 12 0E 2F 55 2F 30 2F 32 30 32 31 30 35 33 30 2F
Polar SDK log:  [BLE] commandState state:IDLE action: EXIT
Polar SDK log:  [BLE] commandState state:STOPPED action: ENTRY
Polar SDK log:  MTU in  HEX 02 0A 0D 0A 09 50 48 59 53 44 41 54 41 2F 10 00
Polar SDK log:  [BLE] RFC76 message has read successfully
Polar SDK log:  [BLE] PS-FTP request operation DISPOSED
Polar SDK log:  [BLE] commandState state:STOPPED action: ADMIN_START_SCAN
Polar SDK log:  [BLE] commandState state:STOPPED action: EXIT
Polar SDK log:  [BLE] commandState state:IDLE action: ENTRY
Polar SDK log:  [BLE] PS-FTP new request operation
Polar SDK log:  [BLE] commandState state:IDLE action: ADMIN_STOP_SCAN
Polar SDK log:  [BLE] commandState state:IDLE action: EXIT
Polar SDK log:  [BLE] commandState state:STOPPED action: ENTRY
Polar SDK log:  MTU send  HEX 02 12 00 08 00 12 0E 2F 55 2F 30 2F 32 30 31 37 30 31 30 32 2F
Polar SDK log:  MTU in  HEX 02 0A 0D 0A 09 50 48 59 53 44 41 54 41 2F 10 00
Polar SDK log:  [BLE] RFC76 message has read successfully
Polar SDK log:  [BLE] PS-FTP request operation DISPOSED
Polar SDK log:  [BLE] commandState state:STOPPED action: ADMIN_START_SCAN
Polar SDK log:  [BLE] commandState state:STOPPED action: EXIT
Polar SDK log:  [BLE] commandState state:IDLE action: ENTRY
Polar SDK log:  [BLE] PS-FTP new request operation
Polar SDK log:  [BLE] commandState state:IDLE action: ADMIN_STOP_SCAN
Polar SDK log:  [BLE] commandState state:IDLE action: EXIT
Polar SDK log:  [BLE] commandState state:STOPPED action: ENTRY
Polar SDK log:  MTU send  HEX 02 12 00 08 00 12 0E 2F 55 2F 30 2F 32 30 32 31 30 39 31 33 2F
Polar SDK log:  MTU in  HEX 02 0A 0D 0A 09 50 48 59 53 44 41 54 41 2F 10 00
Polar SDK log:  [BLE] RFC76 message has read successfully
Polar SDK log:  [BLE] PS-FTP request operation DISPOSED
Polar SDK log:  [BLE] commandState state:STOPPED action: ADMIN_START_SCAN
Polar SDK log:  [BLE] commandState state:STOPPED action: EXIT
Polar SDK log:  [BLE] commandState state:IDLE action: ENTRY
Polar SDK log:  [BLE] PS-FTP new request operation
Polar SDK log:  [BLE] commandState state:IDLE action: ADMIN_STOP_SCAN
Polar SDK log:  [BLE] commandState state:IDLE action: EXIT
Polar SDK log:  [BLE] commandState state:STOPPED action: ENTRY
Polar SDK log:  MTU send  HEX 02 14 00 08 00 12 10 2F 55 2F 30 2F 32 30 32 31 30 34 31 39 2F 45 2F
Polar SDK log:  MTU in  HEX 00 00 00
OP: list exercises completed
Polar SDK log:  [BLE] RFC76 message response: Optional(0)
Polar SDK log:  [BLE] PS-FTP request operation DISPOSED
Polar SDK log:  [BLE] commandState state:STOPPED action: ADMIN_START_SCAN
Polar SDK log:  [BLE] commandState state:STOPPED action: EXIT
Polar SDK log:  [BLE] commandState state:IDLE action: ENTRY
HR notification: 73 rrs: []
HR notification: 73 rrs: []
HR notification: 72 rrs: []
HR notification: 72 rrs: []
HR notification: 72 rrs: []
HR notification: 71 rrs: []
HR notification: 71 rrs: []
Polar SDK log:  [BLE] PS-FTP new query operation
Polar SDK log:  MTU send  HEX 02 03 80 0A 07 08 E5 0F 10 09 18 0D 12 08 08 0D 10 21 18 19 20 00 18 B4 01
Polar SDK log:  MTU in  HEX 00 00 00
Polar SDK log:  [BLE] RFC76 message response: Optional(0)
Polar SDK log:  [BLE] PS-FTP query operation DISPOSED
HR notification: 70 rrs: []
HR notification: 70 rrs: []
HR notification: 70 rrs: []
HR notification: 70 rrs: []
HR notification: 71 rrs: []
HR notification: 71 rrs: []
HR notification: 71 rrs: []
HR notification: 71 rrs: []
HR notification: 71 rrs: []
HR notification: 71 rrs: []
HR notification: 72 rrs: []
HR notification: 72 rrs: []
HR notification: 73 rrs: []
HR notification: 74 rrs: []
HR notification: 75 rrs: []
HR notification: 0 rrs: []
Polar SDK log:  [BLE] didDisconnectPeripheral:  <CBPeripheral: 0x282b4b020, identifier = EC247EE7-23B4-4C7C-4C22-3A58F4FAC340, name = Polar OH1 80919F24, mtu = 23, state = disconnected>
Polar SDK log:  [BLE] default session state update from:  sessionOpen  to:  sessionClosed
Polar SDK log:  gattDisconnected
Polar SDK log:  [BLE] PS-FTP reset 
Polar SDK log:  gattDisconnected

@NiwreRelbag
Copy link

Hello,
I have a similar problem with the H10 (on iOS).
"deviceConnected" is called, but if I remove the H10 from the strap and wait a few minutes, "deviceDisconnected" is never called (and it continues to send ECG data).

When I use the H10 with the Std. CBCentralManager class, "didDisconnectPeripheral" is called about 1 minute after removing the H10 from the strap.

Thanks a lot!

@JOikarinen JOikarinen self-assigned this Dec 7, 2021
@JOikarinen
Copy link
Contributor

@NiwreRelbag and @avik-efcom I think I found the root cause for the problem. As you described the deviceDisconnected was never called if the automaticReconnection was set to false. The problem is now fixed in release 3.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants