.st0{fill:#FFFFFF;}

Raspberry Pi

Raspberry Pi Full Stack: If This Then That (sample lecture) 

 March 2, 2020

By  Peter

Join Our Mailing List

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community.

One email per week, no spam, unsubscribe at any time.

A few days ago I published a significant update and extension of my course Raspberry Pi Full Stack. In its original format, this project course shows how to build a web application on the Raspberry Pi, from the ground up. The updated and extended version of the course adds support for the Raspberry Pi 4, Raspbian Buster, and Python 3.8.1. It also adds various bells and whistles, including support for IFTTT email notifications.

In this post, I am sharing a sample from one of the new lectures in the course.

This lecture is the introduction of one of the new sections that shows you how to setup IFTTT email alerts.

When the temperature or humidity go above a specific point (which, of course, you can control), your app will email you. Once you know how to do this, you will be able to do anything you want with IFTTT.

Enjoy 🙂

Transcript from this sample lecture

In the previous few lectures, we reworked our application so that it has support for one or more remote Arduino nodes using the RF24 transceiver to communicate with the Raspberry Pi.

And this is the state of our application.

Now, we can go to the front end and choose a sensor that would like to access the data for, and the data comes back.

You can see here, I noticed this as I was recording the previous lecture.

So what happened here is that between say around 4 p.m. yesterday and about half an hour ago, I had stopped the background service on the Raspberry Pi that receives data from the remote node and forgot, then to turn it back on.

And that’s why you see this big gap.

I haven’t shown you yet how to create this service, it is something we’re going to do in the next lecture.

But I just wanted to explain why there is this perfect straight line between these two points, because there’s no data in here.

All right.

So let’s move on.

What we’re going to do now is to use the “If This Then That” Web service to generate email alerts like this one right here.

So I’ve set it up so that when the temperature or the humidity go above a particular threshold, the application is going to use “If This Then That” to send me an email and in that email you’ll have the information from the sensor that triggered the email, like you can see right here.

So this is what we’re going to implement in this lecture.

To make this work we are going to use “If This Then That”.

And on the Python script side on our program, we are going to use a Python module called “Requests”.

And this module allows us to easily send a HTTP request at anywhere on the Web that can, in our case, trigger the email.

So before we have a look at the code itself that I’ve got here; I’ve got as usual, the original version of RF24 receiver on the left side and then the new version with few modifications that we need on the right side.

So before we get into this, just want to show you what the IFTTT.com side of this operation looks like and also help you to set it up.

So then we can go to the Python script and make the necessary modifications there.

So I’ve just logged on to IFTTT.com…


Tags


You may also like

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Understanding the power requirements is crucial for any enthusiast using the Arduino Uno in their projects. How you manage voltage, amperage, and power sources impacts the success or failure of your endeavours. In this guide,

Read More
The Ultimate Guide to Powering Your Arduino Uno Board

If you are curious about how electronic devices work, understanding the fundamentals of the operation of their basic components is essential. Every electronic device—from the smartphones in our pockets to the satellites orbiting our planet—contains

Read More
A Guide to Essential Electronic Components in Circuits