I am trying to move my openHAB installation from Openhabian to a docker based solution on RPI3B.
I have created all the containers that I need for now and started them with “docker run”. All seems to work OK. Now I am trying to build a docker-compose file and I cannot get it to work. Here is the “docker run” command that does work (I have created a bridged network (“openhabnet”) to which I connect all the containers for home automation):
I do not understand why this happens. The user-id and group-id do exist on the docker-host. It seems to be related to the access rights but cannot figure it out.
Thanks a lot. Sometimes one is just blind when reveiwing own work.
This was spot on: when I removed user: "${UID}:${GID}" from the docker-compose file it started work.
This line got introduced because I tried to start openHAB and Mosquitto together and I added this line to the wrong section. And for some reason I overlooked it all the time after I removed the Mosquitto part for trouble shooting
Now all seems to work. For Mosquitto I am providing user ID and group ID via variables and decided to do this also for the openhab user environment variables.
I start now docker-compose with this line (put in a script):
Nice that it works now! I also have a secondary OH instance running on a RPi3B with Docker. Some think Docker is too heavy for a RPi3B but I think they’ve never tried it.
Thanks for the hint. I just read about hypriot. I am considering to install a second zigbee2mqtt gateway. This would be perfect for testing hypriot.
I started with RPi3B (booting from SSD) to get to know docker and try it out. Today I got my docker-compose file working that starts:
openHAB
Mosquitto
InfluxDB
Grafana
Node-RED
zigbee2mqtt
zigbee2mqtt Assistant
(unfortunately I cannot get the tellstick to mqtt to work)
There is almost nothing configured yet. Just some items to verify that the system works. I will start moving things over one-by-one when I have some time and will check the load then. I just had a look using top and the RPi is mostly idling with less than 10% CPU load. At some point it was peaking at 25%. If the performance becomes a problem I will move to a RPi4 or put it on my NAS that I still need to reinstall. The RPi3B was available for playing around with and is working really well so far. I am quite impressed by the it.
all containers areconnected to the customer bridge “openhabnet”
I am using aliases to connect the machines to each other
the RPi has several IP addresses and I expose different ports to different IP addresses (e.g. I have one network for my sensors so Mosquitto is connected to that one). This can, of course, easily be changed.
ports needed only within the openhabnet are not exposed (e.g. influxdb)
I just got it to work and it seems to work. But it is not thoroughly tested. I hope this helps someone. It took me quite a while to figure it all out (for example on how to handle the different IP addresses which are on different VLANs on the single Ethernet interface (the network config is not shown here though) and to map the containers to it).
I tested today moving my installation to another RPi3 (installing a fresh Raspbian and transfer my backup) and got an error when executing docker-compose. I needed to change the line
image: "koenkk/zigbee2mqtt:arm32v6"
to
image: "koenkk/zigbee2mqtt:latest"
Then it worked fine. There seem to have been some recent changes.
I declared the serial option in configuration.yaml.
I also had to change the serial device from /dev/ttyACM0 to /dev/ttyAMA0 on the physical (left) side of the equation: