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

FatalErrorException: Unsupported operand types #45

Open
robthompsonweb opened this issue Feb 13, 2018 · 5 comments
Open

FatalErrorException: Unsupported operand types #45

robthompsonweb opened this issue Feb 13, 2018 · 5 comments
Assignees

Comments

@robthompsonweb
Copy link

robthompsonweb commented Feb 13, 2018

Getting the following error when using the attached FIT file with HR:
_(1/1) FatalErrorExceptionUnsupported operand types
in phpFITFileAnalysis.php (line 2713)

Using the latest master version - looks like $last_event_timestamp is an array of 2 elements rather than the expected integer but not sure how you match the correct version to use..

error3.txt
Tried uploading to garmin connect and FIT file is working ok.

@adriangibbons adriangibbons self-assigned this Feb 14, 2018
@adriangibbons
Copy link
Owner

Will take a quick look now but I think the wife is expecting some of my attention, given what day it is :)

Might be the weekend before I get to take a proper look...

Is the FIT file recorded with a different device? Cheers

@robthompsonweb
Copy link
Author

robthompsonweb commented Feb 14, 2018 via email

@adriangibbons
Copy link
Owner

The Garmin Connect page can't be viewed any longer.

Try inserting the following at line 2703

// Manually scale timestamps (i.e. divide by 1024)
$last_event_timestamp = $this->data_mesgs['hr']['event_timestamp'];
if (is_array($last_event_timestamp)) {
    $last_event_timestamp = $last_event_timestamp[0];
}

You might need to try $last_event_timestamp[1] if heart rate isn't working.

If this works then I'll commit the change to the project. Cheers, Adrian.

@adriangibbons
Copy link
Owner

Hey @robthompsonweb - do thing now work as expected for the file(s) throwing the error?

Cheers, Adrian.

@robthompsonweb
Copy link
Author

Yes so I did try it with [0] and [1] (not sure what data this is) which removes the error but only seems to give HR for half the activity (but garmin connect displays it for the whole activity).

Looking at the field record->heart_rate the last timestamp is 1518258007 - which is only about 1/3 through the activity (record->timestamp[988] out out of 3424)
Json export of the data from the fit file in the original post.

The field hr->event_timestamp is a array with 2 elements which could have something to do with it (its only parsing the first event??) - looking at another file with HR hr->event_timestamp is a timestamp not array (attached
single_event_hr_fit.txt
).

Will try digging a bit to see if I can figure out why when got a second

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