mgcrea / homebridge-tydom

Homebridge plugin to manage Tydom hardware by Delta Dore from Apple HomeKit.
63 stars 14 forks source link

Bug connexion Homebridge <-> TYDOM #69

Closed Karamazow closed 2 years ago

Karamazow commented 2 years ago

Describe the bug

Bonjour, je viens de terminer l'installation de HomeBridge sur mon Raspberry B+ de base, fonctionnant sous Raspbian. L'O.S. Raspbian est complètement à jour sur tous les services de base. Sur ce Raspberry je fais déjà fonctionner PiHole pour filtrer les publicités sur mes appareils connectés à Internet depuis mon domicile.

Related hardware

TYBOX 1.0

Expected behavior

Connexion au pont dans l'application "Maison" de l'iPhone.

Logs

(j'ai anonymisé le username)

[27/10/2021, 13:55:21] Homebridge v1.3.5 (Homebridge 8428) is running on port 51099. 2021-10-27T11:55:22.016Z homebridge-tydom Connecting to hostname='mediation.tydom.com'... [27/10/2021, 13:55:23] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [27/10/2021, 13:55:23] [Tydom] Failed to connect to Tydom hostname=mediation.tydom.com with username="001A25____-" (node:6299) UnhandledPromiseRejectionWarning: Error: Unexpected server response: 401 at ClientRequest. (/usr/local/lib/node_modules/homebridge-tydom/node_modules/ws/lib/websocket.js:716:7) at ClientRequest.emit (events.js:400:28) at HTTPParser.parserOnIncomingClient (_http_client.js:647:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17) at TLSSocket.socketOnData (_http_client.js:515:22) at TLSSocket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:293:12) at readableAddChunk (internal/streams/readable.js:267:9) at TLSSocket.Readable.push (internal/streams/readable.js:206:10) at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23) (Use node --trace-warnings ... to show where the warning was created) (node:6299) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:6299) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [27/10/2021, 13:55:28] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [27/10/2021, 13:55:46] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [27/10/2021, 13:56:51] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [27/10/2021, 14:01:08] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'"

Karamazow commented 2 years ago

Hier j'ai réinstallé le raspberry avec une raspbian intégrant de base Homebridge, et sans le service PiHole pour être certain d'avoir une "fresh install".

J'ai toujours le même problème, que je mette l'adresse IP Local du TYDOM, ou l'URL mediation.tydom.com [29/10/2021, 09:52:03] Homebridge v1.3.5 (Homebridge A248) is running on port 51398. [29/10/2021, 09:52:11] [Tydom] Disconnected from Tydom hostname='192.168.0.96'" [29/10/2021, 09:52:11] [Tydom] Failed to connect to Tydom hostname=192.168.0.96 with username="001A25xxxxXX" (node:826) UnhandledPromiseRejectionWarning: Error: self signed certificate at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34) at TLSSocket.emit (events.js:400:28) at TLSSocket._finishInit (_tls_wrap.js:937:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12) (Use node --trace-warnings ... to show where the warning was created) (node:826) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:826) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [29/10/2021, 09:52:17] [Tydom] Disconnected from Tydom hostname='192.168.0.96'" [29/10/2021, 09:52:34] [Tydom] Disconnected from Tydom hostname='192.168.0.96'" [29/10/2021, 09:53:40] [Tydom] Disconnected from Tydom hostname='192.168.0.96'"

Karamazow commented 2 years ago

Bonsoir,

Je viens de terminer une nouvelle "fresh-install" de mon Raspberry Pi (modèle 1 B+) avec :

Malheureusement je n'arrive toujours pas à m'y connecter.

Voici ci-dessous le rapport du journal de connexion. A noter que cette fois-ci le Homebridge redémarre en boucle infinie le processus de connexion au plugin Tydom: j'ai du l'interrompre et désactiver le plugin pour mettre fin à cette boucle.

[02/11/2021, 22:18:22] [Homebridge UI] Running Command: sudo -E -n npm install -g homebridge-tydom@latest [02/11/2021, 22:26:30] [Homebridge UI] Changes to config.json saved. [02/11/2021, 22:26:50] [Homebridge UI] Homebridge restart request received [02/11/2021, 22:26:51] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process [02/11/2021, 22:26:51] [Homebridge UI] Sending SIGTERM to Homebridge [02/11/2021, 22:26:51] Got SIGTERM, shutting down Homebridge... [02/11/2021, 22:26:56] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2021, 22:27:01] [HB Supervisor] Restarting Homebridge... [02/11/2021, 22:27:01] [HB Supervisor] Starting Homebridge with extra flags: -I -D [02/11/2021, 22:27:01] [HB Supervisor] Started Homebridge v1.3.5 with PID: 22087 Initializing HAP-NodeJS v0.9.6... [02/11/2021, 22:27:15] Loaded config.json with 0 accessories and 2 platforms. [02/11/2021, 22:27:16] Loaded 0 cached accessories from cachedAccessories. [02/11/2021, 22:27:16] --- [02/11/2021, 22:27:31] Loaded plugin: homebridge-config-ui-x@4.41.2 [02/11/2021, 22:27:31] Registering platform 'homebridge-config-ui-x.config' [02/11/2021, 22:27:31] --- [02/11/2021, 22:27:36] Loaded plugin: homebridge-tydom@0.21.9 [02/11/2021, 22:27:36] Registering platform 'homebridge-tydom.Tydom' [02/11/2021, 22:27:36] --- [02/11/2021, 22:27:36] Loading 2 platforms... [02/11/2021, 22:27:36] [Config] Initializing config platform... [02/11/2021, 22:27:36] [Config] Running in Service Mode [02/11/2021, 22:27:36] [Tydom] Initializing Tydom platform... [02/11/2021, 22:27:36] [Tydom] Creating tydom client with username='001A25xxxxXX' and hostname='mediation.tydom.com' Preparing Advertiser for 'Homebridge XXXX XXXX' using bonjour-hap backend! Setup Payload: X-HM://xxxxxxxxxxxxxxxxxx Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ XXX-XX-XXX │     
└────────────┘     

Starting to advertise 'Homebridge XXXX XXXX' using bonjour-hap backend! [02/11/2021, 22:27:37] Homebridge v1.3.5 (Homebridge XXXX) is running on port 51078. [02/11/2021, 22:27:42] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [02/11/2021, 22:27:42] [Tydom] Failed to connect to Tydom hostname=mediation.tydom.com with username="001A25XXXXX" [02/11/2021, 22:27:42] Error: Unexpected server response: 401 at ClientRequest. (/usr/local/lib/node_modules/homebridge-tydom/node_modules/ws/lib/websocket.js:716:7) at ClientRequest.emit (node:events:390:28) at HTTPParser.parserOnIncomingClient (node:_http_client:623:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17) at TLSSocket.socketOnData (node:_http_client:487:22) at TLSSocket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at TLSSocket.Readable.push (node:internal/streams/readable:234:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:199:23) [02/11/2021, 22:27:42] Got SIGTERM, shutting down Homebridge... [02/11/2021, 22:27:47] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2021, 22:27:52] [HB Supervisor] Restarting Homebridge... [02/11/2021, 22:27:52] [HB Supervisor] Starting Homebridge with extra flags: -I -D [02/11/2021, 22:27:52] [HB Supervisor] Started Homebridge v1.3.5 with PID: 22123 Initializing HAP-NodeJS v0.9.6... [02/11/2021, 22:28:06] Loaded config.json with 0 accessories and 2 platforms. [02/11/2021, 22:28:07] Loaded 0 cached accessories from cachedAccessories. [02/11/2021, 22:28:07] --- [02/11/2021, 22:28:22] Loaded plugin: homebridge-config-ui-x@4.41.2 [02/11/2021, 22:28:22] Registering platform 'homebridge-config-ui-x.config' [02/11/2021, 22:28:22] --- [02/11/2021, 22:28:26] Loaded plugin: homebridge-tydom@0.21.9 [02/11/2021, 22:28:26] Registering platform 'homebridge-tydom.Tydom' [02/11/2021, 22:28:26] --- [02/11/2021, 22:28:26] Loading 2 platforms... [02/11/2021, 22:28:26] [Config] Initializing config platform... [02/11/2021, 22:28:26] [Config] Running in Service Mode [02/11/2021, 22:28:26] [Tydom] Initializing Tydom platform... [02/11/2021, 22:28:26] [Tydom] Creating tydom client with username='001A25xxxxXX' and hostname='mediation.tydom.com' Preparing Advertiser for 'Homebridge XXX XXXX' using bonjour-hap backend! Setup Payload: X-HM://xxxxxxxxxxxxxxx Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ XXX-XX-XXX │     
└────────────┘     

