Page 3 of 3

beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 28 Jan 2021, 16:52
by bigdigital.kov
The link to the project on github /bigdigital/py_amazfit_tools/tree/GTR2
Hi to all. Recenly I did some research in gtr2 watchface structure and made this tool.

Its a well known py amazfit tool but with adaptation for GTR2.
It is also has included tool which allows to compress and decompress GTR2 bin files. Before uploading bin file to your watch, you should compress it with help of this tool.

The JSON structure for GTR2 is completely different. To get the basic knowledge about the structure you can unpack any existing GTR2 dial.

How to use it.
1. Unpack existing dial with help of the GTR2_Packer.exe tool by executing

Code: Select all

GTR2_Packer.exe -unc2 WATCH_FACE_FILE.bin
2 After uncompressing, you should receive a new file with .unc extension, rename file extension back to .bin
3. Now you can parse uncompressed dial with a command

Code: Select all

python main._py --gtr2  47 --file WATCH_FACE_FILE.bin
* due to the limitation on this forum, i can't post a topic with the correct python file name, so please remove "_" char between "main." and "py" in the command above.
As a result, if everything was ok, you should receive json file.
4 Now you can modificate json file or watchface images.
5. After all the modifications are completed, you can build watchface with help of the command

Code: Select all

python main._py --gtr2 47 --file WATCH_FACE_FILE.json
* due to the limitation on this forum, i can't post a topic with the correct python file name, so please remove "_" char between "main." and "py" in the command above.
6 . Pack a new bin file with help of GTR2_Packer.exe

Code: Select all

GTR2_Packer.exe -cmp2 WATCH_FACE_FILE_packed.bin
7. Rename compressed file extension back to .bin and upload to your watch to test it

Notes .
1. The previews generation does not work for GTR2 mode.
2 .Available Commands for GTR2_Packer.exe :

Code: Select all

-cmp Compress bin (for gtr(gts) first gen)
-cmp2 Compress gtr2(gts2) bin 
-unc Decompress
-unc2 Decompress gtr2(gts2) bin
3. Image numeration on GTR2 and GTS2 starting from 0001, not from zero like it was for previous Huami devices.


Current version 0.2

Chagelog
v0.2
Added widgets.
Fixed Images loss when packing bin file

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 16 Feb 2021, 15:53
by asoo
Messef wrote: 16 Feb 2021, 15:44
Thank you for your response and the unpack.
I don't speak Russian, so I can't do much with the link to main.exe by SashaCX75.
See your PM.

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 21 Feb 2021, 13:50
by demiurg1
The problem of not displaying the "Bluetooth" sign is not current. I know that the GTR 2 only shows the "Bluetooth" out of range sign, if we use one in the watch face design.

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 24 Feb 2021, 06:55
by su8044
eliasf wrote: 04 Feb 2021, 07:39
Trying to decompile a couple of watchfaces and it results in a traceback error.
The log says:

Code: Select all

WARNING - [ParamConv:parse] currentPath 5/./2/./3/./3 / Parameter 3 isn't supported for <class 'watchFaceParser.elements.gtr2.progress.Progress'>
CRITICAL - Parameter 3 isn't supported for <class 'watchFaceParser.elements.gtr2.progress.Progress'>
Traceback (most recent call last):
Has anyone else encountered it and is there a solution?
I can provide a full log if necessary.
Same issue here with only a couple of watch faces i tried. i wanted to try the workaround you mentioned but i think the file is now called "stepsProgress. py" on the latest version and already has 3 defined so i can't figure what else it might be, im still learning.


on another note, i see some default amazfit watchfaces not only have the option to select between different info displayed on the complication, but also the ability to be used as a shortcut to the amazfit app on the watch, and some extra info such as 5 day weather and windspeed i haven't seen on other watchfaces. is this possible in the current state of the compilers or will ot be in the future?

thanks!

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 24 Feb 2021, 08:35
by eliasf
That was an issue I had with v0.1 and it was since fixed in v0.2, it had to do with the weekdays progress which is probably parameter 3.

If you are trying to decompile a wf with "hot zone" (shortcuts) like huami calls it you would get a parameter 6 error. I did that and that's what I got.

This means that the parser can still not handle how huami have set up that specific feature.

Hopefully in a newer version this will be sorted out, unfortunately you can't get much help from Huami themselves which means it's up to the tool developer to understand their internal structure and how to implement a working parser that translates properly.

One can only hope...
su8044 wrote: 24 Feb 2021, 06:55
eliasf wrote: 04 Feb 2021, 07:39
Trying to decompile a couple of watchfaces and it results in a traceback error.
The log says:

Code: Select all

