brutella / hkknx-public

hkknx is a HomeKit KNX bridge for KNX.
https://hochgatterer.me/hkknx
97 stars 6 forks source link

Issues with KNX Gateway Automatic Discovery since #129 was introduced #208

Closed gregrahn closed 1 year ago

gregrahn commented 1 year ago

With v2.3.0 the KNX Gateway Automatic Discovery works as expected.

pi@homebridge:~/hkknx $ ./hkknx-2.3.0 -db ./database -verbose
INFO 2022/08/24 00:02:25 main.go:79: version 2.3.0 (built at 2022-04-12T16:14:17Z+0200)
INFO 2022/08/24 00:02:25 main.go:221: webpage available at port 8080
INFO 2022/08/24 00:02:28 app.go:333: tunnel: connected to 192.168.18.81:3671 via 1.1.255
DEBUG 2022/08/24 00:02:28 app.go:419: ntp: disabled
DEBUG 2022/08/24 00:02:28 script.go:75: scripts: executing "/temp REST Endpoint"
DEBUG 2022/08/24 00:02:28 io.go:15: read: 0/5/83

However, starting with version 2.3.1-b2 (which coincides with the introduction of #129) auto discovery no longer works for me.

pi@homebridge:~/hkknx $ ./hkknx-2.3.1-b2 -db ./database -verbose
INFO 2022/08/24 00:01:32 main.go:79: version 2.3.1-b2 (built at 2022-07-20T18:27:43Z+0200)
INFO 2022/08/24 00:01:33 main.go:221: webpage available at port 8080
DEBUG 2022/08/24 00:01:36 app.go:329: connect: channel closed
DEBUG 2022/08/24 00:01:40 app.go:329: connect: channel closed
^CINFO 2022/08/24 00:01:44 main.go:214: shutting down...
DEBUG 2022/08/24 00:01:44 app.go:329: connect: channel closed
INFO 2022/08/24 00:01:44 main.go:194: app: stop
INFO 2022/08/24 00:01:44 main.go:227: good bye ;)

Latest bits

pi@homebridge:~/hkknx $ ./hkknx-2.4.1-b2 -db ./database -verbose
INFO 2022/08/24 00:01:56 main.go:79: version 2.4.1-b2 (built at 2022-08-22T16:43:03Z+0200)
INFO 2022/08/24 00:01:56 main.go:221: webpage available at port 8080
DEBUG 2022/08/24 00:01:59 app.go:325: connect: channel closed
DEBUG 2022/08/24 00:02:03 app.go:325: connect: channel closed
DEBUG 2022/08/24 00:02:07 app.go:325: connect: channel closed
DEBUG 2022/08/24 00:02:11 app.go:325: connect: channel closed
^CINFO 2022/08/24 00:02:11 main.go:214: shutting down...
DEBUG 2022/08/24 00:02:15 app.go:325: connect: channel closed
INFO 2022/08/24 00:02:15 main.go:194: app: stop
INFO 2022/08/24 00:02:15 main.go:227: good bye ;)

However, if I manually set the IP and protocol (UDP), then the latest bits work.

pi@homebridge:~/hkknx $ ./hkknx-2.4.1-b2 -db ./database -verbose
INFO 2022/08/24 00:16:07 main.go:79: version 2.4.1-b2 (built at 2022-08-22T16:43:03Z+0200)
INFO 2022/08/24 00:16:07 main.go:221: webpage available at port 8080
INFO 2022/08/24 00:16:07 app.go:329: tunnel: connected to 192.168.18.81:3671 via 1.1.255
DEBUG 2022/08/24 00:16:07 app.go:416: ntp: disabled
DEBUG 2022/08/24 00:16:07 script.go:77: scripts: executing "/temp REST Endpoint"
brutella commented 1 year ago

You are right, version 2.4.0 uses TCP by default for new tunnel connections. I've changed that in 2.4.1-b3 where UDP is used by default.

Only downside is that existing users have to choose UDP in Settings because TCP is already selected for them.