Starting to advertise 'Homebridge XXXX XXXX' using bonjour-hap backend! [02/11/2021, 22:28:27] Homebridge v1.3.5 (Homebridge 5395) is running on port 51078. [02/11/2021, 22:28:32] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [02/11/2021, 22:28:32] [Tydom] Failed to connect to Tydom hostname=mediation.tydom.com with username="001A25XXXXX" [02/11/2021, 22:28:32] Error: Unexpected server response: 401 at ClientRequest. (/usr/local/lib/node_modules/homebridge-tydom/node_modules/ws/lib/websocket.js:716:7) at ClientRequest.emit (node:events:390:28) at HTTPParser.parserOnIncomingClient (node:_http_client:623:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17) at TLSSocket.socketOnData (node:_http_client:487:22) at TLSSocket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at TLSSocket.Readable.push (node:internal/streams/readable:234:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:199:23) [02/11/2021, 22:28:32] Got SIGTERM, shutting down Homebridge... [02/11/2021, 22:28:37] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2021, 22:28:42] [HB Supervisor] Restarting Homebridge...

Karamazow commented 2 years ago

Bonsoir,

Je m'interroge sur le fait que peut être le bug proviendrait du fait que j'utilise un Raspberry Pi 1 B, c'est à dire un modèle qui n'est plus suivi officiellement pour ce qui concerne les paquets de Node

Est-ce qu'il ne faudrait pas que j'achète un Raspberry plus récent (un modèle 3 ou 4) pour que Homebridge et tous les paquets utilisés pour ce logiciel fonctionnent correctement ?

Merci pour votre aide

Quitsoon commented 2 years ago

Bonjour,

Je me retrouve avec sensiblement la même erreur sur homebridge docker. Idem en testant npx tydom-client. J'ai tenté de changer plusieurs fois mon mots de passe mais sans changement. Est-ce que certain caractères spéciaux sont à éviter ?

version logiciel tydom 02.09.13

[12/7/2021, 7:20:00 PM] Homebridge v1.3.8 (HAP v0.9.7) (Homebridge 28D8) is running on port 52071. 2021-12-07T18:20:00.275Z tydom-client About to GET request with url='https://mediation.tydom.com/mediation/client?mac=001A25XXXXX&appli=1' 2021-12-07T18:20:00.486Z tydom-client Attempting to open new socket for hostname='mediation.tydom.com' 2021-12-07T18:20:00.714Z tydom-client Tydom socket error for hostname='mediation.tydom.com' 2021-12-07T18:20:00.714Z tydom-client Tydom socket closed for hostname='mediation.tydom.com' [12/7/2021, 7:20:00 PM] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [12/7/2021, 7:20:00 PM] [Tydom] Failed to connect to Tydom hostname=mediation.tydom.com with username="001A25XXXXX" [12/7/2021, 7:20:00 PM] Error: Unexpected server response: 401 at ClientRequest. (/homebridge/node_modules/homebridge-tydom/node_modules/ws/lib/websocket.js:728:7) at ClientRequest.emit (node:events:390:28) at HTTPParser.parserOnIncomingClient (node:_http_client:623:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17) at TLSSocket.socketOnData (node:_http_client:487:22) at TLSSocket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at TLSSocket.Readable.push (node:internal/streams/readable:228:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:199:23) 2021-12-07T18:20:00.717Z tydom-client Configuring socket reconnection timeout of ~4s [12/7/2021, 7:20:00 PM] Got SIGTERM, shutting down Homebridge...

Merci

mgcrea commented 2 years ago

Hello, la piste des caractères spéciaux est intéressante, ça vaudrait le coup de tester avec une version encodée du mot de passe, par ex (via node ou dans l'inspecteur d'un browser):

node -e 'console.log(encodeURIComponent("Passw#"))'

-> Passw%23

Sinon confirmer le bug en utilisant un mot de passe sans caractères spéciaux.

Quitsoon commented 2 years ago

J'ai essayé d'enlever le caractère spécial ainsi que de raccourcir le mots de passe (1 Majuscule, 1 Chiffre, 6 Minuscule). Mais que ce soit sur mediation.tydom.com ou l'ip du tydom 1.0, toujours la même erreur 401. Que ce soit sur homebridge docker ou directement en utilisant npx tydom-client.

mgcrea commented 2 years ago

Une piste possible est de regarder (sniffer) l'handshake de connexion utilisée par l'app mobile avec un proxy pour voir si il y a un mot de passe, par exemple en utilisant CharlesProxy sur iOS, activer le proxy puis killer et relance l'application.

