Video 1.2 Why should you bother with no dread? Like the topic says In this video, we can see why you should learn no dread. A couple of weeks ago in my office, we had a temperature sustenance issue. Even though the air conditioner was centralized, the temperature inside the macadamia room used to vary from time to time. Sometimes the room got really hot, and at times it was quite cold. So every time when we felt that the room was hot, which was approximately around 25 degrees centigrade, we sent emails to the centralized air conditioner maintenance team, and we had a temporary fix.
No one felt like sending emails every time that happened. So I thought of automating the process. First, let's come to the part where a normal developer automates this task, he first go through many links to figure out Get temperature data. And then he'll finally find a way to get it. Next, he'll use a Raspberry Pi and do Python coding to check the temperature value and write code to send emails to the team for sending the mails, he will have to know the email libraries on Python, which might take some extra time. Well, I can't show you how that is done, because that might take a couple of days.
But I can show you the code. This is the code a developer writes to automate the one I was talking about. Smart people would focus on the logic rather than writing code. Okay, now, my turn. People thought it would take me a couple of days despite my intelligence to figure out a way to automate it, let alone actually going through the process. Regardless of all these complexities, I finish automating the process.
Within eight minutes, and now, it has been running successfully for weeks, and no one has ever had the problem of sending emails again. For doing this automation, I knew how to use Raspberry Pi, how to use no dread and how to do a Google search. I'll take you through the same process which I went through to accomplish this automation. I'll also have a stopwatch for you to check how much time it takes. I'll be taking temperature readings from the ht 22 sensor interface with the Raspberry Pi. I have set up my configurations in such a way that no treats starts running on the Raspberry Pi at boot.
Okay, let's start. First, I need a library to get my DHT sensor readings. So let's find one Let's see this one seems to be okay. I'm looking for the get clone command. And there it is. For people who don't know, libraries are present in GitHub, and we can download them using this command and the link Next, let's install it.
Now let's see what's inside. Hmm. Examples, the one we've been looking for. We'll try the simple test file. What is this have? We are in In the library, setting the sensor type, setting the pin number, whoops, this is for BeagleBone.
And this is for Raspberry Pi. Next, we get the sensor reading here. And this is just a nice way to print it. Well, I won't be needing the humidity part, so I'm removing it. Don't forget, we have to connect the D haich d 22 to this pin. Save the file.
Shut down your PI to make the connections. five volt Round six 810 1214 and 16 which is GPIO 23 Now let's see what the temperature value is. Silly me, forgot Python. Super, we get the value. Now we'll be using the same command in Node red. This is not read.
I won't explain in detail what's happening here, because we will cover no tread in detail in our future videos. So just watch. I will get the temperature values using this. Then I'll check for the condition temperature greater than 24 and add an email note to send emails Yay, we've got it but it's not Perfect. Let me format it properly. Good.
That's it. See, that's seven minutes and 45 seconds, the time it takes to prepare a salad or an Eggs Benedict, the time it takes to get dressed up. At least most of us. Impressive, isn't it? This is the reason why you should learn no dread. You can develop finished products with real over time then the traditional way of doing things.
The whole email part Python has been put inside this little green box. How cool is that? With no dread, you can focus on the logic rather than writing codes. Okay, I'm sure you're convinced about why you should learn node red. So let's move on to the next video and learn what is no dread and why it was actually developed. In this video, you've seen what no dread can do, and I'm sure you're eager to work on it.
In the next video, I'll clarify what it actually is and why it was developed in the first place.