Mi Band stuck on Initializing #249

Closed
by bigretromike opened 5 years ago · 15 comments
bigretromike commented 5 years ago (Migrated from github.com)
Owner

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.

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.
Owner

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.

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 commented 5 years ago (Migrated from github.com)
Poster
Owner

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

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 commented 5 years ago (Migrated from github.com)
Owner

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.

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 commented 5 years ago (Migrated from github.com)
Poster
Owner

0.9.0 still have this issue

0.9.0 still have this issue
Owner

@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.

@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.
Owner

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

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

Drat, now it's stuck again ;(

Drat, now it's stuck again ;(
Owner

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.

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 commented 5 years ago (Migrated from github.com)
Poster
Owner

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

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
Owner

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

I cannot reproduce the connection issue anymore, so I declare this fixed :-)
bigretromike commented 5 years ago (Migrated from github.com)
Poster
Owner

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)

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 commented 5 years ago (Migrated from github.com)
Poster
Owner

Every single time same thing

(CM13 LG G2)

Also after connecting the device tend to disconnect from GB

Every single time same thing (CM13 LG G2) Also after connecting the device tend to disconnect from GB
Owner

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.

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 commented 5 years ago (Migrated from github.com)
Poster
Owner

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

Oh, Thank you for update then :-) I will wait for new release
bigretromike commented 5 years ago (Migrated from github.com)
Poster
Owner

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

0.9.1 fixed problem. Can you relese test builds in f-droid next time, so we could test those :-)
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.