openambitproject / openambit

openambit
281 stars 82 forks source link

Stryd power not captured in Movescount #196

Closed sean-chester closed 6 years ago

sean-chester commented 6 years ago

The Stryd footpod computes a value they refer to as "power" for running that easily synchronises with the Ambit3 and Spartan models. When using the MovesLink app, this value is transferred to Movescount and rendered as the default graph. However, OpenAmbit does not transfer this data.

I suppose it is easy enough to add, but I don't know the field names for "power", either on the device or the Movescount JSON format.

centic9 commented 6 years ago

I think it would be good if you can provide some XML/JSON-files from the Suunto Movescount download app from activities where it was activated, so people can take a closer look how such information is included in the downloaded files.

Additionally a wireshark log would provide full details of the protocol with the Suunto server, however that is probably a bit harder to retrieve.

sean-chester commented 6 years ago

Ah, so that's how you determine the fields to write to! :smile:

Here's a snippet from one of the xml files where power was included. Evidently, the value is written to the BikePower field. I'll look later into providing a wireshark log, if necessary, but perhaps it's already clear how to add this information to a run activity?

            <Sample>
                <VerticalSpeed>0.13</VerticalSpeed>
                <BikePower>428</BikePower>
                <Cadence>2.8500000000000001</Cadence>
                <RelativePerformanceLevel>1.00</RelativePerformanceLevel>
                <EnergyConsumption>1632.8519999999999</EnergyConsumption>
                <Temperature>287.34999999999997</Temperature>
                <AbsPressure>103100</AbsPressure>
                <SeaLevelPressure>103420</SeaLevelPressure>
                <Altitude>24</Altitude>
                <Distance>7085</Distance>
                <Speed>4.7599999999999998</Speed>
                <Time>2447.5929999999998</Time>
                <SampleType>periodic</SampleType>
                <UTC>2018-06-27T07:52:56.593Z</UTC>
            </Sample>
            <Sample>
                <NumberOfSatellites>12</NumberOfSatellites>
                <Latitude>1.1072211852098979</Latitude>
                <Longitude>0.18276110891569353</Longitude>
                <EHPE>8</EHPE>
                <Time>2448.0299999999997</Time>
                <UTC>2018-06-27T07:52:58Z</UTC>
                <SampleType>gps-small</SampleType>
            </Sample>
sean-chester commented 6 years ago

It seems that the data is read correctly by OpenAmbit: here's a snippet from a log file in my home directory for the same sample from the same log:

            <Sample>
                <Type id="512">periodic</Type>
                <UTC>2018-06-27T07:52:56.593Z</UTC>
                <Time>2447593</Time>
                <VerticalSpeed>13</VerticalSpeed>
                <BikePower>428</BikePower>
                <Cadence>171</Cadence>
                <EnergyConsumption>234</EnergyConsumption>
                <Temperature>142</Temperature>
                <AbsPressure>10310</AbsPressure>
                <SeaLevelPressure>10342</SeaLevelPressure>
                <Altitude>24</Altitude>
                <Distance>7085</Distance>
                <Speed>476</Speed>
            </Sample>
            <Sample>
                <Type id="784">gps-small</Type>
                <UTC>2018-06-27T07:52:57.030Z</UTC>
                <Time>2448030</Time>
                <Latitude>634391009</Latitude>
                <Longitude>104714402</Longitude>
                <EHPE>800</EHPE>
                <NumberOfSatellites>12</NumberOfSatellites>
            </Sample>

But for some reason, the power data does not appear in Movescount when the data originates from OpenAmbit, only when it originates from Moveslink2.

gustavo-iniguez-goya commented 6 years ago

It looks like it's the same problem described here: https://github.com/openambitproject/openambit/issues/187

sean-chester commented 6 years ago

Adding the following corrects the .log cadence source (showing as empty), but that doesn't ultimately address the problem. (I had speculated that the key difference between the Moveslink and OpenAmbit exports was the indication of a "PowerPod".)

static sample_cadence_source_name_t sampleCadenceSourceNames[] = {
    { 0x20, "PowerPod" },
    { 0x40, "Wrist" },
    { 0, "" }
};

in place of:

static sample_cadence_source_name_t sampleCadenceSourceNames[] = {
    { 0x40, "Wrist" },
    { 0, "" }
};
sean-chester commented 6 years ago

Closed because duplicate of issue #187

gustavo-iniguez-goya commented 6 years ago

Hey @sean-chester ,

Despite of being (apparently) the same problem than #187 , I think that we should add a PR for add these pods.

I've just realized that my cadence pod (wahoo cadence pod) is not recognized either:

            <Sample>
                <Type id="794">cadence-source</Type>
                <UTC>2018-07-01T08:17:53.018Z</UTC>
                <Time>135</Time>
                <CadenceSource id="1"/>
            </Sample>

Movescount app recognized it as CadencePod. So I guess adding { 0x01, "CadencePod" }, to logstore.cpp and movescountxml.cpp would be enough.

sean-chester commented 6 years ago

Sure, yep, I agree. I am going to spend some time in August to work on the power data problem (issue #187 ) and was going to add the power pod then, but there's no reason to wait, really.