Karamazow commented 2 years ago

Bonsoir / Bonjour,

Merci pour votre aide, j'ai bon espoir d'y arriver avec vous 👍

Je viens de faire les dernières mises à jour de Homebridge, Homebridge UI, et du plugin Homebridge Tydom. J'ai changé le mot de passe pour une version à 8 caractères, sans majuscules, uniquement minuscules et chiffres.

Et malheureusement j'ai toujours le défaut de connexion. Voici le log:

[19/12/2021, 13:15:11] Homebridge v1.3.8 (HAP v0.9.7) (Homebridge 5395) is running on port 51078. 2021-12-19T12:15:11.432Z homebridge-tydom Connecting to hostname='mediation.tydom.com'... [19/12/2021, 13:15:20] [Tydom] Disconnected from Tydom hostname='mediation.tydom.com'" [19/12/2021, 13:15:20] [Tydom] Failed to connect to Tydom hostname=mediation.tydom.com with username="001A25xxxxXx" [19/12/2021, 13:15:20] Error: Unexpected server response: 401 at ClientRequest. (/usr/local/lib/node_modules/homebridge-tydom/node_modules/ws/lib/websocket.js:728:7) at ClientRequest.emit (node:events:390:28) at HTTPParser.parserOnIncomingClient (node:_http_client:623:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17) at TLSSocket.socketOnData (node:_http_client:487:22) at TLSSocket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at TLSSocket.Readable.push (node:internal/streams/readable:234:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:199:23) [19/12/2021, 13:15:20] Got SIGTERM, shutting down Homebridge... [19/12/2021, 13:15:30] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [19/12/2021, 13:15:35] [HB Supervisor] Restarting Homebridge...

Je vais essayer de récupérer les logs de connexion de l'application iOS avec une appli tierce. Je n'ai pas pris CharlesProxy car c'est payant, alors juste pour un usage... j'ai trouvé Proxyman qui est gratuit. On va voir si j'arrive à l'utiliser !

Quitsoon commented 2 years ago

Salut ! Regarde ici : https://github.com/mgcrea/homebridge-tydom/issues/72 Même problème et tu dispose de deux solutions, soit retrouver le mdp via une app comme Charles Proxy, ou essayer de le modifier avec une ancienne version de l’appli android.

Karamazow commented 2 years ago

Salut ! Regarde ici : #72 Même problème et tu dispose de deux solutions, soit retrouver le mdp via une app comme Charles Proxy, ou essayer de le modifier avec une ancienne version de l’appli android.

Yes, merci beaucoup ! J'ai enfin réussi à récupérer le mot de passe en utilisant l'application Proxyman et vos indications détaillées, vous êtes au TOP !

Par contre, si j'ai bien l'interface Homebridge qui contient mes accessoires DELTADORE, je n'arrive pas à ajouter le TYDOM 1.0 en tant que concentrateur dans l'application Maison de mon iPhone: j'ai une erreur de délai d'appairage dépassée dans l'application Maison: je vais chercher ça sur Internet quand j'aurai un peu de temps.

StephanH27 commented 2 years ago

Ce n'est pas Tydom qu'il faut ajouter, mais HomeBridge ! à partir du QR Code que tu vois sur sa page d'accueil. Le principe de HomeBridge est de faire passer des accessoires non compatibles HomeKit (comme le tydom) comme étant compatibles.

Karamazow commented 2 years ago

Ce n'est pas Tydom qu'il faut ajouter, mais HomeBridge ! à partir du QR Code que tu vois sur sa page d'accueil. Le principe de HomeBridge est de faire passer des accessoires non compatibles HomeKit (comme le tydom) comme étant compatibles.

Oui je me suis mal exprimé effectivement c'est bien en scannant le QRCode.

J'ai redémarré le Homebridge, sans succès pour l'instant. Je cherche la solution sur Internet

Karamazow commented 2 years ago

Bonjour à tous,

Après de longues heures de tentatives d’installation sur mon raspberry Pi 1b, je pense qu’il est temps de déclarer forfait sur ce modèle de Raspberry : plusieurs outils nécessaires au fonctionnement de Homebridge ne sont plus officiellement supportés sur cette génération de Raspberry.

À contrario, je viens de faire une installation sans difficultés sur un Raspberry Pi4, preuve supplémentaire que le premier modèle de Raspberry n’est plus compatible.