iOS Component Fails to Load

I made the switch from my old first gen RPi today to a new RPi 3 model B and chose Hassbian as I don’t think HASS.io suited my needs.

Flashed the latest Hassbian image, copied over my config files. Everything is working except the iOS component. I originally had discovery: and ios: in my configuration.yaml and then added zeroconf: as well but nothing made any difference. I’ve googled all afternoon and not got anywhere. I’ve disabled discovery: and zeroconf: for now and just have ios: in there because as far as I can tell ios: should load what I need. I have sudo apt-get updated and upgraded, restated HA and the RPi several times. I have (inside the virtual environment) installed zeroconf and netdisco (both up to date). Still nothing. I deleted my known_devices.yaml and created a blank one from scratch. The iOS app connects fine, but the iOS Component Loaded is not ticked, nor is the iOS Notify Platform Loaded (Device Tracker Component Loaded is). The first error I get in the logs is;

Error during setup of component zeroconf
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zeroconf.py", line 31, in setup
    from zeroconf import Zeroconf, ServiceInfo
ImportError: cannot import name 'Zeroconf'

And then just errors about zeroconf being a dependency for ios. Strangely,

avahi-browse -alr

Works fine and finds everything on the network. Anyone got a clue how I can get this up and running? Everything on the RPi 3 worked fine on HA 60.1 using Rasbian Stretch (although it was a while since I had updated stretch; it was working so I didn’t dare fix it! :wink: )

I noticed that netdisco was updated in 0.62, so I upgraded and got a new error message;

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 196, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
    res = func(*args, **kw)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/discovery.py", line 89, in async_setup
    from netdisco.discovery import NetworkDiscovery
  File "/srv/homeassistant/lib/python3.5/site-packages/netdisco/discovery.py", line 6, in <module>
    from .ssdp import SSDP
  File "/srv/homeassistant/lib/python3.5/site-packages/netdisco/ssdp.py", line 11, in <module>
    from netdisco.util import etree_to_dict, interface_addresses
  File "/srv/homeassistant/lib/python3.5/site-packages/netdisco/util.py", line 4, in <module>
    import netifaces
ImportError: /srv/homeassistant/lib/python3.5/site-packages/netifaces.cpython-35m-arm-linux-gnueabihf.so: file too short

Is this something I should report as a bug?

I looked into the pip install command a little more and found you can use the following to force a reinstall;

pip3 install --upgrade --force-reinstall netdisco

I then did a

sudo apt-get update
sudo apt-get upgrade

which did update about half a dozen packages. My discovery is now working and the iOS component is loaded. Not sure if this would have worked before the update, but at least it’s working now. Hope this helps someone else, I’ve been talking to myself for too long in this thread!