0
0
IOT Protocolsdevops~10 mins

Edge-to-cloud data pipeline in IOT Protocols - Interactive Code Practice

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

Complete the code to publish data from an edge device using MQTT.

IOT Protocols
client.connect('[1]')
Drag options to blanks, or click blank then click option'
Abroker.hivemq.com
Blocalhost
Cexample.com
D192.168.1.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using localhost when the broker is remote
Using an invalid IP address
2fill in blank
medium

Complete the code to subscribe to a topic on the cloud server.

IOT Protocols
client.subscribe('[1]')
Drag options to blanks, or click blank then click option'
Adevice/command
Bsensor/data
Calerts
Dstatus/update
Attempts:
3 left
💡 Hint
Common Mistakes
Subscribing to the wrong topic
Using a topic meant for commands
3fill in blank
hard

Fix the error in the QoS level setting for MQTT publish.

IOT Protocols
client.publish('sensor/data', payload, qos=[1])
Drag options to blanks, or click blank then click option'
A3
B0
C1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid QoS values like 3
Using QoS 0 when delivery guarantee is needed
4fill in blank
hard

Fill both blanks to create a dictionary comprehension filtering sensor readings above threshold.

IOT Protocols
filtered_data = {k: v[1] for k, v in readings.items() if v [2] 50}
Drag options to blanks, or click blank then click option'
A**2
B>
C<
D*3
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of exponentiation
Using wrong comparison operators
5fill in blank
hard

Fill all three blanks to build a dictionary with uppercase keys, values, and filter condition.

IOT Protocols
result = { [1]: [2] for k, v in data.items() if v [3] 10 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using k.lower() instead of k.upper()
Using wrong comparison operator