ga2mer / ha-zepp

Home Assistant companion for Zepp OS devices
77 stars 18 forks source link

`Download failed, error` when scanning QR code #22

Closed ihrapsa closed 8 months ago

ihrapsa commented 8 months ago

I managed to get the mi band 7 NFC into a modified Zepp app (v7.0.1 - only this version allowed me), I've built the app for mi-band7 with zeus cli, I got the QR code, but when I try to scan the code with the phone I get this error prompt:

Download failed, error
code: null

I've tried installing other apps (Toolbox) by QR code and that works.

Any idea what's wrong? Thanks!

BramNH commented 8 months ago

The error was also shown here. In the app.json file, only "mi-band7" is specified with deviceSource 262. The mi band 7 NFC is definitely another model, I will try to find the device source for this specific one, if it exists.

BramNH commented 8 months ago

In app.json replace the platforms section of mi-band7 with this:

"platforms": [
        {
          "name": "amazfit-band7-nfc",
          "deviceSource": 252
        },
        {
          "name": "amazfit-band7",
          "deviceSource": 253
        },
        {
          "name": "amazfit-band7-w",
          "deviceSource": 254
        },
        {
          "name": "l66",
          "deviceSource": 260
        },
        {
          "name": "l66w",
          "deviceSource": 261
        },
        {
          "name": "l66_1",
          "deviceSource": 262
        },
        {
          "name": "l66w_2",
          "deviceSource": 263
        },
        {
          "name": "l66_3",
          "deviceSource": 264
        },
        {
          "name": "l66_4",
          "deviceSource": 265
        },
        {
          "name": "l66_5",
          "deviceSource": 266
        }
      ],

I got it from here

ihrapsa commented 8 months ago

That fixed the download issue 🥳 . However, the Home Assistant app is hanging on Loading while in the Settings of the App from Zepp is saying Watch disconnected. Connect to watch and try again

I've also noticed something weird: After the app appears under Mini Program section, if I exit that page and then return the installed app disappears. 😵‍💫

Any recommendations on what modified version to use? Using 7.01 currently from here that I found in comment section from here

When generating the QR code for pairing I've tried lots of combinations of pnpNumer and pnpVersion numbers but only 259 worked and paired the band:

https://api-watch.huami.com/forwarding/watchUS?macAddress=DEADBEEFDEAD&pnpNumber=117&pnpVersion=259

According to 4pda forum 259 corresponds to global version although I have the global NFC one (257):

- 256 - for the Chinese NFC version
- 257 - for the global NFC version
- 258 - for the Chinese version
- 259 - for the global version
- 261 - for the European version
BramNH commented 8 months ago

You can try version 7.7.5. I will maybe look later into the version numbers for the mi-band7. I switched to the Amazfit Band 7 myself, since it has official support for ZeppOS development 😄

ihrapsa commented 8 months ago

With the 7.7.5 version the pairing process goes ok, but no devices is added under My devices so I can't reach developper mode section. 🤦🏼‍♂️

BramNH commented 8 months ago

Make sure that everything is installed clean, restart your bluetooth/phone and I can recall that you should not be logged in with a 3rd party account (Google etc) in the Zepp app.

ihrapsa commented 8 months ago

I've tried different android devices and I'm using a Zepp account, no third party.

BramNH commented 8 months ago

Sorry, then I don't know. Version 7.7.5 worked for my Mi-band7 european model with deviceSource: 262. I would suggest to keep trying on that version, but it might be that the apk is only rebuild to support the 262 model. Maybe you can figure out how to build the apk yourself (there is a guide somewhere). Maybe this one works?

ihrapsa commented 8 months ago

Everything works as expected now 😍

I used the Zepp 8.4.3 - All in One.apk, paired the band with the same QR that worked on previous app versions with pnpNumber=117 and pnpVersion=259. During pairing app said Welcome to Amazfit Band 7 but then changed to Xiaomi Mi Band 7 NFC. Scanning the Zeus CLI QR code installs the app on the band, Settings work and the App is persistent. Enabled entities appear on the band and work as expected. Thank you very much sir 🙏🏼 !!

I think we can close this one.