home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.75k stars 639 forks source link

Problems with serial device in hassio #1266

Closed olskar closed 5 years ago

olskar commented 5 years ago

Home Assistant release with the issue: 0.97.2

Operating environment (HassOS/Generic): Ubuntu

Supervisor logs: 19-08-27 13:49:47 ERROR (MainThread) [hassio.homeassistant] Error on call https://172.30.32.1:8123/api/states/binary_sensor.snapshots_stale: Cannot connect to host 172.30.32.1:8123 ssl:None [Connection refused] 19-08-27 13:49:47 ERROR (MainThread) [hassio.api.proxy] Error on API for request states/binary_sensor.snapshots_stale 19-08-27 13:54:52 ERROR (MainThread) [asyncio] SSL handshake failed protocol: <uvloop.loop.SSLProtocol object at 0x7fde9602d1d0> transport: <TCPTransport closed=False reading=False 0x55befcbd12c0> Traceback (most recent call last): File "uvloop/sslproto.pyx", line 500, in uvloop.loop.SSLProtocol._on_handshake_complete File "uvloop/sslproto.pyx", line 484, in uvloop.loop.SSLProtocol._do_handshake File "/usr/local/lib/python3.7/ssl.py", line 774, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076) 19-08-27 13:54:52 ERROR (MainThread) [asyncio] SSL handshake failed protocol: <uvloop.loop.SSLProtocol object at 0x7fde9602d1d0> transport: <TCPTransport closed=False reading=False 0x55befcbe66e0> Traceback (most recent call last): File "uvloop/sslproto.pyx", line 500, in uvloop.loop.SSLProtocol._on_handshake_complete File "uvloop/sslproto.pyx", line 484, in uvloop.loop.SSLProtocol._do_handshake File "/usr/local/lib/python3.7/ssl.py", line 774, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076) 19-08-27 13:54:52 ERROR (MainThread) [hassio.homeassistant] Error on call https://172.30.32.1:8123/api/states/binary_sensor.snapshots_stale: Cannot connect to host 172.30.32.1:8123 ssl:None [[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076)] 19-08-27 13:54:52 ERROR (MainThread) [hassio.api.proxy] Error on API for request states/binary_sensor.snapshots_stale 19-08-27 13:56:41 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token 19-08-27 13:57:42 INFO (MainThread) [__main__] Stopping Hass.io 19-08-27 13:57:42 INFO (MainThread) [hassio.api] Stop API on 172.30.32.2 19-08-27 13:57:42 INFO (MainThread) [hassio.misc.forwarder] Stop DNS forwarding 19-08-27 13:57:42 INFO (MainThread) [hassio.core] Hass.io is down 19-08-27 13:57:42 INFO (MainThread) [__main__] Close Hass.io 19-08-27 13:57:52 INFO (MainThread) [__main__] Initialize Hass.io setup 19-08-27 13:57:52 INFO (SyncWorker_0) [hassio.docker.supervisor] Attach to Supervisor homeassistant/amd64-hassio-supervisor with version 184 19-08-27 13:57:52 INFO (MainThread) [__main__] Setup HassIO 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.systemd1 - /org/freedesktop/systemd1 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.hostname1 - /org/freedesktop/hostname1 19-08-27 13:57:52 WARNING (MainThread) [hassio.dbus.rauc] Host has no rauc support. OTA updates have been disabled. 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.NetworkManager - /org/freedesktop/NetworkManager/DnsManager 19-08-27 13:57:52 INFO (MainThread) [hassio.host.info] Update local host information 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1 19-08-27 13:57:52 INFO (MainThread) [hassio.host.services] Update service information 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1 19-08-27 13:57:52 INFO (MainThread) [hassio.host.network] Update local network DNS information 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/DnsManager 19-08-27 13:57:52 INFO (MainThread) [hassio.host.apparmor] Load AppArmor Profiles: {'hassio-supervisor'} 19-08-27 13:57:52 INFO (MainThread) [hassio.host.services] Reload local service hassio-apparmor.service 19-08-27 13:57:52 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ReloadOrRestartUnit on /org/freedesktop/systemd1 19-08-27 13:57:52 INFO (SyncWorker_2) [hassio.docker.interface] Attach to homeassistant/amd64-hassio-dns with version 1 19-08-27 13:57:52 INFO (MainThread) [hassio.dns] Update resolv from Supervisor 19-08-27 13:57:52 INFO (SyncWorker_4) [hassio.docker.interface] Restart homeassistant/amd64-hassio-dns 19-08-27 13:57:52 INFO (MainThread) [hassio.misc.forwarder] Start DNS port forwarding to 172.30.32.3 19-08-27 13:57:54 INFO (SyncWorker_1) [hassio.docker.interface] Attach to homeassistant/qemux86-64-homeassistant with version 0.97.2 19-08-27 13:57:55 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/git/ceecc69e repository 19-08-27 13:57:55 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/git/a0d7b954 repository 19-08-27 13:57:55 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/git/15ef4d2f repository 19-08-27 13:57:55 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/git/cebe7a76 repository 19-08-27 13:57:55 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/git/9ccdde17 repository 19-08-27 13:57:55 INFO (MainThread) [hassio.store.git] Load add-on /data/addons/core repository 19-08-27 13:57:55 INFO (MainThread) [hassio.store] Load add-ons from store: 67 all - 67 new - 0 remove 19-08-27 13:57:55 INFO (MainThread) [hassio.addons] Found 9 installed add-ons 19-08-27 13:57:55 INFO (SyncWorker_12) [hassio.docker.interface] Attach to sabeechen/hassio-google-drive-backup-amd64 with version 0.98.1 19-08-27 13:57:55 INFO (SyncWorker_14) [hassio.docker.interface] Attach to homeassistant/amd64-addon-configurator with version 3.4 19-08-27 13:57:55 INFO (SyncWorker_13) [hassio.docker.interface] Attach to homeassistant/amd64-addon-ssh with version 6.3 19-08-27 13:57:55 INFO (SyncWorker_15) [hassio.docker.interface] Attach to esphome/esphome-hassio-amd64 with version 1.13.6 19-08-27 13:57:55 INFO (SyncWorker_4) [hassio.docker.interface] Attach to homeassistant/amd64-addon-duckdns with version 1.9 19-08-27 13:57:55 INFO (SyncWorker_14) [hassio.docker.interface] Attach to hassioaddons/portainer-amd64 with version v0.7.2 19-08-27 13:57:55 INFO (SyncWorker_0) [hassio.docker.interface] Attach to andbobsyouruncle/amd64-google-assistant-webserver with version None 19-08-27 13:57:55 INFO (SyncWorker_10) [hassio.docker.interface] Attach to homeassistant/amd64-addon-check_config with version 2.2 19-08-27 13:57:55 INFO (SyncWorker_11) [hassio.docker.interface] Attach to ceecc69e/amd64-addon-landroids with version 0.71 19-08-27 13:57:55 INFO (MainThread) [hassio.updater] Fetch update data from https://version.home-assistant.io/stable.json 19-08-27 13:57:55 INFO (MainThread) [hassio.snapshots] Found 4 snapshot files 19-08-27 13:57:55 INFO (MainThread) [hassio.discovery] Load 0 messages 19-08-27 13:57:55 INFO (MainThread) [hassio.ingress] Load 2 ingress session 19-08-27 13:57:55 INFO (MainThread) [__main__] Run Hass.io 19-08-27 13:57:55 INFO (MainThread) [hassio.api] Start API on 172.30.32.2 19-08-27 13:57:55 INFO (MainThread) [hassio.addons] Phase 'initialize' start 0 add-ons 19-08-27 13:57:55 INFO (MainThread) [hassio.core] Hass.io reboot detected 19-08-27 13:57:55 INFO (MainThread) [hassio.tasks] All core tasks are scheduled 19-08-27 13:57:55 INFO (MainThread) [hassio.core] Hass.io is up and running 19-08-27 13:59:57 ERROR (MainThread) [asyncio] SSL handshake failed protocol: <uvloop.loop.SSLProtocol object at 0x7f0dcf40f1d0> transport: <TCPTransport closed=False reading=False 0x560c4affeae0> Traceback (most recent call last): File "uvloop/sslproto.pyx", line 500, in uvloop.loop.SSLProtocol._on_handshake_complete File "uvloop/sslproto.pyx", line 484, in uvloop.loop.SSLProtocol._do_handshake File "/usr/local/lib/python3.7/ssl.py", line 774, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076) 19-08-27 13:59:57 ERROR (MainThread) [asyncio] SSL handshake failed protocol: <uvloop.loop.SSLProtocol object at 0x7f0dcf40f1d0> transport: <TCPTransport closed=False reading=False 0x560c4b007d80> Traceback (most recent call last): File "uvloop/sslproto.pyx", line 500, in uvloop.loop.SSLProtocol._on_handshake_complete File "uvloop/sslproto.pyx", line 484, in uvloop.loop.SSLProtocol._do_handshake File "/usr/local/lib/python3.7/ssl.py", line 774, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076) 19-08-27 13:59:57 ERROR (MainThread) [hassio.homeassistant] Error on call https://172.30.32.1:8123/api/states/binary_sensor.snapshots_stale: Cannot connect to host 172.30.32.1:8123 ssl:None [[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076)] 19-08-27 13:59:57 ERROR (MainThread) [hassio.api.proxy] Error on API for request states/binary_sensor.snapshots_stale 19-08-27 14:05:02 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token 19-08-27 14:08:49 INFO (MainThread) [hassio.api.security] /snapshots access from cebe7a76_hassio_google_drive_backup 19-08-27 14:35:03 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token 19-08-27 14:38:43 INFO (MainThread) [hassio.api.security] /supervisor/logs access from core_ssh

