creotiv / MiBand2

Library to work with Xiaomi MiBand 2
Creative Commons Zero v1.0 Universal
544 stars 173 forks source link

Authorization fails #32

Closed jfolt closed 4 years ago

jfolt commented 4 years ago

Hi,

I am trying to authorize my Mi band 2, but the device always disconnects while doing that.

Any advice?

Thanks Jarek

pi@raspberry_router:~/MiBand2-master $ python example.py --mac CF:B9:0C:B5:07:7C --init 2019-09-13 01:51:57,573 MiBand2 (INFO) > Connecting to CF:B9:0C:B5:07:7C 2019-09-13 01:52:01,720 MiBand2 (INFO) > Connected 2019-09-13 01:52:12,019 MiBand2 (INFO) > Enabling Auth Service notifications status... 2019-09-13 01:52:12,265 MiBand2 (INFO) > Sending Key... Traceback (most recent call last): File "example.py", line 23, in if band.initialize(): File "/home/pi/MiBand2-master/base.py", line 305, in initialize self.waitForNotifications(0.1) File "/home/pi/miniconda3/lib/python3.6/site-packages/bluepy/btle.py", line 560, in waitForNotifications resp = self._getResp(['ntfy','ind'], timeout) File "/home/pi/miniconda3/lib/python3.6/site-packages/bluepy/btle.py", line 407, in _getResp resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout) File "/home/pi/miniconda3/lib/python3.6/site-packages/bluepy/btle.py", line 362, in _waitResp raise BTLEDisconnectError("Device disconnected", resp) bluepy.btle.BTLEDisconnectError: Device disconnected

jfolt commented 4 years ago

Never mind. After I pressed the button on the device the authorization worked out just fine.