jonasoreland / runnerup

A open source run tracker
GNU General Public License v3.0
753 stars 275 forks source link

Not possible to connect ID107 (smart HRM bracelet) via BLE #392

Closed basaandewiel closed 7 years ago

basaandewiel commented 8 years ago

First I love this application very much!

I just received a ID107 smart HRM bracelet, http://www.gearbest.com/smart-watches/pp_335971.html I tried to connect with Runnerup (latest f-droid version), with BLE: no device appears. Is this device not supported? What can I do to help getting this device supported (is there maybe a hidden debug mode for this, or can I can I do anything else?)

jonasoreland commented 8 years ago

I have never tried that device, and I don't know if anyone else has. Can you connect to it using e.g https://play.google.com/store/apps/details?id=com.pribble.htc.ble.hrm ?

/Jonas

On Thu, May 19, 2016 at 7:06 PM, Bas aan de Wiel notifications@github.com wrote:

First I love this application very much!

I just received a ID107 smart HRM bracelet, http://www.gearbest.com/smart-watches/pp_335971.html I tried to connect with Runnerup (latest f-droid version), with BLE: no device appears. Is this device not supported? What can I do to help getting this device supported (is there maybe a hidden debug mode for this, or can I can I do anything else?)

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/jonasoreland/runnerup/issues/392

bassie127 commented 8 years ago

I tried that app several times (with the device actually measuring my heart rate, and screen on). It does recognise the device, but doesn't want to connect with it.

I also tried the app BLE Scanner, but that does not even recognise the device.

jonasoreland commented 8 years ago

so...the device is probably not using the "standard" hrm profile, but something custom made for that device/app...(note: this is a guess)

then one need to 1) find out how it works (documentation, open source code, reverse engineer etc) 2) implement it...

/Jonas

On Thu, May 19, 2016 at 8:47 PM, bassie127 notifications@github.com wrote:

I tried that app several times (with the device actually measuring my heart rate, and screen on). It does recognise the device, but doesn't want to connect with it.

I also tried the app BLE Scanner, but that does not even recognise the device.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jonasoreland/runnerup/issues/392#issuecomment-220416057

bassie127 commented 8 years ago

do you know good BLE scanner software, and would that help? Or is there a big chance that the communication will be encrypted and a scanner wil not help much? (note: I'm not a developer, nor hacker :), so maybe this are dumb questions)

pacc commented 8 years ago

Always interested in gadgets, but instead of getting the ID107 for hacking there is the even cheaper XIaomi Mi Pulse which already seem to support standard BLE HRM (with an app activation) http://www.gearbest.com/smart-wristband/pp_263275.html

See for instructions: http://forum.xda-developers.com/showpost.php?p=64707216&postcount=209

If you for any reason got a Sony Smartband 2 the latest update adds BLE HRM support, but it's only advertised in the changelog or if you happen to wander into the settings to enable third party apps...

orangecms commented 7 years ago

Hey there, I just got this device myself (2 of it actually). The nRF chip they use should be possible to be flashed with mbed (they claim FOSA support, i.e. Firmware Over The Air), so I want to use one of the two buddies to hack on it a bit, maybe write better firmware that would support BLE HRM. :) Otherwise, I'll try to reverse-engineer the current protocol. Thanks for this cool project!

basaandewiel commented 7 years ago

@ orangecms sounds great!! I have the idea that with the current firmware of the ID107 the heart rate is not measured contineously, but every 1 minute or so. I think we need at least a measurement every 10 or 15 seconds. I don't know how this effects battery life of the ID107. If you have developped something I am very interested!

basaandewiel commented 7 years ago

I just discoverd this open source 'smart watch' http://www.hexiwear.com/ ; looks very interesting.

lotfix commented 7 years ago

hi guys, so did anyone got through this, making the id107 look like a standard HRm monitor ?

gerhardol commented 7 years ago

This issue is about modifying the ID107. The band cannot be used as BLE HR right now. Very special hacking would be required, this should be done as a seprate adaptor if someone takes this on so the band can be used in more apps. See also #488 for ID107

