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

 March 2, 2020

By  Peter

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…


Peter Dalmaris is an educator, electrical engineer, electronics hobbyist, and Maker. Creator of online video courses on DIY electronics and author of three technical books, and has recently released his book Maker Education Revolution.   As a Chief Tech Explorer since 2013 at Tech Explorations, the company he founded in Sydney, Australia, Peter’s mission is to explore technology and help educate the world.  Tech Explorations offers educational courses and Bootcamps for electronics hobbyists, STEM students and STEM teachers. A life-long learner, Peter’s core skill is in explaining difficult concepts through video and text. With over 15 years of tertiary teaching experience, Peter has developed a simple yet comprehensive style in teaching that students from all around the world appreciate.  His passion for technology and in particular for the world of DIY open source hardware has been a dominant driver that has guided his personal development and his work through Tech Explorations. Peter’s current online courses have helped over 60,000 people from around the world to be better Makers. 

Peter Dalmaris

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

Subscribe to our newsletter now!