Task 1 – abnormal event process
As discussed in the previous chapter, the sensor data in the main ESP32 code is encapsulated in JSON format. You can view the serialized data stream in the local terminal window as shown in the following output:
Publishing message: {"timeStamp":1713218277,"deviceModel":"DHT11","deviceID":"645ad13bdaec","status":"Normal","date":"04-15-2024","time":"14:57:57","timeZone":"-08:00","DST":"Yes","data":{"temp_C":17,"temp_F":63,"humidity":40}}
In the AWS IoT Core MQTT test client, the received MQTT message payload will appear as displayed in the following screenshot.
Figure 15.3 – MQTT message shown in AWS IoT Core
You may notice a variable named status
in the previous two messages. This variable represents the sensor’...