Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

Method 2 creating a Flask-RESTful service

To use this method, we would need to create a RESTful service, similar to what we did in Chapter 3, Networking with RESTful APIs and Web Socket Services Using Flask (the code that can be found in chapter02/flask_api_server.py, which changes the brightness of a LED (rather than setting it to on/off/blinking), would be a great starting point).

We would also need to expose our Raspberry Pi to the public internet, which would require us to open a port and create a port forwarding rule in our local firewall or router. Then, together with our public IP (or domain name), we could construct a URL and use this directly with the IFTTT Webhook service.

For prototyping ideas and creating demos, a simple alternative to opening up firewalls and creating port forwarding rules could be to use a service such as Local Tunnels (localtunnel.github.io/www) or ngrok (ngrok.com), which can help you expose a device to the internet.

Since this...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461