argrento/huami-token

Download updated firmware?

Opened this issue · 4 comments

odlg commented

Would it be possible to extend this to download new firmware for Huami devices?

Yes, I think it would be possible. At least I can not see any problems with implementing this feature.

This would be a really nice feature!

I recently acquired a Mi Band 5, and I was wondering how to update the firmware in the future (while running GadgetBridge).

Since GadgetBridge is unable to distribute the firmware, the only official way to update the device is to (re)install the Mi Fit app and (re)pair the device. But this will probably also reset the auth-key?

The unofficial way would be to download them from this topic that distributes (most likely official) firmwares for the MB5 using mega.nz, but I personally would like to download the firmware's myself to ensure they are authentic.

Having huami-token to acquire the firmware/res/font files would be a nice addition 👍.

@argrento, great that this feature is implemented 🥳 .
Very much appreciated.

Unfortunately there are 2 issues for me:

  1. The string here is missing a cast, which is causing:
ID of the device to check for updates (-1 for all of them): 0
Traceback (most recent call last):
  File "./huami_token.py", line 354, in <module>
    device.get_firmware(wearables[wearable_id])
TypeError: list indices must be integers or slices, not str
  1. What device did you use during development, my MiBand5 (it being on V1.0.1.84) clearly needs an update but unfortunately the script seems to suggest otherwise (I printed some of the variables to see what is being send/received):
ID of the device to check for updates (-1 for all of them): -1
Be extremely careful with downloaded files!

Checking for device 0...
{'productionSource': '257', 'deviceSource': '59', 'fontVersion': '0', 'fontFlag': '0', 'appVersion': '5.9.2-play_100355', 'firmwareVersion': 'V1.0.1.84', 'hardwareVersion': 'V0.44.18.2', 'support8Bytes': 'true'}
<Response [200]>
{'deviceType': 'ALL', 'deviceSource': 59, 'ignore': False}
No updates found!

The 5.9.2-play_100355 number seems to suggest the Zepp app and not Mi Fit. Or Am I incorrectly assuming this should work on the Mi Bands?

  1. Forgot to test that case. Fixed it.
  2. I'll do some more tests with my Mi Band 5.

Zepp can work correctly with Mi Band (checked by myself). I'll try to figure out with my Mi Band 5, what's the problem.

Thanks!