Luci-stats not working (mqtt plugin)

We didn't write the guide. If it's wrong then you need to take it with the person who wrote it and find out from them what you should be doing to rectify the issues.

Or maybe just try creating this folder as well...

1 Like

just asked for advice there, remember this is 1.5 years old issue :exploding_head:

the same issue was discussed here too

while creating the folder ended up with this error

image

mkdir /etc/collectd

done but still no connection to MQTT broker

Seems to work according to mqtt log in HA.

2023-11-24 07:47:19: New connection from 10.0.200.2:43780 on port 1883.

not my ip range on my network

This log entry is from my system showing that the mqtt works as expected.

I am stuck on mqtt now, how to ensure that mqtt is running?

Wed Dec  6 15:51:42 2023 daemon.err collectd[1707]: Exiting normally.
Wed Dec  6 15:51:42 2023 daemon.err collectd[1707]: collectd: Stopping 2 read threads.
Wed Dec  6 15:51:42 2023 daemon.err collectd[1707]: collectd: Stopping 5 write threads.
Wed Dec  6 15:51:42 2023 daemon.err collectd[1707]: rrdtool plugin: Shutting down the queue thread.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: plugin_load: plugin "cpu" successfully loaded.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: plugin_load: plugin "interface" successfully loaded.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: plugin_load: plugin "iwinfo" successfully loaded.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: plugin_load: plugin "load" successfully loaded.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: plugin_load: plugin "memory" successfully loaded.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: plugin_load: plugin "rrdtool" successfully loaded.
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs
Wed Dec  6 15:51:42 2023 daemon.err collectd[9273]: Initialization complete, entering read-loop.

currently installed packages

No, currently installed package.

1 Like

but no mention of mqtt in logs, how do I check collectd-mqtt is running or not?

installed mqttLED and this is how logs look. 192.168.1.1 is not on my network. it seems collectd-mqtt is not working.

Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,237 INFO: MQTT broker host: 192.168.1.1, port: 1883, use tls: False
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,250 WARNING: mt76-phy0 not a valid led name
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,252 WARNING: rt2800soc-phy1::assoc not a valid led name
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,256 WARNING: rt2800soc-phy1::quality not a valid led name
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,258 WARNING: rt2800soc-phy1::radio not a valid led name
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,275 INFO: LED: green-wlan2g subscribed to OpenWRTleds/CustomDevice/green:wlan2g/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,286 INFO: LED: ath9k-phy0 subscribed to OpenWRTleds/CustomDevice/ath9k-phy0/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,294 INFO: LED: green-wan subscribed to OpenWRTleds/CustomDevice/green:wan/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,301 INFO: LED: amber-power subscribed to OpenWRTleds/CustomDevice/amber:power/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,308 INFO: LED: green-usb subscribed to OpenWRTleds/CustomDevice/green:usb/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,320 INFO: LED: green-power subscribed to OpenWRTleds/CustomDevice/green:power/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,328 INFO: LED: blue-wlan5g subscribed to OpenWRTleds/CustomDevice/blue:wlan5g/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,335 INFO: LED: amber-wan subscribed to OpenWRTleds/CustomDevice/amber:wan/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,342 INFO: LED: green-wps subscribed to OpenWRTleds/CustomDevice/green:wps/set
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: 2023-12-13 11:29:29,348 INFO: MQTT LED Control Started
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: Traceback (most recent call last):
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/bin/mqttled", line 8, in <module>
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:     sys.exit(run())
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:              ^^^^^
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/site-packages/mqttled/__main__.py", line 28, in run
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/site-packages/mqttled/ledHost.py", line 129, in run
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/site-packages/paho/mqtt/client.py", line 1742, in loop_forever
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/site-packages/paho/mqtt/client.py", line 1044, in reconnect
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/socket.py", line 851, in create_connection
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]:   File "/usr/lib/python3.11/socket.py", line 836, in create_connection
Wed Dec 13 11:29:29 2023 daemon.err mqttled[2679]: ConnectionRefusedError: [Errno 146] Connection refused

When I start collectd i get the following entries in my log.

Mon Dec 18 10:42:42 2023 daemon.err collectd[19833]: mqtt plugin: publish failed: Connection pending.
Mon Dec 18 10:42:42 2023 daemon.err collectd[19833]: mqtt plugin: successfully reconnected to broker "10.0.200.200:1883"