WARNING - [ParamConv:parse] currentPath 5/./2/./3/./3 / Parameter 3 isn't supported for <class 'watchFaceParser.elements.gtr2.progress.Progress'>
CRITICAL - Parameter 3 isn't supported for <class 'watchFaceParser.elements.gtr2.progress.Progress'>
Traceback (most recent call last):
Has anyone else encountered it and is there a solution?
I can provide a full log if necessary.
Same issue here with only a couple of watch faces i tried. i wanted to try the workaround you mentioned but i think the file is now called "stepsProgress. py" on the latest version and already has 3 defined so i can't figure what else it might be, im still learning.


on another note, i see some default amazfit watchfaces not only have the option to select between different info displayed on the complication, but also the ability to be used as a shortcut to the amazfit app on the watch, and some extra info such as 5 day weather and windspeed i haven't seen on other watchfaces. is this possible in the current state of the compilers or will ot be in the future?

thanks!

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 26 Feb 2021, 06:54
by Fringo
It also works on ZEPP E CIRCLE not only GTR2! Thank you :)

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 11 Mar 2021, 17:05
by masterplexus
Hi all,

I'll start to try todo my own Watchfaces, and it looks like it is possible with the help of this group and tool ;) But I have one question for a special need:
Is it possible to include in a watchface also data/information, wich comes not directly from the Zepp app, or the watch itself? The background is, that I'm diabetic, and I have a measurement system wich collects blood-sugar values (with an app called xDrip). This information's I would like to provide also on the watchface. I can provide the information's in several ways (like json, as a graphic, over intents or whatever), but I'm not sure how to bring this information then into the watchface.

Is there any manual which could describe something like this? If someone could put me in a direction would be great!

Many thanks for any help!

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 24 Mar 2021, 04:50
by bird81309
want to know how to modify the display of AOD mode...想知道要怎麼修改AOD的顯示

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 11 Apr 2021, 12:58
by wolliden
I am really happy that this tool exists, and it works (unpacked existing WF). I want to change several complications, because I need sunrise/sunset time and week number to show up permanently. Is this still not possible, with Huami watches?

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 17 Jul 2021, 14:12
by CyclingAsia
Thanks for this amazing utility. Until today I was stuck as I don't have a windows machine. But today I was able to work out how to run the GTR2_Packer.exe in macOS (and likely works in Linux as well). Turns out the GTR2_Packer.exe is a java cli app that has been attached to a stub java loader, as such it can be run with java on macOS and Linux machines.

I wrote a fairly simple bash script to launch java with the appropriate arguments.

1. Edit a file called GTR2_Packer using your favourite editor (eg vim)
2. Copy and paste the following:

Code: Select all

#!/bin/sh
  
java -jar $0.exe com.thatguys.Main $*
3. Save the file in the same directory as the GTR2_Package.exe
4. Execute it as you would any other command line utility.

Note: this will likely not work as expected if there are spaces in the directory tree.

Code: Select all

mbp:py_amazfit_tools-GTR2$ ./GTR2_Packer 
Wrong usage
usage: gtr-packer
 -cmp <filename>    Compress
 -cmp2 <filename>   Compress gtr2 format
 -test <filename>   Decompress and compress file, and make sure they are
                    equal
 -unc <filename>    Decompress
 -unc2 <filename>   Decompress gtr2 format
mbp:py_amazfit_tools-GTR2$ 

-

Posted: 28 Aug 2021, 09:00
by Aaronfet
Thanks a lot for that tool I was just trying to figure out how to do a HTML5 port using Love.js games not finished yet, but I prefer to know early where I might have problems. I must have been doing something wrong because it wasnt working but thanks to your tool I wont have to waste time trying to find out what I did wrong. I was also starting to wonder if Id done something in my code that couldnt be ported, so it put my mind at ease.

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 08 Sep 2021, 17:51
by Julien
Hello bigdigital.kov we've talked over Github, it seems you worked on the GTS 2 Mini too.
Is GTR2_Packer.exe an executable version of your python script or is it a separate project? I'm confused

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 09 Sep 2021, 12:18
by bigdigital.kov
GTR2_Packer.exe is a separate project. it is required to compress/decompress existing watchface before uploading wf to the device. The GTR2/GTS2 can consume only compressed watcfaces. But it seems the GTS2 mini , do not require any compression. I guess this is because they use relatively small 16 bit images and the device screen much smaller
.

Re: beta py amazfit tool for GTR2(GTS2 also should work but not tested)

Posted: 17 Dec 2021, 11:38
by darekperlinski
Hello, with amazfit gtr 2e it's working also(not for every watchfaces)! thanks!