I have installed Home Assistant on a Nuc with Proxmox. HA is on a Debian VM with docker.
Bluetooh is seen by the VM and docker.HA sees bluetooth object.
But mi miband 1 and 2 are not detect every time. Sometimes, i can wait 5 hours before HA detect it.
If i scan manually with hcitool lescan, i see my miband but scan is stuck:
bash-5.0# hcitool lescan
LE Scan ...
73:0E:76:AE:8F:D7 (unknown)
73:0E:76:AE:8F:D7 (unknown)
9C:8C:6E:EA:6A:E1 (unknown)
00:9E:C8:AE:F4:59 (unknown)
00:9E:C8:AE:F4:59 (unknown)
C0:28:8D:49:61:DE
C8:0F:10:7F:06:E0 (unknown)
C4:7C:8D:66:41:FA (unknown)
C4:7C:8D:66:41:FA Flower care
C4:7C:8D:66:42:4A (unknown)
C4:7C:8D:66:42:4A Flower care
C8:0F:10:7F:06:E0 MI1S
C0:28:8D:49:61:DE (unknown)
74:40:BB:C2:06:3C (unknown)
Disable scan failed: I/O error
it takes 5 minutes to scan and finished by an error.
On HA logs i have this:
Log Details (ERROR)
Thu Jul 25 2019 15:09:14 GMT+0200 (heure d’été d’Europe centrale)
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 166, in read_nonblocking
s = os.read(self.child_fd, size)
OSError: [Errno 5] I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 111, in expect_loop
incoming = spawn.read_nonblocking(spawn.maxread, timeout)
File "/usr/local/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking
return super(spawn, self).read_nonblocking(size)
File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 171, in read_nonblocking
raise EOF('End Of File (EOF). Exception style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 341, in scan
scan.expect('foooooo', timeout=timeout)
File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 341, in expect
timeout, searchwindowsize, async_)
File "/usr/local/lib/python3.7/site-packages/pexpect/spawnbase.py", line 369, in expect_list
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 117, in expect_loop
return self.eof(e)
File "/usr/local/lib/python3.7/site-packages/pexpect/expect.py", line 63, in eof
raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fb4e4d6d410>
command: /usr/bin/hcitool
args: ['/usr/bin/hcitool', '-i', 'hci0', 'lescan']
buffer (last 100 chars): b''
before (last 100 chars): b'unknown)\r\nC0:28:8D:49:61:DE (unknown)\r\nC4:7C:8D:66:42:4A (unknown)\r\nDisable scan failed: I/O error\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 76
child_fd: 37
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile(b'foooooo')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 110, in update_ble
devs = discover_ble_devices()
File "/usr/src/homeassistant/homeassistant/components/bluetooth_le_tracker/device_tracker.py", line 69, in discover_ble_devices
devs = adapter.scan()
File "/usr/local/lib/python3.7/site-packages/pygatt/backends/gatttool/gatttool.py", line 352, in scan
raise BLEError(message)
pygatt.exceptions.BLEError: Unexpected error when scanning: LE Scan ...
00:9E:C8:AE:F4:59 (unknown)
00:9E:C8:AE:F4:59 (unknown)
73:0E:76:AE:8F:D7 (unknown)
73:0E:76:AE:8F:D7 (unknown)
C4:7C:8D:66:41:FA (unknown)
C4:7C:8D:66:41:FA Flower care
9C:8C:6E:EA:6A:E1 (unknown)
C0:28:8D:49:61:DE
C4:7C:8D:66:42:4A (unknown)
C4:7C:8D:66:42:4A Flower care
C8:0F:10:7F:06:E0 (unknown)
C8:0F:10:7F:06:E0 MI1S
74:40:BB:C2:06:3C (unknown)
C0:28:8D:49:61:DE (unknown)
C4:7C:8D:66:42:4A (unknown)
Disable scan failed: I/O error
Could you help me?