Skip to content

Intro to Internet of Things: Labs

De Dol edited this page Aug 25, 2023 · 3 revisions

Welcome to the IoT lab! This time, we're going to be using If This Then That (IFTTT) to build some complex systems on the internet.

Intro

Firstly, head over to IFTTT and create an account. If you've got a cellphone that supports it, install the IFTTT app, and sign in there as well.

Basics

Investigate some basic IFTTT recipes. Read about applets and services on the about page. Create some simple recipes: here are some fun examples:

Here are some more funny recipes:

Maker Webhook

Let's investigate the Mobile Notification. This applet sends you a cellphone notification every time a certain URL is accessed. We can use the python requests library to do this every time your button is pressed.

To start with, install the applet and test it out. Browse to your "maker webhooks" settings and find your account URL. Browse to the URL and test out the connection with some sample data - you should get a notification on your phone!

Back to Python

Now, you can use the requests library to access that URL from python!

pip install requests

Then, in the Python REPL:

r = requests.get(<the url>)

Again - you should get a notification on your phone! If you don't, check the value of r.status_code - it should be '200'

GPIO

This part is fun - remember how to add an event handler to your button in Python? Write some code so that when you press the button, you get a notification on your phone!

Try to send a fun message to yourself,

Clone this wiki locally