Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

404 Error after logged by XIaomi Account #55

Open
Zxis233 opened this issue Jan 7, 2022 · 6 comments
Open

404 Error after logged by XIaomi Account #55

Zxis233 opened this issue Jan 7, 2022 · 6 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Zxis233
Copy link

Zxis233 commented Jan 7, 2022

I bond the Miband 6 with Mi Fit. But after I clicked the link and logging, the return code was 404 and it said that routes not found. Could you help me? I've reset the band and reconnected it with Mi Fit several times, but it didn't work.

@argrento
Copy link
Owner

Does this error shown after you log in?

@argrento argrento added the question Further information is requested label Jan 10, 2022
@y-lee
Copy link

y-lee commented Jan 19, 2022

I have the same error message after clicking on the URL the script provides, and logging in with a Xiaomi account:

{"code":404,"message":"routes not found"}
I have Bip Lite, and successfully used this script with the same device/account several months ago to obtain the Bluetooth access token, so it's a recent change.

@murtoz
Copy link

murtoz commented Jan 24, 2022

to add my device is a mi band 6.
I also have this issue. Unsure what the solution is? I checked the other issue but that is for amazfit. I have a xiaomi account. Same exact symptoms as the other people in this thread.

start the script with my xiaomi login credentials:
python3 huami_token.py --method xiaomi --email [email protected] --password mypassword --bt_keys

This then asks me to open this url:
https://account.xiaomi.com/oauth2/authorize?skip_confirm=false&client_id=19digitnumber&pt=0&scope=1+6000+16001+20000&redirect_uri=https%3A%2F%2Fhm.xiaomi.com%2Fwatch.do&_locale=en_US&response_type=code

I do this, sign in with my xiaomi account, give permission for the zepp app, and it goes to this url, after first giving me a certificate error (name missmatch between zepp and xiaomi):
https://hm.xiaomi.com/watch.do?code=AZAMSSRV_D96AE3D2EAE1617A964617F8F423A417

Which shows:
{"code":404,"message":"routes not found"}

If I then paste this url back into the script, I get

Token: ['AZAMSSRV_C7B081F384152FA752D9B2426B2B7EB5']
Logging in...
Traceback (most recent call last):
  File "huami_token.py", line 353, in <module>
    device.login()
  File "huami_token.py", line 144, in login
    raise ValueError(f"Login error. Error: {error_message}")
ValueError: Login error. Error: 0117. Account not registered.

@murtoz
Copy link

murtoz commented Feb 1, 2022

Ok so I managed to fix my issue by sheer luck. I tried downloading my data directly from the mi fit app (about => compliance) and got an email but when I tried to log in there it said account not registered. I had to add a xiaomi account in the mi fit app (even though I think I set one up when i first used the mi fit app). I was then able to download my data and I figured why not try this again. Now running through the above steps again and everything is the same including the 404 error; except for the very last step: when I paste the url it now sees my device and displays the bt key. I have since succesfully used this with gadgetbridge. Thank you for your amazing work!

@kwozyman
Copy link

Be advised, I was able to get the auth_key for a MiBand 6 by using amazfit method.

@y-lee
Copy link

y-lee commented May 2, 2022

I am pleased to report that this issue is fixed with the current pull.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants