polarofficial / polar-ble-sdk

Repository includes SDK and code examples. More info https://polar.com/en/developers
Other
475 stars 153 forks source link

exercise stuck on the h10 #297

Closed smyffanon closed 1 year ago

smyffanon commented 2 years ago

Hello - sorry, forgot to label this as a question

I am using the android example, and am recording my sleeping RR-intervals - readings are from 5 to 8 hours long.

A couple of times a month a reading will not be readable from the h10.

Listing the exercise works fine, and it seems the app begins reading, but does not finish, maybe there is an error in the format on the h10 - maybe a division by zero somewhere?

If I erase the exercise, then the next night it usually works fine again.

questions

  1. is there another way to pull the readings off the h10, so I can see if there's something wrong in the RR interval data
  2. will removing the battery erase the exercise? or could it be that removing the battery might fix the issue but the exercise is still there? (I doubt it)
  3. how do I set up android studio to debug this? I can connect android studio to the app on the phone, but an exception doesn't get caught as a breakpoint, so I don't know on what line of code it's throwing.

I was a programmer a long time ago but android development is pretty new to me. Although since this works 29 out of 30 days this doesn't look like an Android issue, seems like an h10 thing.

I"ll leave the exercise on my h10 for a couple of days, hoping I can debug the issue & get that reading eventually.

While it's on there, polar beat and polar sensor logger won't read heart rate - the HR stays stuck at 0.

but Polar Sensor Logger seems to be getting the ECG fine.

JOikarinen commented 2 years ago

Hi @smyffanon, thanks for the question. I understand your question and the challenges you have faced.

  1. is there another way to pull the readings off the h10, so I can see if there's something wrong in the RR interval data
    • there can be 3rd party developed apps which might do the reading of RR file from the H10 memory, but unfortunately I am not familiar with any of them. From Polar side there is the example app which you have been using already, and Polar Beat. However Polar Beat can read only exercises it has started by it self.

2. will removing the battery erase the exercise? or could it be that removing the battery might fix the issue but the exercise is still there? (I doubt it)

  • battery removal won't erase the exercise.

3. how do I set up android studio to debug this? I can connect android studio to the app on the phone, but an exception doesn't get caught as a breakpoint, so I don't know on what line of code it's throwing.

  • do you see on the Android Studio logcat screen what is the exception example is throwing? You might be right that RR file is somehow corrupted in H10 thus reading it causes exception thrown by the example application. Another possibility that something happens during the transfer of the big exercise (i.e. over the night recording in your case) from H10.
smyffanon commented 2 years ago

Thanks, finally got the logcat running - had to reinstall android studio

Is there a way to keep my h10 turned on and transmitting while it is off my body?

I was ready to connect the 2 terminals with a wire and leave the thing running with a spare phone and android studio running on my desktop but I found no source saying that's safe for my h10.

It has been transmitting now over an hour and I have no idea when it will finish. If the exception is thrown at the 28,999th sample I may be here a long, long time.

There are sometimes 29,000 samples in my overnight recording, and the logcat is processing 2 per second

JOikarinen commented 2 years ago

Hi @smyffanon, sorry for long delay with respond.

Is there a way to keep my h10 turned on and transmitting while it is off my body?

  • by this question you mean this scenario:
  1. You have done overnight offline recording, the data is saved to H10 memory
  2. While reading out the recording from H10 memory you wear off the H10 -> and your question is will H10 keep on while reading out, even though the read out may take long
smyffanon commented 2 years ago

(EDITED - realized I didn't explicity answer your question)

While reading out the recording from H10 memory you wear off the H10 -> and your question is will H10 keep on while reading out

Exactly, I'd like to leave my h10 connected over bluetooth to a spare phone next to my computer running logcat and wait for the error to happen.

I know one can leave the h10 connected while it is off the body & strap - this is an instruction I found somewhere, probably the manual, on how to discharge an h10 after the battery is removed - I assume there must be some capacitors on there and they need a bit of discharging.

The instruction is to moisten 2 fingers and kept the fingers touching the contact tabs. The h10 will keep the bluetooth power on and will drain any charge left on the device.

I was thinking of placing some wet cotton on the two contact points and weighting these down with a bit of wood.

The issues would be

  1. this would not make a completed circuit, which the 2 wet fingers technique does, so this may not work if a complete circuit is needed
  2. are there any issues of damaging my h10 if I keep it in this state for a long time artificially?

If a complete circuit is needed and it is safe to do so, could one even wrap one wire around the 2 tabs/terminals?

JOikarinen commented 1 year ago

Hi @smyffanon ,

The release 3.3.4 speeds up the internal recording reading significantly. I hope that will slightly help you on this.