Closed Spirituss closed 4 years ago
Any ideas re. the issue? I still can't use Mi Flora via HA integration.
I have the same, or a very similar, issue and get almost the same error (see below)
Some observations:
Spirritus gets "before (last 100 chars): b'Set scan parameters failed: Input/output error\r\n'" which I don't get. I don't even have that "before" label in my log.
For me it worked flawles when I was running hass.io on Raspberry Pie but since move to Intel NUC it usually only works for a few minutes until it fails.
I can run the command "hcitool -i hci0 lescan" from a console also after it failed but it seems like there might be a problem running that command at all time and that error handling is not working fully.
My log:
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 0x7f757f11a1d0>
command: /usr/bin/hcitool
args: ['/usr/bin/hcitool', '-i', 'hci0', 'lescan']
buffer (last 100 chars): b''
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 1921
child_fd: 60
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:
Do you have MiFlora listed in known_devices.yaml? I'd try to mark MiFlora to "track=false" or even better remove it from straight from the list.
I've had similar problems with BLE, but it seems to work after I removed every single BLE device from the knowndevices list. (This is when you will get the warning : No BLE devices to track) and then I only added specific BLE devices (Mi Band, etc). I don't get BLE entities populated in known_devices anymore for whatever reason, but I don't mind that.
It seems to me, that the components are trying to scan each on their own to the same BLE address, so when device_tracker is trying to access a MiFlora-running scan (or vice-versa), it goes sideways. Same thing goes to the MiTemp component
@thawizard May be it works with Mi Flora since it has own platform component where the MAC can be specified, but I have the same issue also with BLE beacon (I use NUT Tracker). For it I can't set track=false
because in this case platform: bluetooth_le_tracker
doesn't know my device.
As a possible solution, I propose to implement additional parameter for platform: bluetooth_le_tracker
such as "hosts" for platform: nmap_tracker
or platform: ping
.
Guys, is there any news on the issue?
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
It's still an issue.
Same issue here … is miflora
and bluetooth_le_tracker
incompatible?
track: false
did not solve the issue.
Looks like #16698 is also related to this
2020-03-24 21:08:23 ERROR (SyncWorker_6) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: LE Scan ...
C4:7C:8D:ZZ:ZZ:ZZ (unknown)
C4:7C:8D:ZZ:ZZ:ZZ Dial TEST
Disable scan failed: I/O error
2020-03-24 21:08:23 ERROR (SyncWorker_6) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: LE Scan ...
C4:7C:8D:ZZ:ZZ:ZZ (unknown)
C4:7C:8D:ZZ:ZZ:ZZ Dial TEST
Disable scan failed: I/O error
2020-03-24 21:09:41 ERROR (SyncWorker_17) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: LE Scan ...
0A:6A:A5: (unknown)
63:C5:46:XX:XX:XX (unknown)
63:C5:46:XX:XX:XX (unknown)
75:3A:CA:GG:GG:GG (unknown)
75:3A:CA:GG:GG:GG (unknown)
4A:7A:D5 (unknown)
C4:7C:8D:YY:YY:YY (unknown)
Disable scan failed: I/O error
2020-03-24 21:09:41 ERROR (SyncWorker_17) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: LE Scan ...
0A:6A:A5: (unknown)
63:C5:46:XX:XX:XX (unknown)
63:C5:46:XX:XX:XX (unknown)
75:3A:CA:GG:GG:GG (unknown)
75:3A:CA:GG:GG:GG (unknown)
4A:7A:D5: (unknown)
C4:7C:8D:YY:YY:YY (unknown)
Disable scan failed: I/O error
2020-03-24 21:10:19 ERROR (SyncWorker_17) [pygatt.backends.gatttool.gatttool] Unexpected error when scanning: LE Scan ...
...
63:C5:46:XX:XX:XX (unknown)
63:C5:46:XX:XX:XX (unknown)
C4:7C:8D:YY:YY:YY (unknown)
C4:7C:8D:YY:YY:YY Flower care
Disable scan failed: I/O error
2020-03-24 21:10:19 ERROR (SyncWorker_17) [homeassistant.components.bluetooth_le_tracker.device_tracker] Error during Bluetooth LE scan: Unexpected error when scanning: LE Scan ...
...
63:C5:46:XX:XX:XX(unknown)
63:C5:46:XX:XX:XX (unknown)
C4:7C:8D:YY:YY:YY (unknown)
C4:7C:8D:YY:YY:YY Flower care
Disable scan failed: I/O error
bluetooth_le_tracker
do not get miflora
working again@danielhiversen @ChristianKuehnel
Home Assistant release with the issue:
HA 0.93
Last working Home Assistant release (if known): ~0.86 (?)
Operating environment (Hass.io/Docker/Windows/etc.):
Home Assistant, Rasprberry
Component/platform:
bluetooth_le_tracker
Description of problem: Have BLE errors in log when activates BLE device_tracker. Mi Flora stops working (!!), it is Unavailable most of the time.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information: BLE tracking was installed according to official manual: Bluetooth LE Tracker