micooke commented 7 years ago

Heya, I just wanted to confirm that the ID107HR does not use the HRM BLE protocol. I also wanted to say that there is a bit of work going in with the ID107HR e.g. Arduino on the id100hr fitness tracker . Im personally working on the ID107HR and will let you know how it progresses if there is interest

lotfix commented 7 years ago

Ooh good thank you much I am indeed very interested and will wait impatiently for your updates I can't get full usage of my tracker since it's not yet compatible with my favourite apps but I count on you and will wait for response..thanks again and I wish you the very best luck

Le 17 août 2017 00:20, "Mark Cooke" notifications@github.com a écrit :

Heya, I just wanted to confirm that the ID107HR does not use the HRM BLE protocol. I also wanted to say that there is a bit of work going in with the ID107HR e.g. Arduino on the id100hr fitness tracker http://www.rogerclark.net/arduino-on-the-id100hr-fitness-tracker . Im personally working on the ID107HR and will let you know how it progresses if there is interest

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jonasoreland/runnerup/issues/392#issuecomment-322925923, or mute the thread https://github.com/notifications/unsubscribe-auth/AdAkI_vuTyjvGV2im1GubIwz4q-Ncie2ks5sY3lEgaJpZM4IieN4 .

basaandewiel commented 7 years ago

