C. The message payload should be a string, not a number
D. Broker address is incorrect
Solution
Step 1: Check publish method parameters
MQTT publish expects the message payload as a string, but 22 is a number here.
Step 2: Identify correct data type for payload
Converting 22 to "22" fixes the error by sending a string message.
Final Answer:
The message payload should be a string, not a number -> Option C
Quick Check:
MQTT payload must be string [OK]
Hint: MQTT messages must be strings, not numbers [OK]
Common Mistakes:
Ignoring data type of message
Thinking topic name is wrong
Missing disconnect is not an error here
5. You want to build a smart home system where sensors send data over low power and unreliable networks. Which IoT communication protocol is best suited for this?
hard
A. HTTP
B. MQTT
C. FTP
D. SMTP
Solution
Step 1: Understand network constraints
Low power and unreliable networks need lightweight, efficient protocols.
Step 2: Compare protocol suitability
MQTT is designed for low bandwidth and unreliable connections, unlike HTTP, FTP, or SMTP.
Final Answer:
MQTT -> Option B
Quick Check:
MQTT fits low power IoT networks [OK]
Hint: Use MQTT for low power, unreliable IoT networks [OK]
Common Mistakes:
Choosing HTTP which is heavier
Confusing FTP or SMTP with IoT protocols
Ignoring network power constraints
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.