yashsingh1/xdaforums huggingface dataset:
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I quickly tried the logging, from the chart the HR looks fine, but there's no way of exporting the HR log, am I right?

May I suggest exporting in the tcx format? It's very similar to the gpx.

Here's a short sample from one of my track:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<TrainingCenterDatabase
xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd">
<Activities>
<Activity Sport="Biking">
<Id>2012-04-11T16:49:15Z</Id>
<Lap StartTime="2012-04-11T16:49:15Z">
<Track>
<Trackpoint>
<Time>2012-04-11T16:49:15Z</Time>
<Position>
<LatitudeDegrees>45.504472</LatitudeDegrees>
<LongitudeDegrees>10.212874</LongitudeDegrees>
</Position>
<AltitudeMeters>150.078</AltitudeMeters>
<HeartRateBpm><Value>118</Value></HeartRateBpm>
</Trackpoint>
<Trackpoint>
<Time>2012-04-11T16:49:16Z</Time>
<Position>
<LatitudeDegrees>45.504475</LatitudeDegrees>
<LongitudeDegrees>10.212877</LongitudeDegrees>
</Position>
<AltitudeMeters>150.010</AltitudeMeters>
<HeartRateBpm><Value>120</Value></HeartRateBpm>
</Trackpoint>
</Track>
</Lap>
</Activity>
</Activities>
</TrainingCenterDatabase>

Fabrizio

P.S. If I remember correctly from the last year, there was a 4096 point limit in the gcc to gpx conversion, to overcame this limitation I created the gcc2gpx desktop app (that also features batch conversion), it's this limitation still present or you removed it?

I'm asking this because the desktop app doesn'work if there are waypoints in the track (it was based on an old conversion routine), so if the limitation is still present I would like to update the desktop app.

Since the souce code on googlecode aren't up to date, I would like to ask you the up to date conversion routine sources and, if you decide to use the tcx format for the hr logging, I would like that sources too, thanks!
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

I have awaited the question of export with fear. To make this (the right way) I have to change the .gcc format to include the heart rate. And this is really a big step which needs a second and third thought and introduces incompatibilities and needs code to support 2 formats to be backward compatible. It also affects gcc2gpx - the limit of 4096 points exists further. BTW: I changed gcc2gpx a little to remove your limititation of 40000 completely (only avilable RAM limits). I thought I uploaded it to googlecode, but it isn't there ~:|. I will update it too, if it is clear how to deal with heart rate.

In first step I can make a TCX export button without the need of changing .gcc format. The limitations will be:

- max 4096 Points (if the track is more, every 2nd point will be deleted) -> for heart rate should be enough. You can't use gcc2gpx to overcome this, because heart rate data isn't in .gcc.

- the heart rate data is only available until you start a new track or exit GCC (otherwise it is lost) -> export in time.

Logging without GPS - previously meaningless, but will have a look.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I understand what your fear, may I suggest a quick and dirty (but not too dirty) solution?

You could generate a second log file for only the HR data (maybe same name, different extension) this way the LoadGcc function would remain untouched.

This way you'll have only to check if the file is present and then load the HR data (or to export the gps+HR data).

