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

tried on OSX version 10.15.7 and xcode 12.0.1 #1

Open
smuet opened this issue Oct 28, 2020 · 4 comments
Open

tried on OSX version 10.15.7 and xcode 12.0.1 #1

smuet opened this issue Oct 28, 2020 · 4 comments

Comments

@smuet
Copy link

smuet commented Oct 28, 2020

hi, nice application.
I tried running on OSX version 10.15.7 and XCode 12.0.1, at the first run the application running well. (running well for the first time after startup)
However, the 2nd, and so on the application didn't work. it seems cannot discover the polar device.
after restart running well, but the problem comes again for the 2nd run. here I attach a screenshot for the 2nd run and console log.

Screen Shot 2020-10-28 at 22 38 36

@FleXoft
Copy link
Owner

FleXoft commented Oct 28, 2020

Hello,

Could you describe the exact steps you made?

I've just recompiled on my current machine. I'm on Xcode 12.1 now, and it's stable with my Polar H10:

  • viewDidLoad begin

  • viewDidLoad end
    2020-10-28 17:58:45.106909+0100 HRM[26329:721636] Metal API Validation Enabled
    -- centralManagerDidUpdateState begin
    -- central state is poweredOn
    -- Start scanning...
    -- centralManagerDidUpdateState end
    --- didDiscover peripheral begin
    --- ??? advertisementData[CBAdvertisementDataLocalNameKey] nil
    --- didDiscover peripheral end
    --- didDiscover peripheral begin
    --- Found POLAR H7 heart rate monitor named: Polar H10 2AF04C2B.
    --- Found POLAR H7 heart rate monitor RSSI: -45 db (-30 dB Amazing, -67 dB Very Good, -70 dB Okay, -80 dB Not Good, -90 dB Unusable).
    --- Stop scanning
    --- didDiscover peripheral end
    ---- didConnectPeripheral begin
    ---- peripheral state is 2
    ---- didConnectPeripheral end
    ----- didDiscoverServices begin
    +++++ Service: Heart Rate
    --------------------------------------------
    Service UUID: 180D
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    +++++ Service: 181C
    --------------------------------------------
    Service UUID: 181C
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    +++++ Service: Device Information
    --------------------------------------------
    Service UUID: 180A
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    +++++ Service: Battery
    --------------------------------------------
    Service UUID: 180F
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    +++++ Service: 6217FF4B-FB31-1140-AD5A-A45545D7ECF3
    --------------------------------------------
    Service UUID: 6217FF4B-FB31-1140-AD5A-A45545D7ECF3
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    +++++ Service: FB005C80-02E7-F387-1CAD-8ACD2D8DF0C8
    --------------------------------------------
    Service UUID: FB005C80-02E7-F387-1CAD-8ACD2D8DF0C8
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    +++++ Service: FEEE
    --------------------------------------------
    Service UUID: FEEE
    Service isPrimary: false
    Service isProxy: false
    --------------------------------------------
    ----- didDiscoverServices end
    ------ didDiscoverCharacteristicsFor begin nil UUID Heart Rate
    ++++++ Heart Rate Service
    ------ Found Heart Rate Measurement Characteristic
    --------------------------------------------
    Characteristic UUID: 2A37
    Characteristic UUID: 2A37
    Characteristic isNotifying: false
    Characteristic properties: CBCharacteristicProperties(rawValue: 16)
    notify
    Characteristic descriptors: nil
    Characteristic value: nil
    --------------------------------------------
    ------ Found Body Sensor Location Characteristic
    --------------------------------------------
    Characteristic UUID: 2A38
    Characteristic UUID: 2A38
    Characteristic isNotifying: false
    Characteristic properties: CBCharacteristicProperties(rawValue: 2)
    read
    Characteristic descriptors: nil
    Characteristic value: nil
    --------------------------------------------
    ------ didDiscoverCharacteristicsFor end =====================================================
    ------ didDiscoverCharacteristicsFor begin nil UUID 181C
    ------ didDiscoverCharacteristicsFor end =====================================================
    ------ didDiscoverCharacteristicsFor begin nil UUID Device Information
    ++++++ Found Device Information
    ------ Manufacturer Name String
    --------------------------------------------
    Characteristic UUID: Manufacturer Name String
    Characteristic UUID: 2A29
    Characteristic isNotifying: false
    Characteristic properties: CBCharacteristicProperties(rawValue: 2)
    read
    Characteristic descriptors: nil
    Characteristic value: nil
    --------------------------------------------

     --------------------------------------------
     Characteristic UUID: Model Number String
     Characteristic UUID: 2A24
     Characteristic isNotifying: false
     Characteristic properties: CBCharacteristicProperties(rawValue: 2)
    

