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

Provide and support a docker image

Open brutella opened this issue 4 years ago • 49 comments

brutella avatar Jun 15 '20 10:06 brutella

I'm running hkknx in Kubernetes and Docker. Feel free to help yourself here: https://github.com/BugRoger/dockerfiles/tree/master/hkknx https://hub.docker.com/r/bugroger/hkknx/tags

It's a multi-arch image that works on both arm and amd64. It's quite minimal with being only 13mb big.

There's a bit of magic to make the arguments configurable via ENV variables. That's easy enough to remove if you don't like that.

BugRoger avatar Jun 25 '20 19:06 BugRoger

So I am running this docker image now on my pi4 but I am not able to connect to my KNX-interface. it just says that the gateway isn't reachable. The check for the bridge state gives "bridge not yet reachable".

@BugRoger maybe its possible that you add some documentation on how to deploy the image in docker? how to persist and how to enable the container to reach the gateway if there is any tweak for that

Any idea why?

Zinski avatar Nov 18 '20 19:11 Zinski

it just says that the gateway isn't reachable.

Sounds like you have general network problems. First try that you can actually reach the gateway from your rpi. Something like: telnet 192.168.0.185 3671

If that works, check if rpi and gateway are they on the same subnet. If not the auto-discovery will not work. You then need to manually configure the IP of your gateway. Do you maybe have cable and wifi connected same time? I faintly remember a problem when HKKNX is bound to multiple interfaces.

If that is all good, put the container in host network mode:

docker run --rm -d --network host --env VERBOSE=true --port 8080 --name hkknx bugroger/hkknx:latest

Do you use a MDT IP Router? I couldn't get mine to work.

The check for the bridge state gives "bridge not yet reachable".

That is odd. Anything in the Docker log when VERBOSE is turned on?

BugRoger avatar Nov 18 '20 20:11 BugRoger

Thanks for the reply.

Telnet works from within the container. Everything is wired and in the same subnet. the pi itself can ping and telnet into the gateway.

Indeed I am using an MDT Interface. Is that the problem???

EDIT: Do you think it's worth trying it with knxd? Although I am not a fan of that.

EDIT 2: I am also not able to add the bridge in homekit. So this communication is also blocked. I am using portainer to maintain my containers on my pi, the container isn't reachable if I set the network to host. Maybe I am missing something here?

Zinski avatar Nov 19 '20 08:11 Zinski

Indeed I am using an MDT Interface. Is that the problem???

Could be. What does the log say? I had panics (crashes) like this:

2020/09/12 10:21:46 sequence number one less than expected
panic: send on closed channel

goroutine 53 [running]:
github.com/brutella/knx/knxnet.(*link).publishMsg(0xc0000fdc00, 0xffb900, 0xc000156180)
	/Users/mah/Source/Code/Go/src/github.com/brutella/knx/knxnet/link.go:221 +0x4d
created by github.com/brutella/knx/knxnet.(*link).GroupRead
	/Users/mah/Source/Code/Go/src/github.com/brutella/knx/knxnet/link.go:208 +0x149
panic: send on closed channel

goroutine 64 [running]:
github.com/brutella/knx/knxnet.(*link).publishMsg(0xc0000fdc00, 0xffb900, 0xc000156700)
	/Users/mah/Source/Code/Go/src/github.com/brutella/knx/knxnet/link.go:221 +0x4d
created by github.com/brutella/knx/knxnet.(*link).GroupRead
	/Users/mah/Source/Code/Go/src/github.com/brutella/knx/knxnet/link.go:208 +0x149

I think, this is due to some bug in the MDT gateway or the knxnet library. As I had another gateway that worked I didn't explorer that further. knxd could work.

I am also not able to add the bridge in homekit. So this communication is also blocked. I am using portainer to maintain my containers on my pi, the container isn't reachable if I set the network to host. Maybe I am missing something here?

I'm not super familiar with Portainer. I would suppose that selecting the host network and publishing all ports will make hkknx available on port 8080 on the rpi's IP. Add VERBOSE=true in the ENV section and check the logs.

BugRoger avatar Nov 19 '20 11:11 BugRoger

DEBUG 2020/11/19 12:47:12 main.go:147: app: dial gateway: no route to 192.168.178.9:3671; retrying in 5s,
DEBUG 2020/11/19 12:47:27 main.go:147: app: dial gateway: no route to 192.168.178.9:3671; retrying in 5s,
DEBUG 2020/11/19 12:47:42 main.go:147: app: dial gateway: no route to 192.168.178.9:3671; retrying in 5s,

these are the logs on a bridge network, on a host network the container isn't available, i cant reach it, neither with it's FQDN nor by ip

EDIT: my bad, sorry! got it to work with my MDT interface and the host network. I haven't changed the port from 8080 to 8090, as I was mapping this port due to 8080 being used by homebridge.

Zinski avatar Nov 19 '20 15:11 Zinski

@BugRoger thanks for the Docker-Image. It is still on 1.1.0. Can I update within the Container? I heard, that this is not the best way.

Joeknx avatar Jan 17 '21 09:01 Joeknx