I'm suggesting this approach not only because I really don't like the 4096 points limitation (I agree that for the HR it's not a problem at all, but this limitation would be present in the gps data as well), but also because this way the HR data could be easily deleted (ie if the data is erratic) without affecting the gps log.

Also this way the logging with the gps off would be easy to implement, you'll have only to generate the HR file and not the .gcc file.

Anyway whichever solution you chose I won't complain:p, I'm really thankful for your great work!

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

your suggestion is really good. Also because I think not much users will use heart rate (at least if they have to place a wire direct on the belt).

I have also thought about an other solution, where the heart rate is included in the current .gcc format (with minor extension) as special record. This would double the size of gcc file when logging hr every second. If you need hr only every 10s the size will be 10% more but it's not so straight forward and I think size on flash disk is nowadays not the point.

I think I will go this way...

Is there rally no common usage of heart rate in GPX files?

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I think doubling the gcc file size is definetly not an issue.

For the gpx... for what I understand there's not a standard implementation, but there's a way: an old garmin extension supported by sporttracks and other sw.

Here's a sample stripped down to have only the necessary fields:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gpx creator="GPSCycleComputer"
xmlns:st="urn:uuid:D0EB2ED5-49B6-44e3-B13C-CF15BE7DD7DD" version="1.1"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<trk>
<number>1</number>
<name>08/04/2012 15:26:07</name>
<desc><![CDATA[18,46 km 00:50:46 ex stop 0,0 21,8 31,0 km/h battery 54% 1h15m left]]></desc>
<trkseg>
<trkpt lat="45.5475921631" lon="10.2260417938">
<ele>154</ele>
<time>2012-04-12T12:17:43Z</time>
<speed>6.6</speed>
</trkpt>
</trkseg>
</trk>
<extensions>
<st:activity id="1" dataSource=" " created="" useGPSData="true" startTime="" hasStartTime="true" distanceEntered="" timeEntered="" calories="" location="" notes="" intensity="0" weather="">
<st:category id="1" name="" />
<st:heartRateTrack>
<st:heartRate time="2012-04-12T12:17:43Z" bpm="109" />
</st:heartRateTrack>
</st:activity>
</extensions>
</gpx>

It's basically a standard gpx, but with a slightly different header, also the "<number>1</number>" is necessary (but I don't know why).

Fabrizio
[Touch Diamond, MDA Compact IV General] ArmaBene:
Could you confirm that simply a 0.5mH inductor connected to the 1st pin (the one next to the oblique side) and to the 5th pin - both on bottom (shorter) side of the HTC Diamond USB socket - should work?

Thank you

Armando
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Armando,

yes, but pin 4 (headset sense) must be connected to the pin 5 (audio ground).

If I where you, I whould add a small capacitor in

series

to the inductor (radial inductor, not toroidal), for a 0.5mH a 1uF capacitor is ok. It doesn't matter if you are unsure about the inductor value, because the capacity/inductance value are not critical as long if you keep the inductor very close to the transmitter (the center of the belt).

Btw, I'm using a very small (11x7x7mm) 1mH, low resistance (3ohm) inductor:

http://eu.mouser.com/Search/ProductDetail.aspx?qs=pMGLqIuQiKKlkc3lnbNGeg==

(I found it in a broken power supply)

I can't guarantee that a 0.5mH inductor will work as well, but there's no reason why it shouldn't... as I said before, the inductance value isn't critical if you keep the inductor close to the belt.

However if you have to buy one, I suggest you to go in a local store and buy a 1mH inductor, the lower the DC resistance the better, also you should pay attention to the size, a bigger one would be difficult to keep near the belt.

With a 1mH inductor you can use a 0.5uF capacitor in series, given the small size of the capacitor, you could put it into the usb connector.

Once you have soldered the inductor to the wire (I used a very thin audio cable), I suggest you to seal it with silicone to protect it from sweat.

If instead you want to read the belt from 0.5m, you need at least a 5mH inductor, with a 0.1uF capacitor, but you also need to keep the phone in a "fixed" position respect to the belt in order to keep the inductor axis parallel to the belt.
[Touch Diamond, MDA Compact IV General] ArmaBene:
In the attempt of inserting the wire (the same one used for the coil - really small and insulated) between the pin and the case of the plug to keep it fixed by fitting the plug into the socket I just damaged one of the plug pins. :mad:

Now I'd like to find an HTC ExtUSB Breakout plug at reasonable price to do a good work...

I used the AC-Y300 plug for the first attempt.

A better idea would have been to open directly the adapter with no prior trials...

Now by using the AC-Y300 adapter, mic line is no more available.

I could try to open the USB cable plug (on the Diamond side) to directly solder the wire inside the plug. Anyway I'm not sure it's possible to open the plug...

How did you do?

Thanks

Armando
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi, what's the AC-Y300 plug?

