Ryan Kauffman
Published © GPL3+

How to Save a Child’s Life with Python, AWS & Twilio IoT

Create a Twilio IoT hotspot for sending a SMS using AWS Lambda and the AWS IoT button inside a car.

BeginnerFull instructions provided2 hours5,553
How to Save a Child’s Life with Python, AWS & Twilio IoT

Things used in this project

Story

Read more

Schematics

Github

An AWS Lambda function that sends an SMS text message on the click of an IoT button.

twilioiot-rescuebutton_dsmm4oiw6u_ZY3MIbmrKM.jpg

Code

Untitled file

Python
This is the Lambda Handler with Twilio Helper Library
import os
from twilio.rest import Client


def handler(event, context):
    client = Client(
      os.environ['TWILIO_ACCOUNT'],
      os.environ['TWILIO_TOKEN'])

    client.messages.create(
        to=os.environ['ALERT_PHONE'],
        body=os.environ['HELP_MSG'],
        from_=os.environ['TWILIO_PHONE'])

Credits

Ryan Kauffman
3 projects • 9 followers
Contact

Comments

Please log in or sign up to comment.