GithubHelp home page GithubHelp logo

isabella232 / wireless-commands-arduino-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twilio/wireless-commands-arduino-sample

0.0 0.0 0.0 7 KB

Use Twilio's Programmable SMS as an interface to your Arduino. The body of the text message hits the sample Node.JS code which sends a Programmable Wireless Command to an Arduino device asking for its current battery level and then returns the results to the original sender.

Home Page: https://www.twilio.com/docs/api/wireless

JavaScript 60.55% Arduino 39.45%

wireless-commands-arduino-sample's Introduction

Send Commands to an Arduino device

Use Twilio's Programmable SMS as an interface to your Arduino. The body of the text message hits the sample Node.JS code which sends a Programmable Wireless Command to an Ardunio device asking for its current battery level and then returns the results to the original sender.

How's it work?

The Command resource enables you to exchange simple machine-to-machine messages with SMS-capable Devices. For example, you could use a Command to tell an idle device to enable its data capabilities and establish an IP session. In this sample, we'll send a message to an Android device asking it to return its battery level.

Commands can be sent and received using the SMS text mode or binary (PDU) mode. Text mode Commands have a maximum length of 100 single-byte characters. Binary mode Commands have a maximum length of 140 bytes. To process a Command when it reaches your Arduino, you will interface with the modem directly. From the perspective of the Arduino, a Command is delivered as a regular SMS message.

Requirements

Setup instructions

Server

  1. Clone or download this repository
  2. Open config.js with your favorite text editor
  3. Update all values with the {{ YOUR_X_HERE }} convention
  4. See table below
  5. Upload code to server

Values to update in config.js

Key Description
accountSid Consider this your account username. It’s used to authenticate - get it here.
authToken Consider this your account password. It’s used to authenticate - get it here.
phoneNumber Used for bidirectional communication with the Arduino device - get one here.
simUniqueName This is the unique name of your SIM resource - get it here.

For the Programmable Wireless SIM

  1. Navigate to the Programmable Wireless SIMs
  2. Select your newly created SIM
  3. Enter the Callback URL that points to the code you uploaded to your server.
  4. Click Save

For the Arduino

  1. Open Arduino IDE
  2. Go to File > Open in the Menu
  3. Navigate to your local copy of the arduino folder from this repository
  4. Select wireless-sms-template.ino
  5. Select your Arduino board under Tools in the Menu
  6. Select the correct Port under Tools in the Menu
  7. Press the Right Arrow Button in Arduino IDE to upload the code
  8. Select Serial Monitor under Tools in the Menu
  9. Send a SMS with the text: battery level
  10. Wait for response

That’s it! Happy Hacking!

Resources

wireless-commands-arduino-sample's People

Contributors

jonedavis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.