0
0
Raspberry Piprogramming~10 mins

MQTT broker setup (Mosquitto) in Raspberry Pi - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to install Mosquitto on Raspberry Pi.

Raspberry Pi
sudo apt-get [1] mosquitto
Drag options to blanks, or click blank then click option'
Aremove
Binstall
Cupdate
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' instead of 'install' will uninstall packages.
Using 'update' only refreshes package lists, does not install.
2fill in blank
medium

Complete the command to start the Mosquitto service.

Raspberry Pi
sudo systemctl [1] mosquitto
Drag options to blanks, or click blank then click option'
Astop
Brestart
Cdisable
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' will turn off the service.
Using 'disable' prevents the service from starting automatically.
3fill in blank
hard

Fix the error in the command to check Mosquitto service status.

Raspberry Pi
sudo systemctl [1] mosquitto
Drag options to blanks, or click blank then click option'
Astate
Binfo
Cstatus
Dstat
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stat' or 'state' are not valid systemctl commands.
Using 'info' will cause an error.
4fill in blank
hard

Fill both blanks to create a Mosquitto configuration file that allows anonymous connections and sets the listener port to 1883.

Raspberry Pi
allow_anonymous [1]
listener [2]
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C1883
D8883
Attempts:
3 left
💡 Hint
Common Mistakes
Setting allow_anonymous to false blocks anonymous clients.
Using port 8883 is for secure MQTT, not default.
5fill in blank
hard

Fill all three blanks to write a command that restarts Mosquitto and checks its status.

Raspberry Pi
sudo systemctl [1] mosquitto && sudo systemctl [2] mosquitto && sudo systemctl [3] mosquitto
Drag options to blanks, or click blank then click option'
Astop
Bstart
Cstatus
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using stop instead of restart will turn off the service.
Skipping status means you won't see if it started correctly.