Problem pairing Mi Band 4 #1627

Closed
by frankpau opened 2 years ago · 31 comments
frankpau commented 2 years ago (Migrated from github.com)
Owner

Before reporting a bug, please confirm the following:

  • I have read the wiki, and I didn't find a solution to my problem / an answer to my question.
  • I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
  • If you upload an image or other content, please make sure you have read and understood the github policies and terms of services

I got Gadgetbridge from:

  • F-Droid
  • I built it myself from source code (specify tag / commit)

If you got it from Google Play, please note that version is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can.

Your issue is:

If possible, please attach logs! that might help identifying the problem.
I'm trying to pair a mi band 4 with my phone. i used freemyband and the root-sqlite3 way to obtain the authkey.
i tried to pair the band with 3 different phones , but on all phones the pairing hangs after entering the authkey and choosing the found band.
i also enable logfile writing, but no logfile is written.
on 2 of the phones i was able to pair the band to the phone with mi fit. but on none i got it paired when using gadgetbridge.
between freemyband and root way i hard reset the band, which resulted in a new mac and a new key, which i then obtained using the root way.

Your wearable device is:

Mi Band 4
Firmware Version is 1.0.5.66

Your android version is:

i tried it with the following android version:
5.0.2
7.1.2
9

Your Gadgetbridge version is:

0.36

New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.

#### Before reporting a bug, please confirm the following: - [x] I have read the [wiki](https://github.com/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://github.com/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [x] If you upload an image or other content, please make sure you have read and understood the [github policies and terms of services](https://help.github.com/articles/github-terms-of-service/#1-responsibility-for-user-generated-content) ### I got Gadgetbridge from: * [x] F-Droid * [ ] I built it myself from source code (specify tag / commit) If you got it from Google Play, please note [that version](https://github.com/TaaviE/Gadgetbridge) is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can. #### Your issue is: *If possible, please attach [logs](https://github.com/Freeyourgadget/Gadgetbridge/wiki/Log-Files)! that might help identifying the problem.* I'm trying to pair a mi band 4 with my phone. i used freemyband and the root-sqlite3 way to obtain the authkey. i tried to pair the band with 3 different phones , but on all phones the pairing hangs after entering the authkey and choosing the found band. i also enable logfile writing, but no logfile is written. on 2 of the phones i was able to pair the band to the phone with mi fit. but on none i got it paired when using gadgetbridge. between freemyband and root way i hard reset the band, which resulted in a new mac and a new key, which i then obtained using the root way. #### Your wearable device is: Mi Band 4 Firmware Version is 1.0.5.66 #### Your android version is: i tried it with the following android version: 5.0.2 7.1.2 9 #### Your Gadgetbridge version is: 0.36 *New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.*
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

I tried pairing with and without bluetooth activated in GB.
i also entered the authkey with 0x at the beginning

I tried pairing with and without bluetooth activated in GB. i also entered the authkey with 0x at the beginning
Owner

I don't have MB4 but one of the critical parts in there is to push the button as indicated in wiki. Did you do that? Please do check.

I don't have MB4 but one of the critical parts in there is to push the button as indicated in wiki. Did you do that? Please do check.
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Which part of the wiki do you mean ?
which button needs to be pressed ?

Which part of the wiki do you mean ? which button needs to be pressed ?
Owner
Here: https://github.com/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-4#3-after-a-while-your-mi-band-4-should-appear-long-press-on-mi-smart-band-4 and here: https://github.com/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-4#5-go-back-and-tap-on-mi-smart-band-4-pairing-should-start-now
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

ahh ... yes. this is required for entering the auth key.
i first missied this part and was looking for a way where i could enter the authkey and then reread the wiki and found this part.
but the behavior is the same.
with and without entering the authkey the paring doesn't continue after the band was found and i tapped on it.

ahh ... yes. this is required for entering the auth key. i first missied this part and was looking for a way where i could enter the authkey and then reread the wiki and found this part. but the behavior is the same. with and without entering the authkey the paring doesn't continue after the band was found and i tapped on it.
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

to summarize, yes, i used this way to enter the authkey.

to summarize, yes, i used this way to enter the authkey.
Owner

ok. that is as much as i could help.

ok. that is as much as i could help.
Gogny commented 2 years ago (Migrated from github.com)
Owner

