tydom2mqtt icon indicating copy to clipboard operation
tydom2mqtt copied to clipboard

l'addon s'arrete au demarrage : OSError: [Errno 113] Host is unreachable

Open UnetUn opened this issue 2 years ago • 5 comments

Bonjour voici le log

2023-03-08 07:35:10,576 - main - INFO - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2023-03-08 07:35:10,576 - main - INFO - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2023-03-08 07:35:10,576 - main - INFO - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2023-03-08 07:35:10,576 - main - INFO - STARTING TYDOM2MQTT 2023-03-08 07:35:10,576 - main - INFO - Detecting environnement...... 2023-03-08 07:35:10,576 - main - INFO - /data/options.json detected ! Hassio Addons Environnement : parsing options.json.... 2023-03-08 07:35:10,577 - tydomConnector - INFO - Initialising TydomClient Class 2023-03-08 07:35:10,577 - tydomConnector - INFO - Setting local mode context. 2023-03-08 07:35:10,580 - main - INFO - Starting main loop_task /app/main.py:141: DeprecationWarning: There is no current event loop loop = asyncio.get_event_loop() 2023-03-08 07:35:10,581 - mqtt_client - INFO - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2023-03-08 07:35:10,581 - mqtt_client - INFO - Attempting MQTT connection... 2023-03-08 07:35:10,581 - mqtt_client - INFO - MQTT host : homeassistant 2023-03-08 07:35:10,582 - mqtt_client - INFO - MQTT user : Tydom 2023-03-08 07:35:10,592 - gmqtt.mqtt.protocol - INFO - [CONNECTION MADE] 2023-03-08 07:35:10,798 - mqtt_client - INFO - ################################## 2023-03-08 07:35:10,799 - mqtt_client - INFO - Subscribing to : +/tydom/# 2023-03-08 07:35:10,799 - gmqtt.mqtt.package - INFO - [SEND SUB] 1 [b'homeassistant/status'] 2023-03-08 07:35:10,799 - gmqtt.mqtt.package - INFO - [SEND SUB] 2 [b'+/tydom/#'] 2023-03-08 07:35:10,801 - tydomConnector - INFO - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2023-03-08 07:35:10,801 - tydomConnector - INFO - TYDOM WEBSOCKET CONNECTION INITIALISING....
2023-03-08 07:35:10,801 - tydomConnector - INFO - Building headers, getting 1st handshake and authentication.... Traceback (most recent call last): File "/app/main.py", line 226, in loop_task() File "/app/main.py", line 148, in loop_task loop.run_until_complete(listen_tydom_forever(tydom_client)) File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/app/main.py", line 160, in listen_tydom_forever await tydom_client.connect() File "/app/tydomConnector.py", line 109, in connect conn.request( File "/usr/local/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output self.send(msg) File "/usr/local/lib/python3.10/http/client.py", line 975, in send self.connect() File "/usr/local/lib/python3.10/http/client.py", line 1447, in connect super().connect() File "/usr/local/lib/python3.10/http/client.py", line 941, in connect self.sock = self._create_connection( File "/usr/local/lib/python3.10/socket.py", line 845, in create_connection raise err File "/usr/local/lib/python3.10/socket.py", line 833, in create_connection sock.connect(sa) OSError: [Errno 113] Host is unreachable

Je saiis pas s cela vient de l'addons lui meme ou d'un probleme de port qu est verroullé ? Qu'en pensez vous ? Merci

UnetUn avatar Mar 08 '23 07:03 UnetUn

Quelle valeur de TYDOM_IP utilisez-vous ?

  • valeur par défaut mediation.tydom.com ? Si oui, il faut vous assurer que votre conteneur peut accéder à Internet
  • adresse IP locale ? si oui, quelle valeur ? Il faut alors vérifier que le conteneur arrive bien à la résoudre

fmartinou avatar Mar 11 '23 13:03 fmartinou

Hello ! J'ai un peu le même problème au démarrage : l'addon se lance, puis s'arrête. Voici le log : 2023-03-20 15:59:40,603 - mqtt_client - INFO - Subscribing to : +/tydom/# 2023-03-20 15:59:40,604 - gmqtt.mqtt.package - INFO - [SEND SUB] 1 [b'homeassistant/status'] 2023-03-20 15:59:40,605 - gmqtt.mqtt.package - INFO - [SEND SUB] 2 [b'+/tydom/#'] 2023-03-20 15:59:40,607 - tydomConnector - INFO - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2023-03-20 15:59:40,608 - tydomConnector - INFO - TYDOM WEBSOCKET CONNECTION INITIALISING.... 2023-03-20 15:59:40,608 - tydomConnector - INFO - Building headers, getting 1st handshake and authentication.... Traceback (most recent call last): File "/app/main.py", line 226, in <module> loop_task() File "/app/main.py", line 148, in loop_task loop.run_until_complete(listen_tydom_forever(tydom_client)) File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/app/main.py", line 160, in listen_tydom_forever await tydom_client.connect() File "/app/tydomConnector.py", line 109, in connect conn.request( File "/usr/local/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output self.send(msg) File "/usr/local/lib/python3.10/http/client.py", line 975, in send self.connect() File "/usr/local/lib/python3.10/http/client.py", line 1454, in connect self.sock = self._context.wrap_socket(self.sock, File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create self.do_handshake() File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:997)

Ma config fonctionnait à peu près correctement il y a 1 mois (beaucoup de lenteur de la TYDOM2 qui n'arrêtait pas de clignoter, avec une connexion quasi impossible en local à l'app TYDOM sur smartphone). Merci pour ton aide ;)

