hkknx-public icon indicating copy to clipboard operation
hkknx-public copied to clipboard

Issues with KNX Gateway Automatic Discovery since #129 was introduced

Open gregrahn opened this issue 2 years ago • 1 comments

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"

gregrahn avatar Aug 23 '22 21:08 gregrahn

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.

brutella avatar Aug 24 '22 20:08 brutella