I like gadget hacking and custom firmware very much (I'm also the author of the first post about the Id107), so I don't want to be pessimstic, but I have one question: WIth the standard firmware the ID107 measures heartrate only every x seconds (every minute?). Is the battery big enough to support 1 or 2 hour contineous heart rate monitoring?

lotfix commented 7 years ago

Hi i think it can yes.there is a "sport mode" in the watch if you hit twice the side button it " measures " continuesly your heart rate while working out. I often use It for sessions longer that one hour without any major loss of battery. I said " measures" because some time I think it's not very accurate but continuous that's for sure. Thanks again. Waiting for your updates if there's anything else, I'll be happy to help

Le 17 août 2017 08:26, "Bas aan de Wiel" notifications@github.com a écrit :

I like gadget hacking and custom firmware very much (I'm also the author of the first post about the Id107), so I don't want to be pessimstic, but I have one question: WIth the standard firmware the ID107 measures heartrate only every x seconds (every minute?). Is the battery big enough to support 1 or 2 hour contineous heart rate monitoring?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jonasoreland/runnerup/issues/392#issuecomment-322991132, or mute the thread https://github.com/notifications/unsubscribe-auth/AdAkI5LIHaB8PQKivFMzmD4l1x1PkLpLks5sY-s8gaJpZM4IieN4 .

basaandewiel commented 7 years ago

Oh, I didn't know that, I will try that out. NB: I do not have the expertise to hack this device, we have to wait for @micooke

lotfix commented 7 years ago

Good... We'll wait then lol. The problem with that shitty sport mode is that you can't see results on app,and the calories burned are calculated from the distance not the heart rate ( like runtastic or endomendo do) , so according to the watch if you do 2 hours of heavy duty in a steady position like weightlifting you will burn...2 or 3 calories loool !

Le 17 août 2017 08:39, "Bas aan de Wiel" notifications@github.com a écrit :

Oh, I didn't know that, I will try that out. NB: I do not have the expertise to hack this device, we have to wait for @micooke https://github.com/micooke

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jonasoreland/runnerup/issues/392#issuecomment-322993638, or mute the thread https://github.com/notifications/unsubscribe-auth/AdAkIznzQlC3-oxNQN3ZiZI2qyqH64PQks5sY-4wgaJpZM4IieN4 .

micooke commented 7 years ago

On a side note, if you can pick up a cheap scosche rhythm or scosche rhythm plus cheap that should do the trick. I sometimes see them for $40-$50AUD second hand.

Regarding battery, if someone can check the battery life in recording mode (mentioned above as sports mode) - which logs an activity you can post upload to your phone - that would help. Mine is currently fragged, i had a (recoverable) issue with the custom firmware im working on.

Short term the battery life will be far worse. Long term it should be much better as you can e.g. turn off the accelerometer and screen when logging, reduce the bt transmitter power, sleep between sampling and adjust the sample rate based off historical heart rate. Etc

micooke commented 7 years ago

And to iterate what is involved to upload firmware, you need to open the back and solder to the gnd, swdio and swdclk pads (they are labelled) and program it using a swd programmer like an stlink v2 (clones are about $3 from your favourite Chinese retailer), or jlink $$, or a black magic probe (diy one from an stlink or a $3 stm32 board).

It needs a softcore uploaded to it via this method, then (in theory) subsequent updates can be done ota.

micooke commented 7 years ago

It may be of interest to some users, but @sanpii uses the mi band 1s for logging HRM.

On id107hr news, i have the screen working and ive activated the heartrate sensor and leds for 6hrs flat out and its still going. I need to process the measurements to estimate heartrate properly, turn it on/off when your wrist gets close etc. So its a long way off being release yet.

I'll post when I have a few good working examples, but please note that ive found 2 examples with different pinouts so far, so your own solution may require a little tweeking.

ashification commented 6 years ago

Hey currently working on the ID107. Trying to read data from the bluetooth on a raspberry pi. I can see and connect to the device but the uuids used for heart rate and other measurments are vendor specific and seem to produce varying length hex codes that do not change with the data. It would appear a read request is required to retrieve the info but im currently stuck on this part. Has anyone any idea or knowledge of this aspect ?

micooke commented 6 years ago

Hey ash, if you can get the hr working then I'll sort out the bt. Ive already done it using examples from sandeeps repo. Btw - are you using my repo for the id107hr?

micooke commented 6 years ago

@ashification - the UUIDs aren't actually vendor locked, they are standardised. Check out this gist i just created - it uses sandeeps BLE Peripheral library https://github.com/sandeepmistry/arduino-BLEPeripheral

This is code i wrote in August 2017, so hopefully the libraries are still compatible. I've got links and source for the UUID and GATT numbers https://gist.github.com/micooke/f54a18908f8dbc1f9b9f4dcfabf43201 (Ignore the debug pins i used, i was using the Waveshare BLE400 for development)

Also check out the following libraries which work with the ID107HR https://github.com/micooke/sparkfun_OLED, https://github.com/micooke/Kx022-1020, https://github.com/micooke/SoftwareI2C, https://github.com/micooke/SoftwareSerial. I have a local version of the (heartrate sensor) Si1143 repo I have starred, but i never got this working properly. This sensor is in every smartwatch i have rev engineered, and one thing ive never managed to do is find a good algorithm for decoupling the accelerometer (Kx022) data from the HR data (the HR data is very noisy).

ashification commented 6 years ago

Thank you so much. What do you mean in regards to getting the HR working ? If you're referring to the hardware aspect (this is my final year project) I'm only focusing on connecting to the device and reading the data from it. The bulk of the project is the data processing. The UUIDs Im referring to are 0x0AF7, 0x0AF6, 0x0AF2, 0x0AF1. They don't appear in any of the documentation I've read to date from Bluetooth SIG.

Im just currently using the bluetoothctl function with the raspberry pi to scan, pair, and connect with the device and the gatttool to observe and read the UUIDs and their data. I'll check out the links you've provided and get back to you with any progress I might make :) thanks again for your help

micooke commented 6 years ago

My apologies, those links will be useless then. The id107hr does not broadcast its heartrate data (unless there's been a firmware update I'm not aware of). The UUIDs are for communication with a phone app for uploading summary data and OTA updates, you would need to decompile the Android app to work out the protocol and procedure for getting this. If you were expecting real time HR data, you will need a sosche armband or heartrate strap.

My work was focussed on writing custom firmware for the watch using Arduino. Hence i wrote or modified existing libraries to interface to the screen, accelerometer and hr sensor. I got stuck, my target receiving watch died so i haven't finished off my work... yet.

micooke commented 6 years ago

Actually, the header files may be of use to you.

Goodluck with your project!