0
0
Raspberry Piprogramming~20 mins

MQTT broker setup (Mosquitto) in Raspberry Pi - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Mosquitto Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
1:00remaining
Mosquitto Broker Default Port
What is the default port number on which the Mosquitto MQTT broker listens for client connections?
A8080
B8883
C80
D1883
Attempts:
2 left
💡 Hint
Think about the standard port used for unencrypted MQTT connections.
Predict Output
intermediate
1:30remaining
Mosquitto Service Status Command
Which command correctly checks the status of the Mosquitto service on a Raspberry Pi running systemd?
Asudo systemctl status mosquitto
Bsudo service mosquitto check
Csudo mosquitto --status
Dsudo systemctl mosquitto status
Attempts:
2 left
💡 Hint
Use the systemctl command with the correct syntax to check service status.
🔧 Debug
advanced
2:00remaining
Mosquitto Configuration File Syntax Error
Given this snippet from a Mosquitto configuration file, what error will Mosquitto report when starting? listener 1883 allow_anonymous true password_file /etc/mosquitto/passwd Options:
Raspberry Pi
listener 1883
allow_anonymous true
password_file /etc/mosquitto/passwd
AError: 'password_file' path not found
BError: Invalid listener option 'password_file'
CNo error, Mosquitto starts normally
DError: 'listener' directive requires a protocol
Attempts:
2 left
💡 Hint
Check which configuration options are valid within a listener context.
🧠 Conceptual
advanced
1:30remaining
Mosquitto Authentication Setup
Which of the following steps is necessary to enable username/password authentication in Mosquitto on Raspberry Pi?
AEnable anonymous access and disable password file
BInstall a separate authentication plugin from the Raspberry Pi repository
CCreate a password file using 'mosquitto_passwd' and reference it in the config
DChange the default port to 8883
Attempts:
2 left
💡 Hint
Think about how Mosquitto manages user credentials by default.
Predict Output
expert
2:30remaining
Mosquitto Broker Log Output
After starting Mosquitto with the command 'mosquitto -v' on Raspberry Pi, which output line indicates the broker is ready and listening on port 1883?
A
"1623456789: mosquitto version 2.0.15 starting"
"1623456789: Opening ipv4 listen socket on port 1883."
B"1623456789: Error: port 1883 already in use"
C"1623456789: mosquitto version 2.0.15 shutting down"
D"1623456789: Client connected from 192.168.1.10"
Attempts:
2 left
💡 Hint
Look for messages about opening sockets and starting version.