0
0
IOT Protocolsdevops~10 mins

Why MQTT is the IoT standard in IOT Protocols - Test Your Understanding

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

Complete the code to publish a message to an MQTT topic.

IOT Protocols
client.publish('[1]', 'Hello IoT')
Drag options to blanks, or click blank then click option'
Asubscribe
Bconnect
Csensor/data
Ddisconnect
Attempts:
3 left
💡 Hint
Common Mistakes
Using connection commands instead of a topic name.
2fill in blank
medium

Complete the code to subscribe to an MQTT topic.

IOT Protocols
client.[1]('home/temperature')
Drag options to blanks, or click blank then click option'
Aconnect
Bpublish
Cdisconnect
Dsubscribe
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'publish' instead of 'subscribe'.
3fill in blank
hard

Fix the error in the MQTT connection code by completing the blank.

IOT Protocols
client.[1]('mqtt.example.com')
Drag options to blanks, or click blank then click option'
Aconnect
Bpublish
Csubscribe
Ddisconnect
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to publish or subscribe before connecting.
4fill in blank
hard

Fill both blanks to create a dictionary of sensor readings filtered by temperature above 25.

IOT Protocols
{word: [1] for word in readings if readings[word] [2] 25}
Drag options to blanks, or click blank then click option'
Areadings[word]
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key instead of the value.
Using wrong comparison operator.
5fill in blank
hard

Fill all three blanks to create a dictionary with uppercase keys and values filtered by humidity less than 50.

IOT Protocols
{ [1]: [2] for [3] in data if data[[3]] < 50 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bdata[k]
Ck
Dv
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names.
Not converting keys to uppercase.