CTHRU / Hitrava

Convert your Huawei Health sport activities and import them in Strava.
Other
352 stars 34 forks source link

Not converting to TCX #22

Closed astonaIT closed 4 years ago

astonaIT commented 4 years ago

Hello, I think I followed the entire procedure correctly but I'm not getting any TCX file in the output folder, I can see just hitrack and json files. This is what returns script towards to end it when throws some errors, it seems something related to speed data but I saw that this issue was solved on a earlier version of the script: `2020-08-17 17:34:47,477 - ERROR - add_speed_data - One or more required data fields (k, v) missing or invalid in speed data [['k', '5'], ['v', '0.0']] unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta' 2020-08-17 17:34:47,477 - ERROR - parse - Error parsing file <./output/HiTrack_20200721_204817> at line <1> CSV data: ['tp=rs', 'k=5', 'v=0.0', ''] ('One or more required data fields (k, v) missing or invalid in speed data %s\n%s', [['k', '5'], ['v', '0.0']]) 2020-08-17 17:34:47,481 - ERROR - parse - Error parsing JSON file <./output/Motion path detail data & description/motion path detail data.json> ('Error parsing file <%s> at line <%d>\n%s', './output/HiTrack_20200721_204817', 1) Traceback (most recent call last): File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 512, in add_speed_data speed_data['t'] = self.start + dts_delta(seconds=int(speed_data.pop('k')) + 5) TypeError: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 949, in parse self.activity.add_speed_data(data_list) File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 521, in add_speed_data raise Exception('One or more required data fields (k, v) missing or invalid in speed data %s\n%s', data) Exception: ('One or more required data fields (k, v) missing or invalid in speed data %s\n%s', [['k', '5'], ['v', '0.0']])

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 1159, in parse hi_activity = self._parse_activity(activity_dict) File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 1265, in _parse_activity hi_activity = hitrack_file.parse() File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 953, in parse raise Exception('Error parsing file <%s> at line <%d>\n%s', self.hitrack_file.name, line_number) Exception: ('Error parsing file <%s> at line <%d>\n%s', './output/HiTrack_20200721_204817', 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 1948, in main() File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 1936, in main hi_activity_list = hi_json.parse(args.from_date) File "C:\Users\andre\OneDrive\Desktop\Hitrava-3.5.2\Hitrava.py", line 1171, in parse raise Exception('Error parsing JSON file <%s>', self.json_file.name) Exception: ('Error parsing JSON file <%s>', './output/Motion path detail data & description/motion path detail data.json')`

CTHRU commented 4 years ago

It's something different than #15. It looks like the program doesn't have the activity start date and timestamp when it starts parsing the speed records. Would you mind temporarily sharing the ./output/HiTrack_20200721_204817' or the corresponding JSON file in the JSON subdir? It will make it easier for me to debug. Thanks.

astonaIT commented 4 years ago

Sure thing! LINK REMOVED the two files. Thanks!

CTHRU commented 4 years ago

Ok, got them, thank you. I'll remove the link over here, you can do the same from your side if you want.

astonaIT commented 4 years ago

Just to confirm here that everything's working now. Many thanks!