read
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ Serial Number String
--------------------------------------------
Characteristic UUID: Serial Number String
Characteristic UUID: 2A25
Characteristic isNotifying: false
Characteristic properties: CBCharacteristicProperties(rawValue: 2)
read
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ Hardware Revision String
--------------------------------------------
Characteristic UUID: Hardware Revision String
Characteristic UUID: 2A27
Characteristic isNotifying: false
Characteristic properties: CBCharacteristicProperties(rawValue: 2)
read
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ Firmware Revision String
--------------------------------------------
Characteristic UUID: Firmware Revision String
Characteristic UUID: 2A26
Characteristic isNotifying: false
Characteristic properties: CBCharacteristicProperties(rawValue: 2)
read
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ Software Revision String
--------------------------------------------
Characteristic UUID: Software Revision String
Characteristic UUID: 2A28
Characteristic isNotifying: false
Characteristic properties: CBCharacteristicProperties(rawValue: 2)
read
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ System ID
--------------------------------------------
Characteristic UUID: System ID
Characteristic UUID: 2A23
Characteristic isNotifying: false
Characteristic properties: CBCharacteristicProperties(rawValue: 2)
read
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ didDiscoverCharacteristicsFor end =====================================================
------ didDiscoverCharacteristicsFor begin nil UUID Battery
++++++ Found Battery Service
------ Battery Level
--------------------------------------------
Characteristic UUID: Battery Level
Characteristic UUID: 2A19
Characteristic isNotifying: false
Characteristic properties: CBCharacteristicProperties(rawValue: 18)
read
notify
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------ didDiscoverCharacteristicsFor end =====================================================
------ didDiscoverCharacteristicsFor begin nil UUID 6217FF4B-FB31-1140-AD5A-A45545D7ECF3
------ didDiscoverCharacteristicsFor end =====================================================
------ didDiscoverCharacteristicsFor begin nil UUID FB005C80-02E7-F387-1CAD-8ACD2D8DF0C8
------ didDiscoverCharacteristicsFor end =====================================================
------ didDiscoverCharacteristicsFor begin nil UUID FEEE
------ didDiscoverCharacteristicsFor end =====================================================
------- didUpdateValueForCharacteristic begin 2A38
UPDATING Sensor Locaton: 1 (0 Other, 1 Chest, 2 Wrist, 3 Finger, 4 Hand, 5 Ear Lobe, 6 Foot, 7 - 255 Reserved for future use)
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A29
UPDATING Manufact: Polar Electro Oy�
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A25
UPDATING Serial Number: 2AF04C2B�
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A27
UPDATING Hardware Revision: 00760690.03�
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A26
UPDATING Firmware Revision: 5.0.0�
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A28
UPDATING SW v: 3.0.56�
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A23
UPDATING System ID: [76, 240, 42, 254, 255, 26, 158, 160]
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A19
UPDATING Battery Level: 10%
------- didUpdateValueForCharacteristic end
------- didUpdateNotificationStateFor begin 2A37
--------------------------------------------
Characteristic UUID: 2A37
Characteristic UUID: 2A37
Characteristic isNotifying: true
Characteristic properties: CBCharacteristicProperties(rawValue: 16)
Characteristic descriptors: nil
Characteristic value: nil
--------------------------------------------
------- didUpdateNotificationStateFor end
------- peripheralDidUpdateRSSI begin -44
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -45
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -45
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -44
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -44
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -44
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -45
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -45
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 6 [16, 78, 210, 2, 200, 2]
Heart rate format UINT8
RR: 705.078125 ms
File logging RR...
RR: 695.3125 ms
File logging RR...
Heart Rate: 78 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -46
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 79, 183, 2]
Heart rate format UINT8
RR: 678.7109375 ms
File logging RR...
Heart Rate: 79 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -47
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 80, 192, 2]
Heart rate format UINT8
RR: 687.5 ms
File logging RR...
Heart Rate: 80 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -48
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 6 [16, 81, 0, 3, 18, 3]
Heart rate format UINT8
RR: 750.0 ms
File logging RR...
RR: 767.578125 ms
File logging RR...
Heart Rate: 81 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -50
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 81, 50, 3]
Heart rate format UINT8
RR: 798.828125 ms
File logging RR...
Heart Rate: 81 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -50
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 80, 83, 3]
Heart rate format UINT8
RR: 831.0546875 ms
File logging RR...
Heart Rate: 80 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -46
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 80, 114, 3]
Heart rate format UINT8
RR: 861.328125 ms
File logging RR...
Heart Rate: 80 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -51
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 79, 71, 3]
Heart rate format UINT8
RR: 819.3359375 ms
File logging RR...
Heart Rate: 79 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -48
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 6 [16, 78, 82, 3, 103, 3]
Heart rate format UINT8
RR: 830.078125 ms
File logging RR...
RR: 850.5859375 ms
File logging RR...
Heart Rate: 78 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -50
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 77, 111, 3]
Heart rate format UINT8
RR: 858.3984375 ms
File logging RR...
Heart Rate: 77 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -49
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 76, 54, 3]
Heart rate format UINT8
RR: 802.734375 ms
File logging RR...
Heart Rate: 76 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -54
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 76, 50, 3]
Heart rate format UINT8
RR: 798.828125 ms
File logging RR...
Heart Rate: 76 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -53
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 6 [16, 76, 66, 3, 74, 3]
Heart rate format UINT8
RR: 814.453125 ms
File logging RR...
RR: 822.265625 ms
File logging RR...
Heart Rate: 76 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -50
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 75, 57, 3]
Heart rate format UINT8
RR: 805.6640625 ms
File logging RR...
Heart Rate: 75 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 75, 41, 3]
Heart rate format UINT8
RR: 790.0390625 ms
File logging RR...
Heart Rate: 75 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 75, 67, 3]
Heart rate format UINT8
RR: 815.4296875 ms
File logging RR...
Heart Rate: 75 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 75, 88, 3]
Heart rate format UINT8
RR: 835.9375 ms
File logging RR...
Heart Rate: 75 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A37
Count: 6 [16, 75, 71, 3, 79, 3]
Heart rate format UINT8
RR: 819.3359375 ms
File logging RR...
RR: 827.1484375 ms
File logging RR...
Heart Rate: 75 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 75, 85, 3]
Heart rate format UINT8
RR: 833.0078125 ms
File logging RR...
Heart Rate: 75 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -52
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -52
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -52
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -48
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -48
------- peripheralDidUpdateRSSI end
------- peripheralDidUpdateRSSI begin -55
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 74, 97, 3]
Heart rate format UINT8
RR: 844.7265625 ms
File logging RR...
Heart Rate: 74 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end
------- peripheralDidUpdateRSSI begin -48
------- peripheralDidUpdateRSSI end
------- didUpdateValueForCharacteristic begin 2A37
Count: 4 [16, 74, 58, 3]
Heart rate format UINT8
RR: 806.640625 ms
File logging RR...
Heart Rate: 74 bpm
File logging HRM...
------- didUpdateValueForCharacteristic end

@smuet
Copy link
Author

smuet commented Oct 29, 2020

hi, thank you for your response.

I forgot to mention MacBook Pro (13-inch, 2020) and Polar H10 in the previous running of the program which shows advertisementData[CBAdvertisementDataLocalNameKey] nil.

However, I've just tried on MacBook Pro (13-inch, 2017) the program runs well.
is it hardware issues?

@smuet
Copy link
Author

smuet commented Oct 29, 2020

maybe this happened like this post: https://developer.apple.com/forums/thread/657926
"After Disconnecting From a Peripheral, It Won't Be Discovered Again"

@FleXoft
Copy link
Owner

FleXoft commented Oct 29, 2020

What I made: start the app, put on my H10, switch off H10, put on again. On my 2019 16" latest code version worked well.

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