Weather station connection

Yes, every time you deploy with « Client ID » left as node-red, the « Client ID » is regenerated by Node-red to regenerate the « subscribe » and « publish » mqtt to the broker following any changes made to the flow :wink: you can force it by setting a fixed « Client ID » but this pollutes the broker as it maintains the old « subscribe » and « publish » in this case, it’s not a big deal on a small system but I think there must be cases where it’s more significant! :thinking:

@cce66
a bit off topic,
but back to your remark about dinosaurs, I’m a computer dinosaur but I try to evolve while keeping some of the early values of computing…
I started around 1977-78, 15 years old in high school, on a Sinclair ZX81 with BASIC, then moved to TO9, Commodore, and Amstrad PC1512. From 1981 to 1984, I attended the École de l’Air, and in 1984 (due to a flying accident and knee injury), I joined the PTT as a computer scientist (from programmer to project manager two years ago). But computing has always been a passion and a hobby, so I had a double evolution in the subject, private and professional (and in parallel, I did electronics).
So I did assembly, C (at the beginning, between hardware and software, we optimized the code as much as possible to save the smallest byte), then moved to Pascal (which has remained one of my favorites), then VB, Delphi, SQL, R, Ada, Ruby, and recently Python, Rust, PHP, and a lot of exotic languages for the needs of the post office (SAP, …). For Java and JS, I do them but I’m not a fan. I have a soft spot for compiled languages. A big fan of Unix, Linux, and open source, but not at all of Apple… As for Facebook, MS, I use them with the tip of my fingers…, and Google I hate and systematically use alternatives when they exist and work correctly (Qwant, Framagenda, …). In the 1990s, Sun US wanted to recruit me but I didn’t want to go work in the US.
And since retirement (early for health reasons), I spend my time coding (especially in Delphi and Python for AI, and R), doing research, and tinkering…
Well, a bit long and off topic but useful to get to know the character… :wink:

Ah the ZX81, its keyboard, its TV output and its KO of memory! O tempora o mores :thinking: On the other hand, for me it was then the Sinclair QL and its sad microdrives then the Atari 1040 ST (GFA Basic tip top for the time) then the first PC 80286 under Windows 2 with VB DOS etc etc then always PC (because of CAD-CAM)! Yeah… there’s no way about it, we’re dinosaurs but the meteorite that will cause our extinction hasn’t arrived yet! :rofl: :+1:

1 Like

@VonOx @cce66 @pierre-gilles
Almost 8 days of silence since my last installation and configuration issues, but I’ve made progress, so here’s a little update!

After changing the OS (from Ubuntu 21.10 to 20.04 LTS) to get Gladys working (OpenWeather and Telegram were already okay), I had issues with Gladys and MQTT, so I proceeded with a Gladys reinstall (being especially careful about Docker permissions). At first, it worked, then I installed Node-RED (first step, especially with MQTT in (Node-RED view) which was okay, the gateway worked). But there were issues with MQTT out to interface with my station’s API (probably naming issues…).

Then one morning, probably after a system update, panic on board: the MQTT container was constantly looping on startup (probably still a password and permission issue).

After the last exchanges with you which turned out to be fruitless, I took a brute force solution again: I didn’t reinstall the OS but… Docker and its containers, and despite many divergent opinions on the net, it was a hassle: docker rm, rmi… are not enough, physical cleanup of directories and files is necessary!

But I managed it!

Gladys is running on v4, MQTT is also working as well as Node-RED which communicates with Gladys and retrieves my weather data, and in the meantime I received the Sonoff Zigbee2MQTT dongle which is installed and working but…

I will make other posts for the rest (unit, unknown functionality, Lidl Zigbee plug…).

But in the meantime, a small question: is it logical that the Zigbee2MQTT installation creates a second MQTT instance on Docker?

Yes, it’s designed that way

A zigbee2mqtt problem should not impact other integrations and vice versa.

2 Likes

re @VonOx,

since this morning at 10 a.m., I’ve had trouble again on my Gladys server.
I wanted to install watchtower by copying the script available in the Gladys installation help.
And panic, I find myself with 3 mqtt containers (original eclipse-mosquitto, z2m-mqtt installed when I installed my sonoff dongle) and a new z2m-zigbee2mqtt and now these 3 containers do not stop or alternately or simultaneously restart in a loop so problem for my mqtt connections.
Do you have any leads?

sylvain@synapsat10:/var/lib$ docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED        STATUS                           PORTS      NAMES
d2a2c7fcf945   containrrr/watchtower       "/watchtower --clean…"   10 hours ago   Up 20 minutes                    8080/tcp   watchtower
20d4936e7fbf   koenkk/zigbee2mqtt:latest   "docker-entrypoint.s…"   4 days ago     Restarting (1) 6 seconds ago                gladys-z2m-zigbee2mqtt
8fac478a0d4e   eclipse-mosquitto:2         "/docker-entrypoint.…"   4 days ago     Restarting (13) 51 seconds ago              gladys-z2m-mqtt
d835578b4d7f   nodered/node-red            "npm --no-update-not…"   5 days ago     Up 20 minutes (healthy)                     node_red
6b1692e30286   eclipse-mosquitto:2         "/docker-entrypoint.…"   5 days ago     Restarting (13) 56 seconds ago              eclipse-mosquitto
7e73c5b788c5   gladysassistant/gladys:v4   "docker-entrypoint.s…"   5 days ago     Up 20 minutes                               gladys
sylvain@synapsat10:/var/lib$

Thanks for your potential leads

Well, I can’t really help you, the docker ps command just returns the list of containers and their status.

To get help, you need more information (logs).

docker logs CONTAINER-NAME

However, I think your permission issues are not resolved :neutral_face:

Which container log would be the most relevant in your opinion?

Look at the one from « gladys-z2m-mqtt »

Here it is, the last 100 lines

sylvain@synapsat10:/var/lib$ docker logs --tail 100 gladys-z2m-mqtt
1646853967: mosquitto version 2.0.14 starting
1646853967: Config loaded from /mosquitto/config/mosquitto.conf.
1646853967: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646853967: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854039: mosquitto version 2.0.14 starting
1646854039: Config loaded from /mosquitto/config/mosquitto.conf.
1646854039: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854039: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854114: mosquitto version 2.0.14 starting
1646854114: Config loaded from /mosquitto/config/mosquitto.conf.
1646854114: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854114: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854188: mosquitto version 2.0.14 starting
1646854188: Config loaded from /mosquitto/config/mosquitto.conf.
1646854188: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854188: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854260: mosquitto version 2.0.14 starting
1646854260: Config loaded from /mosquitto/config/mosquitto.conf.
1646854260: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854260: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854326: mosquitto version 2.0.14 starting
1646854326: Config loaded from /mosquitto/config/mosquitto.conf.
1646854326: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854326: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854396: mosquitto version 2.0.14 starting
1646854396: Config loaded from /mosquitto/config/mosquitto.conf.
1646854396: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854396: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854474: mosquitto version 2.0.14 starting
1646854474: Config loaded from /mosquitto/config/mosquitto.conf.
1646854474: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854474: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854545: mosquitto version 2.0.14 starting
1646854545: Config loaded from /mosquitto/config/mosquitto.conf.
1646854545: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854545: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854610: mosquitto version 2.0.14 starting
1646854610: Config loaded from /mosquitto/config/mosquitto.conf.
1646854610: Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
1646854610: Error opening password file "/mosquitto/config/mosquitto.passwd".
1646854682: mosquitto version 2.0.14 starting

a bit different with zigbee2mqtt

sylvain@synapsat10:/var/lib$ docker logs --tail 100 gladys-z2m-zigbee2mqtt
Zigbee2MQTT:info  2022-03-09 19:51:11: Starting zigbee-herdsman (0.14.20)
Zigbee2MQTT:info  2022-03-09 19:51:16: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-03-09 19:51:16: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info  2022-03-09 19:51:16: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-03-09 19:51:16: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-03-09 19:51:16: Connecting to MQTT server at mqtt://localhost:1884
Zigbee2MQTT:error 2022-03-09 19:51:17: MQTT failed to connect: connect ECONNREFUSED 127.0.0.1:1884
Zigbee2MQTT:error 2022-03-09 19:51:17: Exiting...
Zigbee2MQTT:info  2022-03-09 19:51:17: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-03-09 19:51:29: Stopped zigbee-herdsman
Using '/app/data' as data directory
Zigbee2MQTT:info  2022-03-09 19:51:56: Logging to console and directory: '/app/data/log/2022-03-09.19-51-50' filename: log.txt
Zigbee2MQTT:info  2022-03-09 19:51:57: Starting Zigbee2MQTT version 1.24.0 (commit #7a2ddf2)
Zigbee2MQTT:info  2022-03-09 19:51:57: Starting zigbee-herdsman (0.14.20)
Zigbee2MQTT:info  2022-03-09 19:51:59: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-03-09 19:51:59: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info  2022-03-09 19:51:59: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-03-09 19:51:59: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-03-09 19:51:59: Connecting to MQTT server at mqtt://localhost:1884
Zigbee2MQTT:error 2022-03-09 19:52:00: MQTT failed to connect: connect ECONNREFUSED 127.0.0.1:1884
Zigbee2MQTT:error 2022-03-09 19:52:00: Exiting...
Zigbee2MQTT:info  2022-03-09 19:52:00: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-03-09 19:52:11: Stopped zigbee-herdsman
Using '/app/data' as data directory
Zigbee2MQTT:info  2022-03-09 19:52:23: Logging to console and directory: '/app/data/log/2022-03-09.19-52-19' filename: log.txt
Zigbee2MQTT:info  2022-03-09 19:52:23: Starting Zigbee2MQTT version 1.24.0 (commit #7a2ddf2)
Zigbee2MQTT:info  2022-03-09 19:52:23: Starting zigbee-herdsman (0.14.20)
Zigbee2MQTT:info  2022-03-09 19:52:25: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-03-09 19:52:25: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info  2022-03-09 19:52:25: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-03-09 19:52:25: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-03-09 19:52:25: Connecting to MQTT server at mqtt://localhost:1884
Zigbee2MQTT:error 2022-03-09 19:52:26: MQTT failed to connect: connect ECONNREFUSED 127.0.0.1:1884
Zigbee2MQTT:error 2022-03-09 19:52:26: Exiting...
Zigbee2MQTT:info  2022-03-09 19:52:26: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-03-09 19:52:37: Stopped zigbee-herdsman
Using '/app/data' as data directory
Zigbee2MQTT:info  2022-03-09 19:52:51: Logging to console and directory: '/app/data/log/2022-03-09.19-52-46' filename: log.txt
Zigbee2MQTT:info  2022-03-09 19:52:51: Starting Zigbee2MQTT version 1.24.0 (commit #7a2ddf2)
Zigbee2MQTT:info  2022-03-09 19:52:51: Starting zigbee-herdsman (0.14.20)
Zigbee2MQTT:info  2022-03-09 19:52:53: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-03-09 19:52:53: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20210708,"transportrev":2},"type":"zStack3x0"}'
Zigbee2MQTT:info  2022-03-09 19:52:53: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-03-09 19:52:53: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-03-09 19:52:54: Connecting to MQTT server at mqtt://localhost:1884
Zigbee2MQTT:error 2022-03-09 19:52:54: MQTT failed to connect: connect ECONNREFUSED 127.0.0.1:1884
Zigbee2MQTT:error 2022-03-09 19:52:54: Exiting...
Zigbee2MQTT:info  2022-03-09 19:52:54: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-03-09 19:53:05: Stopped zigbee-herdsman
Using '/app/data' as data directory

Permission issue :grimacing: I’m not sure what happened on your OS..

Edit: yes of course zigbee2mqtt can’t connect to the mqtt container (since it doesn’t start)

The watchtower installation can’t be a possible cause? Apparently, the MQTT instances’ reboot loop issue has reappeared this morning around 10 AM.

@VonOx,
I just did a test.
I stopped all the Docker containers.
I modified the permissions of the /var/lib/docker directory by setting it to 775 (it had dropped back to 740! This happens regularly with Ubuntu updates… why?)
Then I restarted the containers in the following order: gladys, eclipse-mosquitto, and nodered.
The last two containers, zigbee and zigbee2mqtt, restarted on their own after nodered restarted.
And now it seems to be holding.
On the other hand, I did not restart wathwatcher.
If my manipulation can provide clues or help…