Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mi Band stuck on Initializing #249

Closed
bigretromike opened this issue Mar 10, 2016 · 15 comments

Comments

Projects
None yet
3 participants
@bigretromike
Copy link

commented Mar 10, 2016

At morning I used GB with success (even heart monitor)
But after work, I went in GB, click on mi band to connect to it.. it started "initializing" and stuck that way.
I can enter the data that was sync on morning, but cant sync it any more.

after quiting GB band connected but taping on it made app crash.
That was same for 3 times, after setting debug log write in settings, quiting, reopening and taping it started to work.

Just to be sure - this is Android 6.0 (CM13) + Mi Band 1S

Is there is anyway I could help with collecting data for this It would be great.

@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2016

Yeah, sometimes the band just doesn't announce its services and characteristics. So when we ask for them, the band simply doesn't answer. The only thing that helps is disconnecting (long-press -> disconnect) and connecting again, sometimes twice.

We could try to automate that when the band doesn't respond after X seconds, but as of now, we don't do this.

I'd be interested in a log of the crash. I'm wondering if this is a Android 6 permission thing. AFAIK we don't have a full solution for this yet.

BTW, one thing I noticed: the quit option doesn't always work 100%. It does close all activities and kill the service, but the notification receiver (for sms notifications, k9, etc.) keeps it from fully quitting. That's a separate issue, but I just wanted to mention it.

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 11, 2016

Had same thing today - with exception that I only had to quit once, before the band connected properly.
Here is a 2week valid link from log.I enabled it yestarday to fix the initiation bug and it was working from that time with 2 initiation bugs and probably 1 crash.
Maybe this will help you: https://paste.ee/p/UrNSc

@rajeevn1

This comment has been minimized.

Copy link

commented Mar 23, 2016

I have the same issue and am able to reproduce it almost every time.

I happens when I turn off bluetooth while and the app is connected, and then turn bluetooth on. The app gets stuck on initializing and I have to disconnect/ reconnect to make it work. Seems like a race condition bug.

side note: I turn bluetooth off at night using tasker to disable the notifications.

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 23, 2016

0.9.0 still have this issue

cpfeiffer added a commit that referenced this issue Mar 23, 2016

Set low latency mode during initialization #249
This appears to fix the initialization getting stuck sometimes, e.g.
after turning on bluetooth and then connecting.

The band incidentally sends 0x8 when it's stuck (won't accept the UUID_PAIR
request).
@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2016

@rajeevn1 Thanks for the pointer with disabling bluetooth! This made the issue finally reproduceable. When this happens, we get a 0x8 notification from the band, which supposedly means "NOTIFY_SET_LATENCY_SUCCESS". Maybe the naming is only a little wrong and it actually means "latency too high" or something like that, which could be after turning on bluetooth (or maybe after turning off bluetooth without properly disconnecting from the band).

So I added some code to set low latency during initialization and now I can't reproduce the issue anymore. Please test if this also fixes the issue for you.

@cpfeiffer cpfeiffer changed the title Mi Band 1S stuck on Initializing Mi Band stuck on Initializing Mar 23, 2016

@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2016

(adjusted the title because it happens with other Mi Band models, too)

@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2016

Drat, now it's stuck again ;(

@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2016

Anyone an idea what 0x8 means after issuing an application-level (not bluetooth-level) pairing with the Mi Band? The band sends 0x8 even repeatedly, like asking for something.

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 24, 2016

maybe its want to be 'discover' or saying 'im ready, try again' ?

Im trying to help as best I can so maybe this will help:
https://github.com/betomaluje/Mi-Band/blob/master/MiBand/app/src/main/java/com/betomaluje/miband/model/Protocol.java

cpfeiffer added a commit that referenced this issue Mar 24, 2016

@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2016

I cannot reproduce the connection issue anymore, so I declare this fixed :-)

@cpfeiffer cpfeiffer closed this Mar 24, 2016

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 25, 2016

when connected i disable bluetooth, then enable bluetooth, gb start automaticly and get stuck on "initializing" (when trying to connect automaticly)
long press on device > disconnect
then press on device to connect

for me its not fixed (0.9.0-fdroid)

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 25, 2016

Every single time same thing

(CM13 LG G2)

Also after connecting the device tend to disconnect from GB

@cpfeiffer

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2016

The last fixes are not in 0.9.0, they will be in 0.9.1. If you build yourself, you can get them already.

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 25, 2016

Oh, Thank you for update then :-) I will wait for new release

@bigretromike

This comment has been minimized.

Copy link
Author

commented Mar 27, 2016

0.9.1 fixed problem.
Can you relese test builds in f-droid next time, so we could test those :-)

cpfeiffer added a commit that referenced this issue Apr 3, 2016

Attempt to re-enable automatic reconnect (autosensing) #249
(now that initializing device works again)

cpfeiffer added a commit that referenced this issue Apr 7, 2016

OK, just connect(true) is not sufficient #249
(we again get connection problems. Let's try this.)

cpfeiffer added a commit that referenced this issue Apr 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.