thkl / hap-homematic

a AddOn for HomeMatic CCU3 (Raspberrymatic) that will bring HomeKit to your CCU
MIT License
220 stars 24 forks source link

Bridges lauschen nur auf IPv6 statt auf IPv4 #658

Closed dkrizic closed 8 months ago

dkrizic commented 8 months ago

I run a CCU3 with RaspberyMatic .71.12.20231020 (current) with HAP-HomeMatic 0.0.63 (current). My CCU has the following interface configuration:

eth0      Link encap:Ethernet  HWaddr B8:27:EB:FE:EF:65  
          inet addr:10.10.0.32  Bcast:10.10.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fefe:ef65/64 Scope:Link
          inet6 addr: fd4d:43b4:7f8:4fbb:ba27:ebff:fefe:ef65/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:256092 errors:0 dropped:3089 overruns:0 frame:0
          TX packets:240966 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:44591905 (42.5 MiB)  TX bytes:154703200 (147.5 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:364269 errors:0 dropped:0 overruns:0 frame:0
          TX packets:364269 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:163220671 (155.6 MiB)  TX bytes:163220671 (155.6 MiB)

And the bridges only listen on the IPv6

root@ccu:~# netstat -anp | grep LISTEN | grep 98
tcp        0      0 0.0.0.0:9875            0.0.0.0:*               LISTEN      1831/node
tcp        0      0 :::9890                 :::*                    LISTEN      1831/node
tcp        0      0 :::9889                 :::*                    LISTEN      1831/node
tcp        0      0 :::9888                 :::*                    LISTEN      1831/node
tcp        0      0 :::9879                 :::*                    LISTEN      1831/node
tcp        0      0 :::9878                 :::*                    LISTEN      1831/node
tcp        0      0 :::9877                 :::*                    LISTEN      1831/node
tcp        0      0 :::9874                 :::*                    LISTEN      1896/hap-homematic-
tcp        0      0 :::9887                 :::*                    LISTEN      1831/node
tcp        0      0 :::9886                 :::*                    LISTEN      1831/node
tcp        0      0 :::9885                 :::*                    LISTEN      1831/node
tcp        0      0 :::9884                 :::*                    LISTEN      1831/node
tcp        0      0 :::9883                 :::*                    LISTEN      1831/node
tcp        0      0 :::9882                 :::*                    LISTEN      1831/node
tcp        0      0 :::9881                 :::*                    LISTEN      1831/node
tcp        0      0 :::9880                 :::*                    LISTEN      1831/node

This leads to the problem, that all my devices are not responding. I recently did an update of RaspberryMatic. I have no IPv6 DHCP server in the the network, those are link local addresses. I think the problem is, that HAP-HomeMatic does not listen on IPv4 only or on both IPv4 and IPv6.

blackbasket commented 8 months ago

Hi @dkrizic ,

it looks normal to me. I have just checked and my metatarsal looks similar, expect additional for Port 9876.

I think to remember, that HomeKit is using IPv6 internally.

Regards, Marcel

dkrizic commented 8 months ago

Sorry, ich habe ausversehen englisch gepostet, ich glaube hier spricht jeder deutsch. Ich habe das Problem, dass die Homebridge Bridges nicht mehr funktionieren ("No Response") und mir ist aufgafallen, dass sie per IPv4 und IPv6 announced werden aber halt eben nur per IPv6 erreichbar sind. Screenshot von iNet Network scanner:

image
blackbasket commented 8 months ago

Kein Thema ;) ich musste aber auch was schmunzeln, dass der Betreff deutsch und der Text englisch war...

Wie dem auch sei... ich glaube noch, dass da ein Problem vorliegt, wie beschrieben... Du kannst die Instanzen doch auch in HomeKit mappen, oder?

dkrizic commented 8 months ago

@blackbasket Also, ich habe gestern eine meine 14 Instanzen gelöscht (aus HomeKit heraus, in HAP-HomeKit redetet) und versucht neu hinzuzufügen: Erst beim dritten mal hat es geklappt, bei den ersten zwei Versuchen konnte er sie nicht kontaktieren. Ich vermute folgendes:

HomeKit versucht zufällig IPv4 (klappt nicht) oder IPv6 (klappt). Daher wäre die Lösung:

Fakt ist: Alle meine Geräte werden nicht aktualisiert. Das ist seit zwei Tagen so und ich bin echt echt verwundert, warum das so ist, weil ich nichts geändert habe.

blackbasket commented 8 months ago

Nun, ggf können ja mal noch ein paar Leute mehr schauen, ob die Bridges auch auf IPv4 hören. Wie gesagt, ist es bei mir auch so, aber ich habe kein Problem. Wann hast du denn die aktuelle RM installiert?

dkrizic commented 8 months ago

Das aktuelle RM habe ich einige Tage vorher aktualisiert. In der Zwischenzeit lief alles normal, bis es auf einmal aufgehört hat. Ich glaube ich habe die CCU mal neu gestartet (musste den Strom abstellen), zieht er eventuell eine neue Version von HAP-HomeMatic? Was anderes kann sich ja nicht geändert haben.

roe1974 commented 8 months ago

Versuch mal HAP-nodejs manuell hochzuziehen auf die aktuelle Version: SSH auf die RM cd /usr/local/addons/hap-homematic/node_modules/hap-homematic npm i hap-nodejs@latest /usr/local/etc/config/rc.d/hap-homematic restart

blackbasket commented 8 months ago

Das aktuelle RM habe ich einige Tage vorher aktualisiert. In der Zwischenzeit lief alles normal, bis es auf einmal aufgehört hat. Ich glaube ich habe die CCU mal neu gestartet (musste den Strom abstellen), zieht er eventuell eine neue Version von HAP-HomeMatic? Was anderes kann sich ja nicht geändert haben.

Update hab's keins, soweit ich weiß...

dkrizic commented 8 months ago
root@ccu:/usr/local/addons/hap-homematic/node_modules/hap-homematic# npm i hap-nodejs@latest
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

added 304 packages, and audited 308 packages in 1m

81 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (2 low, 1 moderate, 2 high, 3 critical)

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New major version of npm available! 9.8.1 -> 10.2.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.2
npm notice Run npm install -g npm@10.2.2 to update!
npm notice 
root@ccu:/usr/local/addons/hap-homematic/node_modules/hap-homematic# /usr/local/etc/config/rc.d/hap-homematic restart

und

tcp        0      0 0.0.0.0:9875            0.0.0.0:*               LISTEN      25308/node
tcp        0      0 :::9888                 :::*                    LISTEN      25308/node
tcp        0      0 :::9889                 :::*                    LISTEN      25308/node
tcp        0      0 :::9890                 :::*                    LISTEN      25308/node
tcp        0      0 :::9874                 :::*                    LISTEN      25331/hap-homematic
tcp        0      0 :::9877                 :::*                    LISTEN      25308/node
tcp        0      0 :::9878                 :::*                    LISTEN      25308/node
tcp        0      0 :::9879                 :::*                    LISTEN      25308/node
tcp        0      0 :::9880                 :::*                    LISTEN      25308/node
tcp        0      0 :::9881                 :::*                    LISTEN      25308/node
tcp        0      0 :::9882                 :::*                    LISTEN      25308/node
tcp        0      0 :::9883                 :::*                    LISTEN      25308/node
tcp        0      0 :::9884                 :::*                    LISTEN      25308/node
tcp        0      0 :::9885                 :::*                    LISTEN      25308/node
tcp        0      0 :::9886                 :::*                    LISTEN      25308/node
tcp        0      0 :::9887                 :::*                    LISTEN      25308/node

aber weiterhin geht es nicht.

dkrizic commented 8 months ago

Ich habe anfangen alle bridges neu zu resetten und es geht teilweise, ich beobachte das mal weiter. Ich mache hier erstmal zu.