damy7 avatar Mar 20 '23 15:03 damy7

Bonjour,

Merci de mettre à jour l'appli en dernière version (3.0.1 à ce jour). S'il y a toujours des problèmes, alors passez les logs en DEBUG et les attacher à cette issue.

fmartinou avatar Mar 26 '23 13:03 fmartinou

Voici le log en DEBUG :

2023-03-26 15:17:37,955 - Starting tydom2mqtt
2023-03-26 15:17:37,956 - Hassio environment detected: loading configuration from /data/options.json
2023-03-26 15:17:37,957 - Validating configuration ({
    "log_level": "DEBUG",
    "mqtt_host": "homeassistant",
    "mqtt_password": "t***********o",
    "mqtt_port": 1883,
    "mqtt_ssl": false,
    "mqtt_user": "tydommosquito",
    "tydom_alarm_home_zone": 1,
    "tydom_alarm_night_zone": 2,
    "tydom_alarm_pin": "",
    "tydom_ip": "192.168.1.68",
    "tydom_mac": "001A25054767",
    "tydom_password": "k*******7"
}
2023-03-26 15:17:37,957 - The configuration is valid
2023-03-26 15:17:37,958 - tydom.TydomClient    - DEBUG   - Initializing TydomClient Class
2023-03-26 15:17:37,958 - tydom.TydomClient    - INFO    - Configure local mode (192.168.1.68)
2023-03-26 15:17:37,964 - asyncio              - DEBUG   - Using selector: EpollSelector
2023-03-26 15:17:37,967 - mqtt.MqttClient      - INFO    - Connecting to mqtt broker (host=homeassistant, port=1883, user=tydommosquito, ssl=False)
2023-03-26 15:17:37,978 - tydom.TydomClient    - INFO    - Connecting to tydom
2023-03-26 15:17:37,982 - asyncio              - ERROR   - Task exception was never retrieved
future: <Task finished name='Task-2' coro=<listen_tydom() done, defined at /app/main.py:41> exception=SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:992)')>
Traceback (most recent call last):
  File "/app/main.py", line 44, in listen_tydom
    await tydom_client.connect()
  File "/app/tydom/TydomClient.py", line 69, in connect
    conn.request(
  File "/usr/local/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/local/lib/python3.11/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ssl.py", line 1075, in _create
    self.do_handshake()
  File "/usr/local/lib/python3.11/ssl.py", line 1346, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:992)
