0
0
IOT Protocolsdevops~10 mins

Protocol translation at edge 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 start the edge translator service.

IOT Protocols
edge_translator.start([1])
Drag options to blanks, or click blank then click option'
Aconfig.yaml
Bconfig_file
Cstart()
Drun()
Attempts:
3 left
💡 Hint
Common Mistakes
Using method calls instead of file names
Using incorrect file names
2fill in blank
medium

Complete the code to translate MQTT messages to CoAP format.

IOT Protocols
translator.convert('mqtt', 'coap', message[1])
Drag options to blanks, or click blank then click option'
A.data
B.payload
C.send()
D.content
Attempts:
3 left
💡 Hint
Common Mistakes
Using method calls instead of properties
Using incorrect property names
3fill in blank
hard

Fix the error in the code to correctly map CoAP requests to MQTT topics.

IOT Protocols
mapping = {req.topic: req[1] for req in coap_requests}
Drag options to blanks, or click blank then click option'
A.message
B.topic
C.payload
D.data
Attempts:
3 left
💡 Hint
Common Mistakes
Using topic as value instead of payload
Using incorrect property names
4fill in blank
hard

Fill both blanks to filter and translate only temperature sensor data.

IOT Protocols
filtered = {msg[1]: translator.convert('mqtt', 'coap', msg[2]) for msg in messages if 'temperature' in msg.topic}
Drag options to blanks, or click blank then click option'
A.topic
B.payload
C.data
D.content
Attempts:
3 left
💡 Hint
Common Mistakes
Using data or content instead of payload
Using payload as key instead of topic
5fill in blank
hard

Fill all three blanks to create a mapping of device IDs to their latest translated messages.

IOT Protocols
latest_messages = [1]{msg.device_id: translator.convert([2], [3], msg.payload) for msg in device_msgs if msg.status == 'active'}
Drag options to blanks, or click blank then click option'
Adict(
B'mqtt'
C'coap'
Dlist(
Attempts:
3 left
💡 Hint
Common Mistakes
Using list instead of dict
Swapping protocol names
Missing parentheses