Complete the code to define the protocol used for IIoT data transfer in SCADA.
protocol = "[1]"
MQTT is a lightweight messaging protocol commonly used for IIoT data transfer in SCADA systems.
Complete the code to set the SCADA system to subscribe to the IIoT sensor topic.
scada_client.subscribe("[1]")
The SCADA system subscribes to the 'sensor/data' topic to receive IIoT sensor readings.
Fix the error in the code to correctly parse JSON payload from IIoT device.
import json payload = '{"temperature": 22.5}' data = json.[1](payload)
json.loads() parses a JSON string into a Python dictionary.
Fill both blanks to filter IIoT sensor data with temperature above 25 and create a dictionary.
filtered_data = {device_id: data[1] for device_id, data in sensors.items() if data['temperature'] [2] 25}We use .copy() to copy the data dictionary and filter where temperature is greater than 25.
Fill all three blanks to create a dictionary of device names in uppercase with their status if status is 'active'.
active_devices = [1]: [2] for [3], info in devices.items() if info['status'] == 'active'}
The keys are device names in uppercase, values are their status, and the loop variable is device.