2023-03-26 15:17:37,991 - gmqtt.mqtt.protocol  - INFO    - [CONNECTION MADE]
2023-03-26 15:17:38,011 - gmqtt.mqtt.handler   - DEBUG   - [CMD 0x20] b'\x00\x00\x06"\x00\n!\x00\x14'
2023-03-26 15:17:38,012 - gmqtt.mqtt.handler   - DEBUG   - [CONNACK] flags: 0x0, result: 0x0
2023-03-26 15:17:38,013 - mqtt.MqttClient      - DEBUG   - Subscribing to topics (+/tydom/#)
2023-03-26 15:17:38,014 - gmqtt.mqtt.utils     - DEBUG   - NEW ID: 1
2023-03-26 15:17:38,015 - gmqtt.mqtt.package   - INFO    - [SEND SUB] 1 [b'homeassistant/status']
2023-03-26 15:17:38,016 - gmqtt.mqtt.utils     - DEBUG   - NEW ID: 2
2023-03-26 15:17:38,016 - gmqtt.mqtt.package   - INFO    - [SEND SUB] 2 [b'+/tydom/#']
2023-03-26 15:17:38,017 - gmqtt.client         - DEBUG   - [QoS query IS EMPTY]
2023-03-26 15:17:38,018 - mqtt.MqttClient      - INFO    - Connected to mqtt broker
2023-03-26 15:17:38,023 - gmqtt.mqtt.handler   - DEBUG   - [CMD 0x90] b'\x00\x01\x00\x00'
2023-03-26 15:17:38,024 - gmqtt.mqtt.handler   - INFO    - [SUBACK] 1 (0,)
2023-03-26 15:17:38,024 - gmqtt.mqtt.utils     - DEBUG   - FREE MID: 1
2023-03-26 15:17:38,061 - gmqtt.mqtt.handler   - DEBUG   - [CMD 0x90] b'\x00\x02\x00\x00'
2023-03-26 15:17:38,061 - gmqtt.mqtt.handler   - INFO    - [SUBACK] 2 (0,)
2023-03-26 15:17:38,061 - gmqtt.mqtt.utils     - DEBUG   - FREE MID: 2
2023-03-26 15:17:38,062 - gmqtt.mqtt.handler   - DEBUG   - [CMD 0x31] b'\x005alarm_control_panel/tydom/1655369830_1655369830/state\x00disarmed'
2023-03-26 15:17:38,062 - gmqtt.mqtt.handler   - DEBUG   - [RECV alarm_control_panel/tydom/1655369830_1655369830/state with QoS: 0] b'\x00disarmed'
2023-03-26 15:17:38,062 - gmqtt.mqtt.utils     - DEBUG   - FREE MID: None
2023-03-26 15:17:43,025 - gmqtt.client         - DEBUG   - [QoS query IS EMPTY]
2023-03-26 15:17:48,031 - gmqtt.client         - DEBUG   - [QoS query IS EMPTY]
2023-03-26 15:17:53,038 - gmqtt.client         - DEBUG   - [QoS query IS EMPTY]

damy7 avatar Mar 26 '23 13:03 damy7

Bonjour j ai mis a jour en dernier version mais toujours impossible de se connecter a la tydom voici le log

2023-03-26 20:51:58,562 - The configuration is valid 2023-03-26 20:51:58,563 - tydom.TydomClient - DEBUG - Initializing TydomClient Class 2023-03-26 20:51:58,564 - tydom.TydomClient - INFO - Configure local mode (192.168.1.127) 2023-03-26 20:51:58,569 - asyncio - DEBUG - Using selector: EpollSelector 2023-03-26 20:51:58,571 - mqtt.MqttClient - INFO - Connecting to mqtt broker (host=core-mosquitto, port=1883, user=homeassistant, ssl=False) 2023-03-26 20:51:58,580 - tydom.TydomClient - INFO - Connecting to tydom 2023-03-26 20:52:01,034 - tydom.TydomClient - DEBUG - Response headers 2023-03-26 20:52:01,035 - tydom.TydomClient - DEBUG - Connection: close WWW-Authenticate: Digest realm="Protected Area", qop="auth", nonce="1485feed34c7f2b19ae9b3d36c4cd41b", opaque="8473d1189501b700a0def195e161269b" Content-Type: text/html 2023-03-26 20:52:01,054 - tydom.TydomClient - DEBUG - Response code 2023-03-26 20:52:01,055 - tydom.TydomClient - DEBUG - 401 2023-03-26 20:52:01,055 - tydom.TydomClient - DEBUG - response 2023-03-26 20:52:01,058 - tydom.TydomClient - DEBUG - b'\r\n\r\n

Error 401\r\n\r\n

Error 401

\r\n

Authorization required

\r\n\r\n\r\n' 2023-03-26 20:52:01,059 - tydom.TydomClient - DEBUG - Upgrading http connection to websocket.... 2023-03-26 20:52:01,060 - tydom.TydomClient - DEBUG - Attempting websocket connection with Tydom hub 2023-03-26 20:52:01,112 - websockets.client - DEBUG - = connection is CONNECTING 2023-03-26 20:52:01,115 - gmqtt.mqtt.protocol - INFO - [CONNECTION MADE] 2023-03-26 20:52:01,117 - gmqtt.mqtt.handler - DEBUG - [CMD 0x20] b'\x00\x00\x06"\x00\n!\x00\x14' 2023-03-26 20:52:01,118 - gmqtt.mqtt.handler - DEBUG - [CONNACK] flags: 0x0, result: 0x0 2023-03-26 20:52:01,118 - mqtt.MqttClient - DEBUG - Subscribing to topics (+/tydom/#) 2023-03-26 20:52:01,119 - gmqtt.mqtt.utils - DEBUG - NEW ID: 1 2023-03-26 20:52:01,120 - gmqtt.mqtt.package - INFO - [SEND SUB] 1 [b'homeassistant/status'] 2023-03-26 20:52:01,120 - gmqtt.mqtt.utils - DEBUG - NEW ID: 2 2023-03-26 20:52:01,122 - gmqtt.mqtt.package - INFO - [SEND SUB] 2 [b'+/tydom/#'] 2023-03-26 20:52:01,123 - gmqtt.client - DEBUG - [QoS query IS EMPTY] 2023-03-26 20:52:01,124 - mqtt.MqttClient - INFO - Connected to mqtt broker 2023-03-26 20:52:01,125 - gmqtt.mqtt.handler - DEBUG - [CMD 0x90] b'\x00\x01\x00\x00' 2023-03-26 20:52:01,126 - gmqtt.mqtt.handler - INFO - [SUBACK] 1 (0,) 2023-03-26 20:52:01,126 - gmqtt.mqtt.utils - DEBUG - FREE MID: 1 2023-03-26 20:52:01,126 - gmqtt.mqtt.handler - DEBUG - [CMD 0x90] b'\x00\x02\x00\x00' 2023-03-26 20:52:01,127 - gmqtt.mqtt.handler - INFO - [SUBACK] 2 (0,) 2023-03-26 20:52:01,127 - gmqtt.mqtt.utils - DEBUG - FREE MID: 2 2023-03-26 20:52:03,624 - websockets.client - DEBUG - > GET /mediation/client?mac=001A25066734&appli=1 HTTP/1.1 2023-03-26 20:52:03,625 - websockets.client - DEBUG - > Host: 192.168.1.127 2023-03-26 20:52:03,626 - websockets.client - DEBUG - > Upgrade: websocket 2023-03-26 20:52:03,627 - websockets.client - DEBUG - > Connection: Upgrade 2023-03-26 20:52:03,628 - websockets.client - DEBUG - > Sec-WebSocket-Key: z8VjuzaaLz+Ubn1XClPzwQ== 2023-03-26 20:52:03,628 - websockets.client - DEBUG - > Sec-WebSocket-Version: 13 2023-03-26 20:52:03,628 - websockets.client - DEBUG - > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits 2023-03-26 20:52:03,629 - websockets.client - DEBUG - > Authorization: Digest username="001A25066734", realm="protected area", nonce="1485feed34c7f2b19ae9b3d36c4cd41b", uri="/mediation/client?mac=001A25066734&appli=1", response="7091c583a42cc49ba9669baea6835549", qop="auth", nc=00000001, cnonce="ed63d2d9081f9c04" 2023-03-26 20:52:03,629 - websockets.client - DEBUG - > User-Agent: Python/3.11 websockets/10.4 2023-03-26 20:52:03,641 - websockets.client - DEBUG - < HTTP/1.1 401 Unauthorized 2023-03-26 20:52:03,641 - websockets.client - DEBUG - < Connection: close 2023-03-26 20:52:03,641 - websockets.client - DEBUG - < WWW-Authenticate: Digest realm="Protected Area", qop="auth", nonce="1254299c447a669e6ac238416e344960", opaque="b1fac5514ed22be8cdac0d16ebbbf5ef" 2023-03-26 20:52:03,642 - websockets.client - DEBUG - < Content-Type: text/html 2023-03-26 20:52:03,642 - websockets.client - DEBUG - ! failing connection with code 1006 2023-03-26 20:52:03,643 - websockets.client - DEBUG - x closing TCP connection 2023-03-26 20:52:03,645 - websockets.client - DEBUG - = connection is CLOSED 2023-03-26 20:52:03,646 - tydom.TydomClient - ERROR - Exception when trying to connect with websocket (server rejected WebSocket connection: HTTP 401) 2023-03-26 20:52:03,678 - asyncio - ERROR - Task exception was never retrieved future: <Task finished name='Task-2' coro=<listen_tydom() done, defined at /app/main.py:41> exception=SystemExit(1)> Traceback (most recent call last): File "/app/tydom/TydomClient.py", line 117, in connect self.connection = await websockets.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/websockets/legacy/client.py", line 659, in await_impl_timeout return await asyncio.wait_for(self.await_impl(), self.open_timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/tasks.py", line 479, in wait_for return fut.result() ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/websockets/legacy/client.py", line 666, in await_impl await protocol.handshake( File "/usr/local/lib/python3.11/site-packages/websockets/legacy/client.py", line 332, in handshake raise InvalidStatusCode(status_code, response_headers) websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 401 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever self._run_once() File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once handle._run() File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/app/main.py", line 44, in listen_tydom await tydom_client.connect() File "/app/tydom/TydomClient.py", line 128, in connect sys.exit(1) SystemExit: 1 2023-03-26 20:52:03,717 - asyncio - ERROR - Task was destroyed but it is pending! task: <Task pending name='Task-3' coro=<Client._resend_qos_messages() running at /usr/local/lib/python3.11/site-packages/gmqtt/client.py:181> wait_for=<Future pending cb=[Task.task_wakeup()]>> 2023-03-26 20:52:03,718 - asyncio - ERROR - Task was destroyed but it is pending! task: <Task pending name='Task-5' coro=<MQTTProtocol._read_loop() running at /usr/local/lib/python3.11/site-packages/gmqtt/mqtt/protocol.py:211> wait_for=<Future pending cb=[Task.task_wakeup()]>>

UnetUn avatar Mar 26 '23 18:03 UnetUn