Hi i´m also looking vor 1.1.2 image... any chance to get an update? Best Thorsten

thorsten-gehrig avatar Jan 30 '21 20:01 thorsten-gehrig

I pushed an update to the burgoger:hkknx image in 1.1.2 and 1.2.0. Thanks for the ping. I didn't notice the update. Enjoy!

BugRoger avatar Jan 30 '21 20:01 BugRoger

Hey @BugRoger could you update your Docker image to the latest 1.2.0 final? It was beta before. Thanks a lot!

Joeknx avatar Mar 14 '21 18:03 Joeknx

+1

thorsten-gehrig avatar Mar 14 '21 21:03 thorsten-gehrig

I don't quite follow. The bugroger/hkknx:1.2.0 image is using the latest release 1.2.0 (2021-01-29T13:13:41+01:00).

As far as I can see that corresponds to the latest release here in Github.

BugRoger avatar Mar 16 '21 11:03 BugRoger

The latest build for version 1.2.0 is 1.2.0 (2021-03-10T12:54:28+01:00).

brutella avatar Mar 16 '21 11:03 brutella

Ok, where do I get it from? The last release here in Github is from 2021-01-27.

BugRoger avatar Mar 16 '21 11:03 BugRoger

Ah, you replaced the assets on the release. I just rebuilt the image.

If you have been running that image before you need to do a docker pull bugroger/hkknx:1.2.0 to bust the Docker cache. Better use bugroger/hkknx:1.2.0-202103161235 to avoid confusion.

BugRoger avatar Mar 16 '21 11:03 BugRoger

Ah, you replaced the assets on the release. I just rebuilt the image.

Correct. As long as the version is marked as pre-release, I just upload new builds. Once the version is final, the assets don't change anymore.

brutella avatar Mar 16 '21 11:03 brutella

Perfect. Thx!

Joeknx avatar Mar 16 '21 12:03 Joeknx

1.3.0(-pre) is available now

BugRoger avatar Apr 18 '21 11:04 BugRoger

1.3.0(-pre) is available now

1.3.0 final is out now. Thx in advance!

Joeknx avatar May 22 '21 18:05 Joeknx

@BugRoger maybe its possible that you add some documentation on how to deploy the image in docker? how to persist and how to enable the container to reach the gateway if there is any tweak for that

@BugRoger is it possible to share some information about persistence?

Zinski avatar Jun 01 '21 06:06 Zinski

push

Joeknx avatar Jun 13 '21 19:06 Joeknx

@BugRoger 1.3.1 is out 😬

Joeknx avatar Jun 20 '21 19:06 Joeknx

Pushed 1.3.1 and 2.0.0(-pre)

@BugRoger is it possible to share some information about persistence?

There's nothing much to it. hkknx writes to /db by default. You have to pass a volume from the host into the container docker run -v /home/zinski/hkknx:/db ...

See: https://hochgatterer.me/de/hkknx/docs/install/rpi-cli/#installation

BugRoger avatar Jun 21 '21 17:06 BugRoger

Will there be an official support be panned, that we could run it on Synology or QNAP NAs?

andreasgapsch avatar Jul 26 '21 12:07 andreasgapsch

docker.io/bugroger/hkknx:2.0.1 pushed

BugRoger avatar Oct 18 '21 19:10 BugRoger

I'd love to see the new releases. Thx!

Joeknx avatar Dec 14 '21 19:12 Joeknx

Is there a full description on how to set up hkknx with Docker?

I found the image but it doesn't work for me on a RPi. Would be great if there would be a documentation somewhere on how to set it up, which ports to handle etc.

Error message is : "standard_init_linux.go:228: exec user process caused: exec format error"

Could just be a comment on hub.docker.com. Would be great.

Thanks!

curana avatar Dec 16 '21 11:12 curana

Pushed bugroger/hkknx:2.1.0 and bugroger/hkknx:2.1.1.

@curana You are trying to start a non-ARM binary. Is this using the bugroger/hkknx:2.1.0 image? Docker automatically picks the right architecture. Don't pass any entrypoint parameters

BugRoger avatar Dec 28 '21 21:12 BugRoger

Yes, using your image. I just followed the comments above and didnt provide any parameters. Thats why I thought you could maybe add like basic steps for your image.

curana avatar Dec 28 '21 22:12 curana

Try bugroger/hkknx:2.1.0 including the version. The latest image somehow is not including the ARM layers

BugRoger avatar Dec 28 '21 22:12 BugRoger

Try bugroger/hkknx:2.1.0 including the version. The latest image somehow is not including the ARM layers

That fixed it for me. Thanks.

curana avatar Dec 30 '21 22:12 curana

Pushed bugroger/hkknx:2.2.0

BugRoger avatar Jan 31 '22 09:01 BugRoger

2.3.1 is out. Thanks in advance!

Joeknx avatar May 21 '22 06:05 Joeknx

If somebody needs the current versions, I provided them, based on the scripts above, on https://hub.docker.com/r/mbrockeu/hkknx/tags for arm64

mbrockeu avatar Aug 04 '22 17:08 mbrockeu