Anyhow, I simply bought this:

http://www.ebay.it/itm/HTC-ADATTATO...t=Accessori_per_Cellulari&hash=item4844bca111

(I hope ebay links are not forbidden on this forum)

Inside there are all the pins (but only 3 are used for the audio out), the connector is really easy to open (and then reclose), I simply unsoldered the audio out and soldered my wire.

If, for some reason, only the audio out pins are present, you can easly pull them out with pliers and put them in the right position.

Fabrizio
[Touch Diamond, MDA Compact IV General] ArmaBene:
Another one of my mistakes :D

I meant YC-A300...

Since I've a spare HTC headphone maybe I'll simply replace the mic by the cap coil series... I already found that it's really simple to open the mic case.

But now I'm pretty sure a good idea would be to go to sleep for the next few hours to avoid to make other mistakes :D

Thanks for your suggestions :)

Armando
[Touch Diamond, MDA Compact IV General] Blaustein:
Hello,

a few thoughts from my side to the inductor to receive the heart beat pulses.

If you use an industrial inductor, choose one with a big stray field. You rather want an antenna than an inductor. Usually a "good" inductor has a small stray field.

I beleive the inductance value is not as important as the number of turns and the area.

I have quite good experience with an air coil with 50 turns 0.3mm copper wire on a diameter of 30mm (it may be oversized if you place the coil direct on the sender).

Due to the high impedance of the microphone input a series capacitor is IMHO useless. A capacitor in parallel has some effect, but is not essential. A 3.3uF capacitor in parallel to my coil showed 4 times higher signal and should have some filter effect to be more robust against unwanted signals.

Klaus

---------- Post added at 09:42 PM ---------- Previous post was at 09:40 PM ----------

Fabrizio,

your GPX example would be much more meaningful if you had included at least 2 points.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

here is the gpx with 2 points:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gpx creator="GPSCycleComputer"
xmlns:st="urn:uuid:D0EB2ED5-49B6-44e3-B13C-CF15BE7DD7DD" version="1.1"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<trk>
<number>1</number>
<name>08/04/2012 15:26:07</name>
<desc><![CDATA[18,46 km 00:50:46 ex stop 0,0 21,8 31,0 km/h battery 54% 1h15m left]]></desc>
<trkseg>
<trkpt lat="45.5475921631" lon="10.2260417938">
<ele>154</ele>
<time>2012-04-12T12:17:43Z</time>
<speed>6.6</speed>
</trkpt>
<trkpt lat="45.5475921635" lon="10.2260417940">
<ele>155</ele>
<time>2012-04-12T12:17:44Z</time>
<speed>0.0</speed>
</trkpt>
</trkseg>
</trk>
<extensions>
<st:activity id="1" dataSource=" " created="" useGPSData="true" startTime="" hasStartTime="true" distanceEntered="" timeEntered="" calories="" location="" notes="" intensity="0" weather="">
<st:category id="1" name="" />
<st:heartRateTrack>
<st:heartRate time="2012-04-12T12:17:43Z" bpm="109" />
<st:heartRate time="2012-04-12T12:17:44Z" bpm="108" />
</st:heartRateTrack>
</st:activity>
</extensions>
</gpx>

For the inductor, from what I saw on my tests, the series capacitor helped a lot cutting the low frequency noise on the signal, but all my tests were on the pc, I don't know if the impedance on the phone is different, I'll make some test with the parallel capacitor, thanks.

Btw, I want to clarify for all the people interested in keeping the inductor near the belt, that "every" inductor will work, with or without the capacitor.

Fabrizio
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

any news on the HR logging function?

Thanks,

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
new beta version 4.9beta8

Hi Fabrizio,

I am very busy in my job and have only limited time for GCC.

Attached a new beta with logging and GPX export for heart rate. I have choosen a garmin extension to include the hr in GPX, because it keeps the hr data in the trackpoint. Moreover I have found no further information for your example.

