Closed KC-inDomus closed 4 months ago
Hi, thank you for your interest.
The config files always "turn back to the original configuration" because you need to shutdown Matterbridge before.
The file inside and outside are the same.
From the readme.MD: You can edit the config file (shutdown Matterbridge before):
On windows:
cd $HOME\.matterbridge
notepad matterbridge-zigbee2mqtt.config.json
On linux:
cd ~/.matterbridge
nano matterbridge-zigbee2mqtt.config.json
Beside this I tried on my test machine with docker and I reproduced the error you described.
I will update you as soon as I understand...
Yes you're right: the configuration has been made with the Docker container stopped, so when you run it Matterbridge-zsigbee2mqtt should be able to load it up at startup, but it seems not working.
I don't understand if is a mosquitto issue or a docker problem in general ... Try to run Matterbridge standalone.
I don't understand if is a mosquitto issue or a docker problem in general ... Try to run Matterbridge standalone.
It's not a mosquitto issue: the problem is that matterbridge-zigbee2mqtt@docker is not loading user personal, custom configuration, to let application uses the correct broker address/username/password.
Hi, I found the problem. The image is made with Alpine, apparently it cannot resolve names. I made different tests and if you put the ip address it connects from inside like from outside the container. If you stop matterbridge and changes the config, when you start it again it reads the new parameters. So that's all.
I made different tests and if you put the ip address it connects from inside like from outside the container. If you stop matterbridge and changes the config, when you start it again it reads the new parameters.
that's precisely what I tried, but with no results: if you read on top in this thread, I placed the mqtt broker IP in the config: the prolem is that the application in the container seems not reading (and using) this configuration
I have 3 MQTT broker, I switched between each of them running inside docker compose and standalone. It always changed the configuration and connected to the correct MQTT broker. BTW I added a debug in the next release that log the whole config. Any chance that you have an old raspberry arm/v7 or arm/v7? I need to test the image the arch...
Yes, got one. Tomorrow will do some tests
I confirm what @KC-inDomus says. When I edit plugin config file, after a container restart, config file turns to original state and all changes are lost
This is my test... I've just changed the mqtt broker listen port...
snakuzzo@herobox ~/prova/provaAle $ docker exec -it matterbridge sh
/usr/src/app # cat /root/.matterbridge/matterbridge-zigbee2mqtt.config.json | grep port
"port": 1884,
/usr/src/app #
Then...when I restart the container
snakuzzo@herobox ~/prova/provaAle $ docker-compose restart
[+] Restarting 1/1
✔ Container matterbridge Started 5.4s
snakuzzo@herobox ~/prova/provaAle $ docker exec -it matterbridge sh
/usr/src/app # cat /root/.matterbridge/matterbridge-zigbee2mqtt.config.json | grep port
"port": 1883,
/usr/src/app #
My config file is overwrited and I've lost alla changes in my config file
Hi, thank you for your message.
I will try to explain better:
This means that (as reported in the readme.MD) to modify the config you have to:
The command: docker exec -it matterbridge sh that you use implies that the container is running and so whatever you do on the config from inside the container or from outside (there is no difference) will be overwritten on shutdown.
This is the correct sequence:
docker stop matterbridge
cd ~/.matterbridge
nano matterbridge-zigbee2mqtt.config.json
docker start matterbridge
In the next releases will be possible to edit the config from frontend.
Hi,
This is the correct sequence:
docker stop matterbridge
cd ~/.matterbridge nano matterbridge-zigbee2mqtt.config.json
docker start matterbridge
That's what I did, but the config won't load.
I've tried just now... It didn't work. Config file is overwritten
Ok...It works...my mistake. You have to:
If you edit file and then restart container, every change will be lost
So...you have to change file when software is not running
Ok...It works...my mistake. You have to:
- stop container
- change config file
- start container
If you edit file and then restart container, every change will be lost
So...you have to change file when software is not running
yes, same here. Need to STOP, change, START. This could be misleading @Luligu
I'm glad we solved the problem.
Can I ask to make a test please?
The image: luligu/matterbridge:dev is build with a new technique from the 20-bullseye-slim for linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6.
If you have any linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 can you try if it loads?
The dev contains already all the plugins installed (dev too for zigbee2mqtt) so do not install them just add them eventually.
Thanks
On linux/amd64
...
Attaching to matterbridge
matterbridge | exec /usr/local/bin/docker-entrypoint.sh: exec format error
matterbridge exited with code 1
Hi, thanks. With latest it works regularly on the same machine in the same conditions ?
Yes... with latest I have no problems
Hi, can you test again please?
ok...now dev branch starts. I just added plugin (it is already installed, as you said)...but on restart it overwrites mqtt parameters in config file.
Now with the dev you see more info so there is no doubt about config.
Thanks for the test.
Hi, installed Matterbridge using docker with this configuration:
It works. Then, I installed matterbridge-zigbee2mqtt plugin, restarted Matterbridge, and it works too.
Problems arise when trying to configure the plugin. I created a
matterbridge-zigbee2mqtt.config.json
file on the correct path (${HOME}/.matterbridge
) with this contents:The mqtt broker address, username and password are right. When starting, matterbridge-zigbee2mqtt plugin gives:
[08:50:59.846] [Zigbee2MQTT] Error connecting to mqtt://localhost:1883: Connection refused: Not authorized
which suggests that config file hasn't be loaded. After checking paths, contents and so on, I tried several time: every time he uses "localhost" - not the right configuration. So I tried with:
docker exec -it matterbridge sh
and, in /
root/.matterbridge
, I found out thematterbridge-zigbee2mqtt.config.json
which the plusin is using (despite my configuration), with this own contents:so I manually changed this configuration, saved the file, restarted the plugin... and again, "localhost" is used, because the file turns back to the original configuration as above.
No way to make the plugin use a different config. KC