Setting up MQTT

I have been digging into tinkering with ESP32 type projects and I'm fumbling through all the info out there. I have all kinds of questions but primarily is out to get Masquitto set up. I have a network connected rpi4 already and I've gone through the tutorials but then I get lost.

Can anyone help me out!?

Have you installed Mosquitto yet?

sudo apt-get update
sudo apt-get install mosquitto

should be sufficient to get mosquitto installed.

3 Likes

Yeah I did that. From there though... really no clue.

Create a hashed password file, and then restart mosquitto. The default location for the file is /etc/mosquitto/passwd

It’s hard to understand how to help without some more specifics.

If you’re following a step-by-step guide, maybe link to that and follow-up with where you’re stuck? Or what error message you’re getting?

I followed the info directly on their site. Everything seems to be in order. I just don't know what happens now.

How do I get the access info (that I assume I need to point stuff to it)?

Is there some kind of GUI?

Any other configuration stuff I need to do?

I literally just installed it and that's as far as I've gone. I think part of the issue is that I don't have a very good grasp of how MQTT works in the first place. I just know I need it a broker of some kind to be able to use it.

You need to create a hashed password file to access it.

No. Mosquitto is just a MQTT broker.

Unless you want mosquitto to bind a different port, there is no other configuration to do. The default port is TCP 1883.

2 Likes

Thank you for this! Everything I had found seemed to be making some basic assumptions. This will be very helpful.

1 Like

Download the free MQTT Explorer software for your PC/Mac. It's invaluable as you can connect to the Mosquitto Server on your Pi and see topics being updated, so you know it's working.

3 Likes