Difference between revisions of "EBC Exercise 32 ifttt"

From eLinux.org
Jump to: navigation, search
(Initial Page)
 
m (Added Bone setup)
Line 6: Line 6:
 
== Sending an SMS message from the Bone ==
 
== Sending an SMS message from the Bone ==
 
There are three steps needed to send SMS messages, set up ifttt, edit a script on the Bone, and then run the script.
 
There are three steps needed to send SMS messages, set up ifttt, edit a script on the Bone, and then run the script.
 +
 
=== Set up ifttt ===
 
=== Set up ifttt ===
 
# Create an account on [https://ifttt.com ifttt] and  
 
# Create an account on [https://ifttt.com ifttt] and  
Line 20: Line 21:
 
# edit the Recipe Title if you want.  (I remove "update phone number")
 
# edit the Recipe Title if you want.  (I remove "update phone number")
 
# click "Create Recipe"
 
# click "Create Recipe"
 +
 +
=== Set up the Bone ===
 +
 +
The file '''send.js''' on [https://github.com/MarkAYoder/BeagleBoard-exercises/tree/master/iot/ifttt github] is a simple example that triggers ifttt events. 
 +
# Go to [https://ifttt.com/maker https://ifttt.com/maker] channel and copy your key
 +
# edit '''send.js''' and paste you key.
 +
# make sure the '''event''' matches the event name you entered ("sms").
 +
# save your file and make sure it's executable.
 +
 +
=== Run the script ===
 +
Once everything is set up all you do is run:
 +
bone$ '''./send.js'''
 +
https://maker.ifttt.com/trigger/sms/with/key/b...4?value1=My&value2=Test%202&value3=BeagleBone
 +
Congratulations! You've fired the sms event
 +
 +
You are allowed to pass on three parameters (value1, value2 and value3), which the script does.  You can set your recipe to send these values in the sms message.
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Revision as of 11:42, 5 October 2016

thumb‎ Embedded Linux Class by Mark A. Yoder


ifttt (If This Then That) is a slick web service that lets you attach event triggers to actions. See the ifttt website for examples of what it can do. Here I'll show you how to use the Maker channel to trigger events from the Bone and have the Bone receive events.

Sending an SMS message from the Bone

There are three steps needed to send SMS messages, set up ifttt, edit a script on the Bone, and then run the script.

Set up ifttt

  1. Create an account on ifttt and
  2. then click Create a Recipe
  3. next click the big blue this
  4. type "make" in the search box and click "Maker"
  5. click the blue "Receive a web request"
  6. enter "sms" for the Event Name and click "Create Trigger"
  7. click on the blue "that"
  8. enter "sms" and click on "SMS"
  9. click on the blue "Send me an SMS"
  10. enter a message to send. You can click on the blue flask in the upper right to insert things into the message.
  11. click "Create Action"
  12. edit the Recipe Title if you want. (I remove "update phone number")
  13. click "Create Recipe"

Set up the Bone

The file send.js on github is a simple example that triggers ifttt events.

  1. Go to https://ifttt.com/maker channel and copy your key
  2. edit send.js and paste you key.
  3. make sure the event matches the event name you entered ("sms").
  4. save your file and make sure it's executable.

Run the script

Once everything is set up all you do is run:

bone$ ./send.js
https://maker.ifttt.com/trigger/sms/with/key/b...4?value1=My&value2=Test%202&value3=BeagleBone
Congratulations! You've fired the sms event

You are allowed to pass on three parameters (value1, value2 and value3), which the script does. You can set your recipe to send these values in the sms message.




thumb‎ Embedded Linux Class by Mark A. Yoder