MiBand2 icon indicating copy to clipboard operation
MiBand2 copied to clipboard

Device is not connecting error

Open skysnigdha opened this issue 6 years ago • 6 comments

Hi, After connecting the device through bluetooth, I have run the example.py. I am getting error at line number 410 saying Failed to connect to the peripheral. The error remains even if the addrType is changed from random to public.

skysnigdha avatar May 22 '18 10:05 skysnigdha

this basically saying that you have problems with your hardware or drivers for it. Which OS are you running?

creotiv avatar Jun 03 '18 17:06 creotiv

linux 16.04

On 3 June 2018 at 22:49, Andrey Nikishaev [email protected] wrote:

this basically saying that you have problems with your hardware or drivers for it. Which OS are you running?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/creotiv/MiBand2/issues/8#issuecomment-394177074, or mute the thread https://github.com/notifications/unsubscribe-auth/ATuU50c5d4Iod9o7LPGdaD_SZ3sM1qzRks5t5Bq_gaJpZM4UIWC1 .

-- Thanks and Regards, Snigdha

skysnigdha avatar Jun 03 '18 17:06 skysnigdha

I have faced the same problem, my firmware version is 1.0.1.81,

the error message:

-> sudo python example.py XXXXXXXXXX init
2018-06-20 20:52:56,366 MiBand2 (INFO) > Connecting to XXXXXXXXXX
Running  /usr/local/lib/python2.7/dist-packages/bluepy/bluepy-helper
Sent:  conn XXXXXXXXXX random

Got: "rsp=$stat state=$tryconn dst='XXXXXXXXXX mtu=h0 sec='low\n"
Got: "rsp=$stat state=$disc mtu=h0 sec='low\n"
Stopping  /usr/local/lib/python2.7/dist-packages/bluepy/bluepy-helper
Traceback (most recent call last):
  File "example.py", line 8, in <module>
    band = MiBand2(MAC, debug=True)
  File "/home/chaos/dev/open-source/monitor/MiBand2/base.py", line 76, in __init__
    Peripheral.__init__(self, mac_address, addrType=ADDR_TYPE_RANDOM)
  File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 353, in __init__
    self._connect(deviceAddr, addrType, iface)
  File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 402, in _connect
    "Failed to connect to peripheral %s, addr type: %s" % (addr, addrType))
bluepy.btle.BTLEException: Failed to connect to peripheral XXXXXXXXXX, addr type: random

theidexisted avatar Jun 20 '18 13:06 theidexisted

Guys sorry, but i can't debug hardware problems without hardware.

creotiv avatar Jun 21 '18 04:06 creotiv

This issues is very similar with my, i will try their method, https://github.com/IanHarvey/bluepy/issues/105

theidexisted avatar Jun 21 '18 10:06 theidexisted

After switching to another laptop, the problem is gone, so it's indeed a hardware problem, I will try to find the root cause.

theidexisted avatar Jun 21 '18 12:06 theidexisted