Description of problem: Please see issue https://github.com/home-assistant/home-assistant/issues/23942

The component rflink does not work in hass.io. The bug was originally filed against rflink but the problem does not seem to be in rflink, but in hass.io.

I tried today to install home assistant in docker using these instructions: https://www.home-assistant.io/docs/installation/docker/

The bug is not present in that installation.

If you watch the serialinterface (for example with screen) you can see that from the moment the home assistant docker is starting the output is becoming garbage: screen /dev/ttyACM0 57600 RadioFrequencyLink - RFLink Gateway V1.1 - R46; 20;01;XT200;ID=1019;TEMP=0028;BAT=LOW; �~�~�����fx����x��fxf~f��f������������~f�~ff����x�~怘��~��~f~f���������fff�f�����ff昘�������~x�ff�~��f�����~ff�f�x�~ff����~f~怘��~�x��f~f���������fff�f�����ff昘���������~ff�f�x�~ff����~f~怘��~��f~f���������fff�f�����ff昘������f�f�x�~ff����~f~怘�f�����~ff�f�xf�~ff����~f~怘��~��~f~f���������fff�f�����ff昘���������~f~f���������fff�f�����ff昘������xx�~ff����~f~怘��~��~f~f���������fff�f�����f�~��f~f�������~�~�ff�~��f�����~ff�f��x�~ff����~f~怘��~x��f~f���������fff�f�����ff昘�������~�x��f~f���������fff�f�����ff昘�������~�ff�~��f�����~ff�f��x�~ff����~f~怘��x�~ff����~f~怘��~��ff�~��f�����~ff�f��x�~ff����~f~怘��~�~f~f���������fff�f�����ff昘�������~�ff�~��f�����~ff�f��xx�~ff����~f~怘��~��~f~f���������fff�f���f��ff昘�������~��~f~f���������fff�f���f��ff昘�������~��f�����~ff�f��xx�~ff����~f~怘����fff�f���f��ff昘�������~��~f~f���������fff�f���f��ff昘�������~��f~f���������fff�f���f��ff昘�������~�~��~���x����~ff��f����~f�f�����

schonhose commented 5 years ago

I have the same problem. 2019-08-28 23:14:07 INFO (MainThread) [homeassistant.components.rflink] Initiating Rflink connection 2019-08-28 23:14:07 INFO (MainThread) [homeassistant.components.rflink] Connected to Rflink 2019-08-28 23:14:07 DEBUG (MainThread) [rflink.protocol] connected 2019-08-28 23:15:21 DEBUG (MainThread) [rflink.protocol] received data: nH 2019-08-28 23:15:21 WARNING (MainThread) [rflink.protocol] Error during decode of data, invalid data: 

It seems that the RFLink is connected, but the received output is garbled. This is from the 32bits HASSIO image, downloaded today and installed on a Raspberry Pi 3b+ (running HassOS 2.12 with version 184).

Sad thing is I moved from domoticz to hassio, leaving a working config for a not working one.

pvizeli commented 5 years ago

Do you use things like Bluetooth (they are also connected to serial)? Raspberry share the serial interface with other hardware. I currently don't see a reason why docker should do that, look more like a wrong setup and another component. I don't have the hardware and can help to find the issue. A good start is to share any configs and see where is the point what is the same on both installations and could affect this.

olskar commented 5 years ago

@pvizeli @aequitas made this summary in the original report. I Dont use any other serial device besides rflink

"Correct me if I'm wrong, but what we know at the moment is its:

not rflink (version) specific, since not everyone using rflink (eg me) has issues, version of rflink has not changed recently

not HA version specific as downgrading from 0.93.1 to previously working 0.92.2 does not work for everyone

might be hassio specific, but we have one hassio on 165 working and one not, so it's not hassio version specific. But maybe related to how/when your hassio was setup?

seems related to how the container interacts with the serial device (technically the container only binds the serial device inside the container, so not much that could go wrong there).

running rflink outside of the HA container works and in some cases restores functionality inside the container"

pvizeli commented 5 years ago

@olskar @schonhose start with 0.98.0 we removed uvloop. Maybe that fixed also your issue?

olskar commented 5 years ago

@pvizeli Thanks for your answer. The issue still remains sadly.

Not sure how to debug this issue, I am not that into the docker world.

All I know is that this bug is in hass.io installs but not if installed some other way, even a regular docker installation does not have the bug.

So there seems to be something with hass.io

pvizeli commented 5 years ago

https://www.home-assistant.io/hassio/installation/#debianubuntu

Do you read the warning there?

olskar commented 5 years ago

Thanks @pvizeli I have to admit I did not, and not other people in original thread but seems to do the trick! Closing!

AlexisKroal commented 4 years ago

That is, the modemmanager MUST be disabled !!

chrisella commented 4 years ago

@schonhose I'm in the exact same situation, just moved house and decided to swap from a working great Domoticz setup to trying HA (recommended by a friend). I had the same RFLink issue and can confirm that the modem manager fix works!

sudo systemctl disable ModemManager sudo apt-get purge modemmanager