Arduno 101 BLE - HeartRateMonitor example doesn't work

Hello! I've just got my Genuino 101, and wanted to test its new BLE (Bluetooth Low-Energy) capabilities..
I looked for good examples and found this one -

I've uploaded the exact code (which had no errors), installed the nRF app as said (I'm using Nexus 5, Android 6.01). When I tried to connect the 101 via the nRF app (in the HeartRateMonitor section), the 101 showed me that I've connected and then kicked me off with an error response in the app - "this device does not have required services"..

What should I do? I just tried the example showed on site and didn't change anything..
Thanks a lot!

Dan

Hi Dan,

I just fixed the example so it should work correctly now.
The problem was that we were developing with the BatteryMonitor example but you need different apps depending on your smartphone OS (nRF Master control on Android; LightBlue on iOS), so we switched to a characteristic which could be seen using the same app (nRF Toolbox)

But the Heart Rate characteristic needs a first byte containing "flags" followed by a second byte containing the actual heart rate value (https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml) and we were confusing the app.

Let me know if it works with the new code!

facchinm:
Hi Dan,

I just fixed the example so it should work correctly now.
The problem was that we were developing with the BatteryMonitor example but you need different apps depending on your smartphone OS (nRF Master control on Android; LightBlue on iOS), so we switched to a characteristic which could be seen using the same app (nRF Toolbox)

But the Heart Rate characteristic needs a first byte containing "flags" followed by a second byte containing the actual heart rate value (https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml) and we were confusing the app.

Let me know if it works with the new code!

Hi!
Thanks for updating the example. Unfortunately, it still doesn't work...
Dan

I'm starting to suspect that Android 6 may be enforcing some checks... I'l try to test with a Nexus and get rid of this problem soon. Thanks again for pointing it out!

facchinm:
I'm starting to suspect that Android 6 may be enforcing some checks... I'l try to test with a Nexus and get rid of this problem soon. Thanks again for pointing it out!

I've just tested it with a different smartphone - HTC one M8 (Android 5.0.1). Works flaulessly. The problem is, probably, the new Android 6 - just like you said. I hope you'll fix it soon, that's very annoying for me that I can't use the BLE with my own phone...

facchinm:
I'm starting to suspect that Android 6 may be enforcing some checks... I'l try to test with a Nexus and get rid of this problem soon. Thanks again for pointing it out!

Any updates?

I have a nexus 5 with 6.01 and it connects just fine. Don't have anything hooked up to measure the heart rate so it gives a steady number unless I move the 101.

Tested with Nexus 4 (unofficial 6.0.1 ROM) and it works good.
Maybe Android cached some infos about the device when using the first (broken) sketch; you could try modifying the Device name in the sketch (changing
blePeripheral.setLocalName("HeartRateSketch"); to blePeripheral.setLocalName("whatever");) and see if Android can recover the correct available characteristics.

facchinm:
Hi Dan,

I just fixed the example so it should work correctly now.
The problem was that we were developing with the BatteryMonitor example but you need different apps depending on your smartphone OS (nRF Master control on Android; LightBlue on iOS), so we switched to a characteristic which could be seen using the same app (nRF Toolbox)

But the Heart Rate characteristic needs a first byte containing "flags" followed by a second byte containing the actual heart rate value (https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml) and we were confusing the app.

Let me know if it works with the new code!

Hi I am new to Arduino 101. I am also trying the heart rate monitor program. It can not work in debugging. I copied every code from this link. https://www.arduino.cc/en/Tutorial/Genuino101CurieBLEHeartRateMonitor. But it shows "'BLEPeripheral' does not name a type". What is the issue? How can I define the device? Thanks

Haotian