Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 2.12 KB

README.md

File metadata and controls

49 lines (33 loc) · 2.12 KB

PYTHON APP USING API MESSAGING FROM TWILIO AND ARDUINO WATER SENSOR

A (Js) serverless implementation of the back-end is also available.

Pre-requisites


Deps

install deps: pip install -r requirements.txt.

Twilio configuration

Add your own account_sid, auth_token, from (given by twilio when creating a phone number for your servie), to numbers to your environment after your registered for a Twilio account.
It can be found in your console.
your to phone number (used to create a twilio account) must be verified.

Environment

Create your own virtual environment: virtualenv .venv.
Activate your environment: source .venv/bin/activate.
Add your environment variables to a .env file.
Source environment variables for your project before running it: source .env or use autoenv.

Running the project


Twilio Messaging configuration

Run webserver with Twilio SMS Webhook.
If you don't want to host your webserver you can use ngrok locally to add your webhook endpoint to the Messaging service /sms route on the webserver PORT:5000.

Available commands

Use the Makefile to serve and run your project.

Javascript and serverless endpoint

./serverless directory holds a script using webtask.io using Twilio API.
Alternatively, you can use stdlib.

After cd the directory, you can install the deps npm i, and run the npm deploy task to update your script on webtask.io.
You will need to provide a .secrets file with your API variables: TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_NUMBER_FROM, TWILIO_NUMBER_TO or source them in your environment.

Examples of implementation


leak detector