Hi everyone !
I've got the same problem, with the same gadhetbridge version, and I did enter the authkey.
In fact It's quite strange, I ran the root command a second time because I tried to reset my miband 4, so the authkey wasn't valid anymore.
But instead of returning me 1 new authkey, it returned 2 of them (see the picture) ! But there was only one band registered in the miband app !
Finally I'm trying to connect with both, and it doesn't work. I'm blocked on the pairing screen, and now it even doesn't pair my phone with the band in the bluetooth section, in my phone's settings.
I don't know what to try now... If someone has an idea... Hopefully the miband 3 still works just fine (exepting some random app dispawning).
Fingers crossed ! And thank you.
IMG_20190917_215220

Hi everyone ! I've got the same problem, with the same gadhetbridge version, and I did enter the authkey. In fact It's quite strange, I ran the root command a second time because I tried to reset my miband 4, so the authkey wasn't valid anymore. But instead of returning me 1 new authkey, it returned 2 of them (see the picture) ! But there was only one band registered in the miband app ! Finally I'm trying to connect with both, and it doesn't work. I'm blocked on the pairing screen, and now it even doesn't pair my phone with the band in the bluetooth section, in my phone's settings. I don't know what to try now... If someone has an idea... Hopefully the miband 3 still works just fine (exepting some random app dispawning). Fingers crossed ! And thank you. ![IMG_20190917_215220](https://user-images.githubusercontent.com/55463154/65078039-7f935b80-d99c-11e9-91d0-4935b3d44d38.jpg)
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Does anyone have an idea what could be the reason why pairing a mi band 4 device doesn't work and no error is shown ?
is there a timeout for pairing a device ?
Where and how can i get logs about the pairing ?

Does anyone have an idea what could be the reason why pairing a mi band 4 device doesn't work and no error is shown ? is there a timeout for pairing a device ? Where and how can i get logs about the pairing ?
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Here is a gadgetbridge.log from a pairing attempt.
could some please take a look, where the problem could be ?

gadgetbridge.log

