XiaomiGateway3 icon indicating copy to clipboard operation
XiaomiGateway3 copied to clipboard

integration stops working after gateway restat

Open kkmaslowski opened this issue 3 years ago • 0 comments

Hi. I'm using firmware '1.5.0_0102 #20210816' and latest version of integration - 2.0.9. When I reboot gateway integration does not reconnect - I need to restart homeassistant to get it working. Telnet is working after reboot. In homeassistant log I see only

2022-04-13 09:35:27 ERROR (bellows.thread_0) [bellows.uart] Lost serial connection: read failed: socket disconnected
2022-04-13 09:35:27 ERROR (MainThread) [bellows.ezsp] NCP entered failed state. Requesting APP controller restart
2022-04-13 09:35:27 ERROR (bellows.thread_0) [homeassistant] Error doing job: Exception in callback SerialTransport._call_connection_lost(SerialExcepti...disconnected'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 417, in _call_connection_lost
    self._serial.close()
  File "/usr/local/lib/python3.9/site-packages/serial/urlhandler/protocol_socket.py", line 104, in close
    time.sleep(0.3)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 173, in protected_loop_func
    check_loop(func, strict=strict)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 135, in check_loop
    raise RuntimeError(
RuntimeError: Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue

How can I reconnect without restart? Can I restart only integration? Is it normal that ha restart is needed?

UPDATE: I see that after gateway reboot port 8888 is not available. Process /data/ser2net is not running. Is it started by integration or by gateway startup scripts itself? It should be available instantly after gateway reboot? I tried to start ser2net manually using command: /data/ser2net -C '8888 raw 60 /dev/ttyS2 38400 8DATABITS NONE 1STOPBIT XONXOFF' Process exists but it's not listening on 8888 port:

# netstat -nult| grep 8888
# 

When I restart homeassistant process is instantly running and it listens on 8888 port. I can't kill it to test it manually, because it's instantly started again. When I restart gateway it's not running.

kkmaslowski avatar Apr 13 '22 07:04 kkmaslowski