Hardware

Control your TI CC3220 from your mobile phone


Here we'll show you how to use your phone as a remote control for your TI CC3220.

Your TI CC3220 can use text-to-voice to construct phone menus that can be used by you or anyone else to control your board from afar. With this power, your TI CC3220 can work as a remote monitor and call you when it wants your input, opening up a wide range of possibilities for applications that react based on remote user input.

This code uses a choreo from our Twilio bundle.

Get Set Up

1Make sure you have a Temboo account. If you don't already have one, you can register for free.

2You'll need a free Texas Instruments account to use their online IDE, CCS Cloud. You can sign up here.

3If you haven't already done so, prepare your board for making secure connections by following our Setting up CC3220 for SSL tutorial.

4You'll also need a Twilio account, which you can create here.

5After you've created your Twilio account, retrieve your Twilio Account SID and Auth Token - you'll need them to run the sketch. You can find your Twilio Account SID and Auth Token on your Twilio Dashboard.

6On the Twilio website, go to your Twiml Bin, and create two Twiml files like the ones below.

        <Response>
        <Gather input="dtmf" timeout="10" numDigits="1" action="https://ACCOUNT_NAME.temboolive.com/callback/twilio" method="GET">
        <Say voice="alice" language="en-US">Enter 1 followed by the star key to turn on the LED.</Say>
        </Gather>
        </Response>
        

Note that the above XML needs to contain your Temboo callback URL that includes your Temboo account name as part of the URL.

        <Response>
        <Say voice="alice" language="en-US">Consider it done!</Say>
        </Response>
        

After creating your two Twiml files, make sure to copy the URLs for these files - you'll need them to run the sketch.

Auto-Generate your TI CC3220 Code

7Go to the Twilio > Calls > CaptureKeyPadEntry in our Library.

8Select "Texas Instruments" from the drop down menu, then choose your board. Make sure that you've added details about how your TI CC3220 is connected to the internet.

Selecting your TI CC3220

9Click Run Now to test out the Choreo from our website. Confirm that your phone gets a call and that when you enter a number on the keypad, that number is returned as part of the Nexmo response in the Output section of the page.

Testing the Nexmo Inputs

Testing the Nexmo Choreo from our website

10Create a Profile from your Choreo inputs, so that you can refer to this profile in your code - this will help save RAM on your TI CC3220 board, and also lets you change the behavior of your application by editing the Profile on our website as opposed to editing your code.

Save Profile

11Using the visual pin board, click one of the TI CC3220's pins to configure a digital actuator. Next, set an Actuator Trigger Condition for your digital actuator. Indicate that you want to set your actuator's digital pin to high if the user presses 1 on their keypad after receiving the phone call.

Setting an Actuator Trigger Condition

12When you've confirmed that the Choreo runs successfully and you've saved a Profile, click the "Send to CCS Cloud" button to the right of your generated code. Name your application and click Send. Click the link that appears to visit the CCS Cloud IDE in your browser.

Sending code from Temboo to CCS Cloud

13Plug your CC3220 board into your computer via USB. Select its USB connection in CCS Cloud via the Target > Connect COM port... menu.

14Run the code and trigger a phone call from your TI CC3220!

Running your code on your CC3220 board from CCS Cloud

What Next?

When you've got this code working, you're in a position to build any number of applications that involve sensing information on the TI CC3220 and delegating control to a human when its time to make a choice about what to do next. Your IoT project just got a whole lot smarter.

Need Help?

If you've got questions about Nexmo, it's best to start by learning more about the Choreo that we use in this example. You might also find what you need by searching Nexmo's Knowledgebase.

For anything to do with Temboo and how it works with your TI CC3220, we're always happy to help. Just email us at support@temboo.com, and we'll answer you as quickly as possible.


Back