Broadlink RM-Pro and Stretch

I have upgraded to Hassbian 1.3 - A bit of a stretch:

I have got everything working except my Broadlink RM-Pro it works fine after the initial install then after a re-boot fails with the following:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 5, in <module>
    from Crypto.Cipher import AES
  File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/__init__.py", line 3, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Util/_raw_api.py", line 32, in <module>
    from Crypto.Util.py3compat import byte_string
ImportError: cannot import name 'byte_string'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.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/sensor/broadlink.py", line 60, in setup_platform
    broadlink_data = BroadlinkData(update_interval, host, mac_addr, timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/broadlink.py", line 107, in __init__
    import broadlink
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 7, in <module>
    import pyaes
ImportError: No module named 'pyaes'

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 5, in <module>
    from Crypto.Cipher import AES
  File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/__init__.py", line 3, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
    from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
  File "/srv/homeassistant/lib/python3.5/site-packages/Crypto/Util/_raw_api.py", line 32, in <module>
    from Crypto.Util.py3compat import byte_string
ImportError: cannot import name 'byte_string'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.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/switch/broadlink.py", line 75, in setup_platform
    import broadlink
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 7, in <module>
    import pyaes
    ImportError: No module named 'pyaes'

It works fine under Jessie

Any suggestions?

Thanks
Ralph

Hi,

Are you sure pycrypto is installed? I run Hassbian 1.3 stretch and the broadlink module works fine for me. This was a fresh 1.3 install (no upgrade).

Simon.

Hi,

Yes pycrypto is installed this was also a fresh 1.3 install. It’s odd as it worked fine for the first boot and then fails after that I will have another crack at it tomorrow with a fresh install again and see what happens.

The only thing I added to the build was Mosquitto.

Ralph