Video 4.4 test triggering In this video, we will switch the LED connected to Raspberry Pi based on the messages in Sq s open Sq s. Here you can see that we already have the messages, Visa clear all the messages in this case first as this is a real time IoT project we need to simultaneously check the temperature and turn the LED on and off based on the temperature values. So, we will clear all the messages and then simultaneously run ESP 32 and Raspberry Pi for testing. Now on the top select queue action, then view or delete messages. Now delete all the messages. refresh this curious. Now you can see the number of messages are zero.
Yes, we are ready to go. Now they will connect the hardware first connecting led Raspberry Pi, they have already made the LED and Raspberry Pi connections for scheduling. In case if you have disconnected the circuit, I have attached the circuit diagram in the resources section. Now open to determine I Raspberry Pi is ready. Now, we will run the Python code using the command Python space triggering.pi. Now, connect the history 11 and ESP 32.
The sensor connection is the same open Arduino. Now select Tools and then serial monitor. You can see that the temperature value is less than 25 degrees. And here in putty, you're getting an off message. Now, we will slowly raise the temperature. Yes, you can see on messages and the LED is also turned on.
Similar to the case of scheduling. We can automate the process by adding a cron job. Disconnect ESP 32 from the PC Now, we will add a cron job, input D give the command crontab space hyphen E. Now add the following line at the end of the file. Now these two lines will run both triggering and scheduling codes simultaneously. Save this file by pressing Ctrl x then y and Enter. Now we will again connect the DHT 11 sensor and ESP 32 you can increase the temperature and yes, the LED is turned on, we have successfully triggered and event.
In this video we tested switching the LED connected to the Raspberry Pi based on the messages in Sq s. In this section, we learned the following introduction to AWS lambda sending messages to Sq s programming Raspberry Pi test triggering. In the next section. We will visualize the sensor data using Amazon quick site