Challenge - 5 Problems
MQTT Control Command Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output when subscribing to a control topic with QoS 1?
You subscribe to the MQTT topic
device/control with QoS level 1. The broker sends a retained message with payload ON. What will the client receive?IOT Protocols
client.subscribe('device/control', qos=1) # Broker sends retained message 'ON' on 'device/control'
Attempts:
2 left
💡 Hint
QoS 1 guarantees message delivery at least once with acknowledgment.
✗ Incorrect
QoS 1 ensures the client receives the message at least once and sends PUBACK to confirm receipt. Retained messages are sent immediately upon subscription.
❓ Configuration
intermediate2:00remaining
Which MQTT client configuration enables automatic resubscription after reconnect?
You want your MQTT client to automatically resubscribe to control topics after a network reconnect. Which configuration option should you enable?
Attempts:
2 left
💡 Hint
Session persistence controls subscription retention.
✗ Incorrect
Setting
clean_session to false tells the broker to keep the session and subscriptions after disconnect, enabling automatic resubscription.❓ Troubleshoot
advanced2:00remaining
Why does the client not receive control commands after reconnect?
An MQTT client subscribes to
device/control with QoS 1 and clean_session=true. After a network drop and reconnect, the client does not receive any control commands sent during offline. Why?Attempts:
2 left
💡 Hint
Check session persistence settings.
✗ Incorrect
With
clean_session=true, the broker deletes the session and subscriptions on disconnect, so the client must resubscribe manually after reconnect to receive messages.🔀 Workflow
advanced2:00remaining
Order the steps for subscribing and receiving control commands via MQTT
Arrange the following steps in the correct order for an MQTT client to subscribe and receive control commands reliably.
Attempts:
2 left
💡 Hint
Think about connection before subscription.
✗ Incorrect
First connect with session persistence, then subscribe, receive messages, and acknowledge them to ensure reliable delivery.
✅ Best Practice
expert3:00remaining
Which practice ensures reliable control command delivery in MQTT for IoT devices?
Select the best practice to ensure IoT devices reliably receive control commands even after temporary disconnections.
Attempts:
2 left
💡 Hint
Think about session persistence and message delivery guarantees.
✗ Incorrect
Persistent sessions keep subscriptions active, QoS 1 or 2 ensures delivery, and retained messages provide the last command on reconnect.