I’m struggling to get my Node-red > Mosquitto > Domoticz communication to work in my new dockerized setup. Before this I had it all working when directly installed on my Odroid M1 device with Ubuntu 22 04 Jammy LTS. But after having to reinstall that two times (after messing things up) I decided it was time for me to dockerize the whole thing. I'm close, but definitely not there.. I hope someone can help me get this to work.
So now I have 3 containers running by setup & config through docker-compose. Domoticz and Node-red are -I think- OK, available and working through their web-interfaces. I’m not sure if Mosquitto is working properly, and I can't find a good way to test if it is running properly. So it could well be that there’s my problem. The other thing that I’m thinking is a cause of failure is the way I may have not properly setup the containers and the links between them. Or maybe a combination, or something else entirely.
For further context: The whole functional idea is that Node-red scrapes a website with weather data from a local weather station, then at the end of the flow it sends the data of all the weatherstation-sensors to dummy devices in Domoticz . What I can now see: Data is (still) successfully scraped in Node-red, the 'MQTT out' node (localhost:1883) is however not connecting to Mosquitto; it status-symbol stays yellow in color (so maybe the Mosquitto container is not working or not properly linked to the node-red container?). In Domoticz under Hardware I have setup the ‘MQTT Client Gateway with LAN interface’ on localhost and port 1883.
For Mosquitto I have created a mosquitto .conf* file with the following content:
Code: Select all
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto .log*
listener 1883
allow_anonymous true
I also tried to get it working with the Aedes (MQTT) node, which seems nice, but I’ve never used before. I got that installed, and I think that was properly working, cause then then the MQTT out node said connected (status-symbol green). But still no data was relayed to Domoticz . So maybe not working at all, or Domoticz container not able to communicate properly with Mosquitto container?
I’m hoping someone can help me out here, or set me on the right track again.
This is my docker-compose .yml* file:
Code: Select all
---
version: "3 .7"*
services:
domoticz:
image: domoticz/domoticz:stable
container_name: domoticz
restart: unless-stopped
devices:
- "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
ports:
- 8080:8080
volumes:
- /mnt/data/docker/domoticz/config:/opt/domoticz/userdata
environment:
- TZ=Europe/Amsterdam
mosquitto:
image: eclipse-mosquitto:2
restart: unless-stopped
ports:
- 1883:1883
volumes:
- /mnt/data/docker/mosquitto/config:/mosquitto/config
- /mnt/data/docker/mosquitto/data:/mosquitto/data
- /mnt/data/docker/mosquitto/log:/mosquitto/log
networks:
- localnet
node-red:
image: nodered/node-red:latest
restart: unless-stopped
environment:
- TZ=Europe/Amsterdam
ports:
- 1880:1880
networks:
- localnet
volumes:
- /mnt/data/docker/node-red/data:/data
links:
- mosquitto
networks:
localnet:
driver: bridge