Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1 Unsupported operand types from the fit file of TomTom #47

Open
xjack913 opened this issue Mar 23, 2018 · 11 comments
Open

v3.1 Unsupported operand types from the fit file of TomTom #47

xjack913 opened this issue Mar 23, 2018 · 11 comments
Assignees

Comments

@xjack913
Copy link

xjack913 commented Mar 23, 2018

I just updated the version to v3.1 and there is an error of "Unsupported operand types"
in /home/ubuntu/workspace/vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php at line 1446 from TomTom user.

Could you please fix this or What should I do? Thank you.

run-20180322T212609.fit.TXT

@xjack913 xjack913 changed the title v3.1 Unsupported operand types from the fit file from TomTom v3.1 Unsupported operand types from the fit file of TomTom Mar 23, 2018
@adriangibbons
Copy link
Owner

Hi @xjack913 - see issue #45. Could you let me know if that works for you?

I have started working on a fix. The commits are in the master branch but ahead of the latest release. I'll up-version once we know that the issue is addressed.

@adriangibbons adriangibbons self-assigned this Apr 2, 2018
@xjack913
Copy link
Author

xjack913 commented Apr 3, 2018

Hi, @adriangibbons I tried inserting the code issue #45 mentioned at line 2703, but it doesn't work.

I find out that the field_name "start_time" of each message_name "lap" of fit files from TomTom users is an array, not a timestamp. Therefore, when do add or sub operator to "this array" at line 1446 or 1493, it shows a Fatal Error Unsupported operand types.

Any suggestions? Thanks.

@adriangibbons
Copy link
Owner

Hi @xjack913 do you still get this issue now in v3.2?

@xjack913
Copy link
Author

xjack913 commented Apr 24, 2018

Thanks, these fit files from TomTom users work fine in v3.2.

But a file show another issue, Division by zero in /home/ubuntu/workspace/vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1962

$this->data_mesgs[$message][$field] = round(60 / 3.6 / $this->data_mesgs[$message][$field], 3);

610464.fit.txt

PS: It looks like this file was crashed.

@adriangibbons
Copy link
Owner

adriangibbons commented Apr 24, 2018 via email

@xjack913
Copy link
Author

xjack913 commented Jul 5, 2018

Hi, @adriangibbons ,

Recently, I got some fit files without session info, but other services like garmin connect and strava could handle these fit files as well. Could you please help me to take a look ? These fit files as below.

2775379975.fit.txt
2780451464.fit.txt
2825367441.fit.txt

Thank you very much.

@adriangibbons
Copy link
Owner

adriangibbons commented Jul 6, 2018

Hi @xjack913 - I had a look at the first file and confirm that there isn't Session information being collected in there. I'm pretty sure that session is not a mandatory field/message - in fact I think pretty much everything in the ANT FIT protocol is optional. Perhaps the Lap field/message contains the information you are looking for?

var_dump($pFFA->data_mesgs['lap']);

// Output
array(31) {
["timestamp"]=> int(1528942335)
["start_time"]=> int(1528941993)
["start_position_lat"]=> float(25.0486)
["start_position_long"]=> float(121.5494)
["end_position_lat"]=> float(25.04917)
["end_position_long"]=> float(121.54935)
["total_elapsed_time"]=> float(340.741)
["total_timer_time"]=> float(340.741)
["total_distance"]=> float(1)
["total_cycles"]=> int(508)
["time_in_hr_zone"]=> array(7) {
    [0]=> float(93.053)
    [1]=> float(248.07)
    [2]=> int(0)
    [3]=> int(0)
    [4]=> int(0)
    [5]=> int(0)
    [6]=> int(0) }
["message_index"]=> int(0)
["total_calories"]=> int(51)
["avg_speed"]=> float(10.566)
["max_speed"]=> float(10.613)
["total_ascent"]=> int(4)
["total_descent"]=> int(0)
["avg_vertical_oscillation"]=> float(86.7)
["avg_stance_time_percent"]=> float(34.15)
["avg_stance_time"]=> float(228.7)
["event"]=> int(9)
["event_type"]=> int(1)
["avg_heart_rate"]=> int(154)
["max_heart_rate"]=> int(160)
["avg_cadence"]=> int(89)
["max_cadence"]=> int(91)
["lap_trigger"]=> int(2)
["sport"]=> int(1)
["sub_sport"]=> int(0)
["avg_fractional_cadence"]=> float(0.578125)
["max_fractional_cadence"]=> float(0.5) }

@xjack913
Copy link
Author

xjack913 commented Jul 6, 2018

Hi, @adriangibbons ,

I did try to collect what I need from the lap field, but all results show that all information including distance, total_timer_tiime, avg_speed.. etc are different with those shown at other services.

For example, the timer time filed of first file is 340.741 secs as you shown, but it is 1768 secs by Strava or Garmin connect which matched the user feedback. Thanks.

@adriangibbons
Copy link
Owner

Can you make the Garmin Connect activity public and share the URL to the webpage? I get elapsed time of 340.741 in the lap field but when I compare max and min timestamps I get a different duration again!

echo (max($pFFA->data_mesgs['record']['timestamp']) - min($pFFA->data_mesgs['record']['timestamp']));
// Output
635

@xjack913
Copy link
Author

xjack913 commented Jul 12, 2018

@xjack913
Copy link
Author

Hi, @adriangibbons

These are other examples without session info and detail info differ with the same file uploaded to garmin connect.

2764794397.fit.txt
https://connectus.garmin.cn/modern/activity/2827424537

2780451464.fit.txt
https://connectus.garmin.cn/modern/activity/2844876841

2876706991.fit.txt
https://connectus.garmin.cn/modern/activity/3298526012

Could you please help to fix these files as other services? Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants