Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8023

Beginners • Re: Genmon - MQTT - Pi = Broker and HA = Client

$
0
0
i run into similar problems setting up
MOSQUITTO
on RPI recently

finding that my password file has wrong settings ?NOW under TRIXIE?

here show modified setup procedure:

Code:

sudo apt install -y mosquitto mosquitto-clientssudo systemctl enable mosquittosudo mosquitto_passwd -c /etc/mosquitto/pwfile < user>
< password>
< password>

here comes the new part

Code:

sudo chmod 0700 /etc/mosquitto/pwfilesudo chown mosquitto:mosquitto /etc/mosquitto/pwfile
and setup:

Code:

sudo nano /etc/mosquitto/mosquitto.conf
#and add at end:

listener 1883
allow_anonymous false
password_file /etc/mosquitto/pwfile

[ ctrl ][ s ][ ctrl ][ x ]

Code:

sudo systemctl restart mosquitto
OR REBOOT

for check:

Code:

sudo service mosquitto statusjournalctl -xeu mosquitto.servicesudo cat /var/log/mosquitto/mosquitto.log
_____________________

now in terminal can start a client to check on incomming:

Code:

mosquitto_sub -h localhost -u "< user>" -P "< password>" -v -t "#"
and in a second terminal try to send something:

Code:

mosquitto_pub -h localhost -u "< user>" -P "< password>" -t "MY/TOPIC/set" -m "POWERON"
and should see it in the first terminal listening.

Statistics: Posted by PiPlay — Tue Oct 28, 2025 12:52 am



Viewing all articles
Browse latest Browse all 8023

Trending Articles