Here is a gadgetbridge.log from a pairing attempt. could some please take a look, where the problem could be ? [gadgetbridge.log](https://github.com/Freeyourgadget/Gadgetbridge/files/3652028/gadgetbridge.log)
Owner

@frankpau
The log stops when it gets interesting.

I have no idea why this happens - "Works for me". I just copied the authkey prefixed with 0x (zero lowercase x), and it still works.

@frankpau The log stops when it gets interesting. I have no idea why this happens - "Works for me". I just copied the authkey prefixed with 0x (zero lowercase x), and it still works.
Owner

@frankpau
The authkey should be 16 bytes (32 characters in hex) prefixed with 0x and only contain characters 0-9 and a-f

@frankpau The authkey should be 16 bytes (32 characters in hex) prefixed with 0x and only contain characters 0-9 and a-f
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

i tried to enter the authkey in the format 0xacfetd34@mac because of the hint in the app that the default key is 1234567890@ABCDE. but that was just another try.
Regarding the logfile, i let the paring run for more than 10 minutes , but nothing happened which looked like a successful paring. and during this time the logfile was written.
i will try later again to create an even longer logfile.
the authkey is 32characters long and consists of the specified characters
what can i do to analyse the problem ?

i tried to enter the authkey in the format 0xacfetd34@mac because of the hint in the app that the default key is 1234567890@ABCDE. but that was just another try. Regarding the logfile, i let the paring run for more than 10 minutes , but nothing happened which looked like a successful paring. and during this time the logfile was written. i will try later again to create an even longer logfile. the authkey is 32characters long and consists of the specified characters what can i do to analyse the problem ?
Owner

@frankpau
I guess you pressed enter when entering the key, that produces a line break and the code fails. If there is a line break, remove it and try again.

@frankpau I guess you pressed enter when entering the key, that produces a line break and the code fails. If there is a line break, remove it and try again.
PJK2011 commented 2 years ago (Migrated from github.com)
Owner

I have the same issue. Pixel XL with AOSP 10. App detects Mi Band 4 and allows me to enter my information. Then it stalls at the attached screenshot, "Pairing with Mi Smart Band 4". App notification screenshot shows, "Mi Smart Band 4 Connecting". After rebooting the phone to get a fresh log, the app cannot discover the Mi Band anymore.

logs-2019-09-27-23-06-59.zip

Connecting
Pairing with Mi Smart Band 4

I have the same issue. Pixel XL with AOSP 10. App detects Mi Band 4 and allows me to enter my information. Then it stalls at the attached screenshot, "Pairing with Mi Smart Band 4". App notification screenshot shows, "Mi Smart Band 4 Connecting". After rebooting the phone to get a fresh log, the app cannot discover the Mi Band anymore. [logs-2019-09-27-23-06-59.zip](https://github.com/Freeyourgadget/Gadgetbridge/files/3663592/logs-2019-09-27-23-06-59.zip) ![Connecting](https://user-images.githubusercontent.com/35260361/65783837-2ff12480-e140-11e9-9f11-841d65e42dce.jpg) ![Pairing with Mi Smart Band 4](https://user-images.githubusercontent.com/35260361/65783839-3089bb00-e140-11e9-8c39-58db9ff6daa8.jpg)
Owner

@PKJ2011

You have to remove the band from android Bluetooth settings to find it again after pairing once.

Also did you by chance hit enter after entering the key? That breaks it.

@PKJ2011 You have to remove the band from android Bluetooth settings to find it again after pairing once. Also did you by chance hit enter after entering the key? That breaks it.
PJK2011 commented 2 years ago (Migrated from github.com)
Owner

Thanks Andreas. I got it now.

Thanks Andreas. I got it now.
Owner

@PJK2011
So it was the enter key?

@PJK2011 So it was the enter key?
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

@PJK2011 What did you do differently to get it working ?

@PJK2011 What did you do differently to get it working ?
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

@ashimokawa
I'm pretty sure i did not press the enter key.
I only pressed ok after entering the key

@ashimokawa I'm pretty sure i did not press the enter key. I only pressed ok after entering the key
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Here is anew logfile. This time i've entered the mac adress of the band in Mi Band adress.
The band is now shown in GB but it still doesnt want to pair
gadgetbridge.log

Here is anew logfile. This time i've entered the mac adress of the band in Mi Band adress. The band is now shown in GB but it still doesnt want to pair [gadgetbridge.log](https://github.com/Freeyourgadget/Gadgetbridge/files/3666029/gadgetbridge.log)
Owner

@frankpau
No, entering the Mac address breaks it completely, this is for Mi Band 1 only.
I think I will remove that feature. Causes me to much support tickets.

@frankpau No, entering the Mac address breaks it completely, this is for Mi Band 1 only. I think I will remove that feature. Causes me to much support tickets.
PJK2011 commented 2 years ago (Migrated from github.com)
Owner

@PJK2011
So it was the enter key?

Nah, just a noob error. I didn't know you had to long press the device name to get a menu for key entry.

> @PJK2011 > So it was the enter key? Nah, just a noob error. I didn't know you had to long press the device name to get a menu for key entry.
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Hi andreas, i uninstalled GB to get rid of the mac and installed it again. Attached is a new logfile from 2 pairing tries.
gadgetbridge.log

Hi andreas, i uninstalled GB to get rid of the mac and installed it again. Attached is a new logfile from 2 pairing tries. [gadgetbridge.log](https://github.com/Freeyourgadget/Gadgetbridge/files/3666980/gadgetbridge.log)
Owner

@frankpau
The log looks like wrong key :/

@frankpau The log looks like wrong key :/
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Hi, here is the result of an attempt today.
I paired my band 3 times with mi fit app from freemyband.
Each time a different auth key:
E9:E1:31:F9:65:4E;
99cfc2e23f91390b787b1cc074454cd0

E9:E1:31:F9:65:4E;
a6668b7d0d40ac79610e8093268a6cb2

E9:E1:31:F9:65:4E;
10f8720b9dc3df8136331aecfa8fd0b8

E9:E1:31:F9:65:4E;
a14af5981030429c8d764085b2426d46

Hi, here is the result of an attempt today. I paired my band 3 times with mi fit app from freemyband. Each time a different auth key: E9:E1:31:F9:65:4E; 99cfc2e23f91390b787b1cc074454cd0 E9:E1:31:F9:65:4E; a6668b7d0d40ac79610e8093268a6cb2 E9:E1:31:F9:65:4E; 10f8720b9dc3df8136331aecfa8fd0b8 E9:E1:31:F9:65:4E; a14af5981030429c8d764085b2426d46
Owner

That is normal, only the latest key is valid then.

That is normal, only the latest key is valid then.
Owner

In your case after uninstalling mi fit without unpairing the band you should be able to enter 0xa14af5981030429c8d764085b2426d46 as the auth key and pair

In your case after uninstalling mi fit without unpairing the band you should be able to enter 0xa14af5981030429c8d764085b2426d46 as the auth key and pair
frankpau commented 2 years ago (Migrated from github.com)
Poster
Owner

Damn. I know my mistake....
I always unpaired the band before uninstalling mi fit :(
Its paired know.....

Damn. I know my mistake.... I always unpaired the band before uninstalling mi fit :( Its paired know.....
Owner

Lol, good, I will add this to the wiki as well

Lol, good, I will add this to the wiki as well
Owner

The auth key will be invalidated on unpair...

The auth key will be invalidated on unpair...
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.