I had to go to GPX version 1.1 to support the extension. Unfortunately version 1.1 doesn't support speed anymore, so I have removed it (using gcc2gpx you can include speed nevertheless).

If heart rate is on and gps is off you can log heart rate alone.

The time in GPX export is now UTC time, as required by GPX specification.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

thank you!
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I've noticed that if I recieve/make a phone call (on my diamond), while gcc is showing the HR (of course with the antenna disconnected), my voice isn't heard.

(The same thing happens if I use an audio recording app while I make a phone call) .

Probably there's no way to solve directly this, but with your current implementation, in order to make a phone call while gcc is running, I have to stop the logging and close gcc (maybe is just enough stopping the logging and then disabling the hr visualization, I haven't tried).

A simple workaround would be to only show (and log) the HR while the logging is ON, this way I'll just have to pause the logging to make a phone call.

Thank you.

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

I think it should be enough if you just disable the hr function with context menu in speed field. This can be done even while logging.

If it doesn't help, I can try to explizitely close the wave device (currently I only destroy the object). For better usability I could toggle the enable/disable with double click in speed field.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I tried disabling the hr function with the context menu while logging and also with the logging stopped, but still no audio. Only closing gcc solves the problem. (I'm guessing it means that only closing the wave device gives back the mic input to the pone?)

The double click is a good idea!

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

please test the attached exe (unzip and copy to your device in the gcc directory).

It now closes the wave device explizitely.

It can last very long if I let this do the destructor of the object (called by the garbage collector) - maybe even not until application closure.

Anyway it should be possible to have more than one application listening to the microphone. On my desktop PC I use an audio recorder app and an emulator with gcc which loggs hr at the same time. Maybe Windows mobile is limited to one app.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

now works perfectly.

Fabrizio
[Touch Diamond, MDA Compact IV General] low.flying.pigs:
Hello Blaustein / Klaus,

I have a few questions regarding speed as displayed on the main screen:

Two methods of speed measurement are available, 'from gps' or 'from position'

Which is used for overall average speed and max speed data?

Which is the more accurate for current speed?

Would an option to display the current average of both measurements be more accurate than either on thier own?

low.flying.pigs
[Touch Diamond, MDA Compact IV General] Blaustein:
Hello lfp,

"from gps" is delivered from your gps receiver. "from position" is calculated in GCC from the position change. Accuracy depends on ....

Overal average speed is calculated from track distance and track time (incl or excl stops).

Max speed is taken from the selected speed source.

Average of both, I think is not much useful. You can increase the average setting to smothen the values (also speed).

Speed from position is an experimental feature especially for those cases when the internal speed calculation in the gps receiver deliveres no good results.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I accidentally deleted a gcc file and I have no backup, I tried to recover it from the diamond internal memory with a file recovery program, but the file is corrupted, I think only slightly because the gcctogpx gives an error and then generates a gpx file with odd date/time fields and no HR.

Can you look at it and see if it can be saved?

Many thanks

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

don't do this again. I would like to spent my time more useful.

I have deleted big parts of the file which didn't look like valid gcc records. There were also big parts which looked like gcc records but included no heart rate. I deleted them too. Perhaps they were form older deleted files. The result looks very plausible to me.

Attached gcc and gpx files and also the new format description with heart rate.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

thank you very much, sorry if it was time consuming, I won't ask again.:)

---------- Post added at 10:06 AM ---------- Previous post was at 09:27 AM ----------

Hi again,

I just did some testing and it turns out that gcc stops logging (I think it stops reading) the HR if I press the power button, while the gps logging works flawlessly.

It's not a big problem because I just have to remember to press the blacklight off button instead of the power off button, but I wanted to let you know.

Thank you again

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

it's ok. I like to help wherever I can. But be careful next time when deleting files you may need in future.

Did you use the power button on your deleted track, and therefore it missed in the middle the hr?

Please test the attached exe when using power button. Also in heart rate only mode.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

thanks again for the help, I'll be more careful :)

Yes, I used the pause button and therefore missed the HR on the track, I'll test the exe as soon as possible, thanks!

Fabrizio

---------- Post added at 08:00 PM ---------- Previous post was at 07:33 PM ----------

Hi Klaus,

I tested the exe, bad news:

at first it works, but if i use the power button (it doesn't metter if I'm logging or not) when the diamond wakes up the HR is stuck to the last value (the last before I turn of the phone), and the HR quality slowly drops to 0 in a few seconds, then there's no way of making it work again, even restarting gcc doesn't work, only a soft reset solve the problem.

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

you mean even much worser than before? :-(

On my ASUS phone it works. And it is similar to the gps.

Did you really exit gcc before restarting?

Please test again attached exe.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

same as before, after I use the powerbutton gcc is no longer capable of reading the HR (the signal quality drops to 0), exit gcc and reopening doesn't solve the problem, only soft reset solves.

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

last try with another exe.

Did you exit gcc with the exit button on menu page?

If you have visual studio, there is a tool "Remote Registry editor". You could connect with your device and go to the "windows mobile x.x pocket PC device" and there to the key:

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power]

and export this key in a file and send it to me.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

great news, this exe works perfectly, I'll test it thoroughly tomorrow, but it's logging ok using the power button. Can I ask what was the problem/difference between my phone and yours?

Yes, I allways exit gcc using the exit button on the menu page, here's the reg key you requested ( I didn't use visual studio, I used a dedicated app I had on the phone, I hope it's the same).

Thanks a lot.

Fabrizio
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I tested the exe you provided, for about 2 hours everytink was ok, but then it stopped reading the HR (there's the same value for about 15 min: 136 bpm, signal quality: 0) as soon as I noticed it (I keep the pone on the pocket, so I didn't notice immediately) I tried exiting gcc (from the menu page) and restarting it, but the HR was 0 and the signal quality 0. So I did a soft reset and restarted the log with no problem for another hour.

Here's the gcc file for the first 2 hours.

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

on the function to keep devices powered there is a flag (POWER_FORCE) which means that the device keeps powered even in suspend mode. The wave device of your phone seems to missunderstand this flag and doesn't work at all. The flag is not necessary because the phone goes only in unattended mode.

Your reg file is as expected.

It seems that your wave device delivers no more data after 2h. I didn't test it that long. Are there any error logs in gpscyclecomputer.log?

If this error persists, I can try to close and reopen the wave device. Please observe.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

there's no error in the log, I'll test again after the weekend and I'll tell you if the error persist.

Fabrizio
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Fabrizio,

if the hr got stuck, please try first to disable hr and enable it again (by double click).

In a further test (if the error persists) you could preventive disable and reenable hr on a regular basis (e.g. once every 30min) to see if this could solve the problem.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

I tested it today for more than 2 hours and it worked without problems.

I'll test it for more hours in the next few days and I'll keep you posted.

Thanks

Fabrizio

PS last time, when the hr got stuck, I tried disabling and then enabling the HR by doubleclick, but the only way to solve was to softreset the phone.
[Touch Diamond, MDA Compact IV General] giasone73:
polar

Hi,

what do you think about this bluethoot polar hr belt? Is it possible to connect with gcc?

http://iafstore.com/scheda.asp?num=15164&pa=p

It should be very simple to connect with every type of pda and mobile.

regards

Alfredo
[Touch Diamond, MDA Compact IV General] Blaustein:
Hi Alfredo,

if you can provide me the necessary informations of the data format, I will support it.

I have alredy tried to find some informations - without success.

Maybe it isn't that difficult. If you can connect the polar wearlink to a (virtual) serial com port and analyze the data to get the hr, feel free to provide me the informations.

Klaus
[Touch Diamond, MDA Compact IV General] fabrylama:
Hi Klaus,

could you add an option that closes the wave device when a phone call is in progress, and then reopen it after the call?

Now if I recieve a phone call while logging the HR, I must dismiss the call, toggle the HR by doubleclick and then call.

Thanks

Fabrizio