Recall & Review
beginner
What is Mosquitto in the context of MQTT?
Mosquitto is a lightweight MQTT broker that manages message exchange between devices using the MQTT protocol.
Click to reveal answer
beginner
Which command installs Mosquitto on a Raspberry Pi running Raspberry Pi OS?
Use
sudo apt update followed by sudo apt install mosquitto mosquitto-clients to install Mosquitto and its clients.Click to reveal answer
beginner
How do you start the Mosquitto service and enable it to run on boot?
Run
sudo systemctl start mosquitto to start and sudo systemctl enable mosquitto to enable it at boot.Click to reveal answer
beginner
What is the default port Mosquitto listens on for MQTT connections?
Mosquitto listens on port 1883 by default for MQTT client connections.
Click to reveal answer
beginner
How can you test if Mosquitto broker is working on your Raspberry Pi?
Use
mosquitto_sub -h localhost -t test/topic in one terminal to subscribe, and mosquitto_pub -h localhost -t test/topic -m "Hello" in another to publish a message. If the subscriber shows the message, the broker works.Click to reveal answer
Which command installs Mosquitto on Raspberry Pi?
✗ Incorrect
The correct command to install Mosquitto and its clients is 'sudo apt install mosquitto mosquitto-clients'.
What port does Mosquitto use by default for MQTT?
✗ Incorrect
Mosquitto listens on port 1883 by default for MQTT connections.
How do you enable Mosquitto to start automatically on boot?
✗ Incorrect
Use 'sudo systemctl enable mosquitto' to enable Mosquitto service at boot.
Which command subscribes to a topic 'test/topic' on local Mosquitto broker?
✗ Incorrect
The 'mosquitto_sub' command subscribes to a topic; here it listens to 'test/topic'.
What is the role of Mosquitto in MQTT communication?
✗ Incorrect
Mosquitto acts as a broker that manages message delivery between MQTT clients.
Explain the steps to install and start Mosquitto broker on a Raspberry Pi.
Think about commands using apt and systemctl.
You got /4 concepts.
Describe how to test if your Mosquitto broker is working correctly on your Raspberry Pi.
Use two terminal windows for testing publish and subscribe.
You got /3 concepts.