Tag Archives: CC3200

Send Notification from TI CC3200 Launchpad to Iphone4s using “If This Then That”

IFTTT or If This Then That provides a way to interact two web services in a “If This Then That” condition. The two web services that are paired up at IFTTT are called recipe.

At IFTTT setting both web services to work together are like cooking the web service ingredients to become one recipe.

Here are some recommended recipes from IFTTT:

  • Tweet your Facebook Status Updates
  • Save your new Instagram photos to Dropbox
  • Rain Tomorrow? Get notification
  • Save new texts your receive in a Google Spreadsheet
  • Get an email if there will be rain in your area tomorrow
  • Mute your phone when you arrive at work
  • Unmute my phone when I get home
  • Get Notified with your Teams Final Score
  • Document your daily activity in a Google Spreadsheet
  • Every day at 6 AM, add today’s weather report to my calendar

I am going to use TI Adrian Fernandez guide on “how to trigger an event with the Texas Instruments LaunchPad & the IFTTT Maker Channel”. From the guide, what is used is, MSP-EXP432P401R LaunchPad and CC3100 Wi-Fi BoosterPack from Texas Instruments. What I will use instead is TI CC3200 Launchpad. Using Energia Sketch I will just need to set the target board to “Launchpad w/ cc3200EMT (80MHz)”.

The ingredients for this IFTTT recipe are Maker Channel and Boxcar 2.

ifmthbsmall

The Maker Channel enables you to connect IFTTT to any microcontroller board that can make or receive a web request.

Boxcar 2 is an app, that provides notifications to your mobile phone. It provides services similar to Pushover and Parse Push Notifications.

I upload the Energia Sketch Project to my TI CC3200 Launchpad and run it.

Tera Term Output:

ifttt

Notification at my Iphone4s:

IMG_0238

Upon pressing the Notification, Boxcar App opens showing the Notification contents:

IMG_0239

Advertisements

Testing Parse quickstart example program using TI CC3200 Launchpad

parse
Successful Quickstart Test

Parse is one of those companies that offers public cloud services for IoT-enabled devices. Below, quoted from the Parse website.

“Instantly add a powerful cloud database, push notification services, and analytics tracking to your app. Choose from over thirteen native SDKs for mobile, desktop, and IoT devices and discover all that Parse has to offer”

Parse has chosen TI SimpleLink Wi-Fi CC3200 Wireless MCU to be one of the microcontroller platforms supported by Parse SDK. Surely is a good choice, since SimpleLink Wi-Fi CC3200 Wireless MCU has the reputation of being the industry’s first programmable Wi-Fi wireless MCU and having won several IoT industry awards.

Parse provides an example program to Send Push Notifications using TI CC3200 Launchpad. Here below is the link to Parse Guide for testing the example program “quickstart” using TI CC3200 Launchpad.

Parse Quickstart Guide using TI CC3200 Launchpad

As of this blog post writing the Parse Quickstart Guide and the Quickstart Program has issues. Your excitement following the guide will turn from enthusiasm to disappointment. Hopefully when you try out the Parse Quickstart Guide, Parse has already fixed the issues.

Two issues following the Parse Quickstart Guide.

  1. quickstart example program has build errors.
  2. At the guide it says there “Using Uniflash, open quickstart\uniflash\quickstart_release.ucf”. However there are no .ucf file at that folder location. What is there are two .usf files. These .usf files cannot be recognized by Uniflash.

Here are the quickstart build errors that I have encountered using CCS Version 6.0.0.00190

Description Resource Path Location Type
#10008-D cannot find file quickstart C/C++ Problem
#10010 errors encountered during linking; “quickstart.axf” not built quickstart C/C++ Problem
#10234-D unresolved symbols remain quickstart C/C++ Problem
unresolved symbol parseInitialize, first referenced in ./main.obj quickstart C/C++ Problem

After this I upgraded my CCS to Version: 6.1.0.00104, I got these build errors.

Description Resource Path Location Type
#10008-D cannot find file “C:/ti/CC3200SDK_1.1.0/cc3200-sdk/example/CC3200StarterProject-1.0.0/cc3200/samples/quickstart/../../../cc3200/src/Debug/libparse.a” quickstart C/C++ Problem
#10010 errors encountered during linking; “quickstart.axf” not built quickstart C/C++ Problem
<a href=”file:/C:/CCSV6/ccsv6/tools/compiler/dmed/HTML/10234.html”>#10234-D</a> unresolved symbols remain quickstart C/C++ Problem
unresolved symbol parseInitialize, first referenced in ./main.obj quickstart C/C++ Problem

The other build error messages are after adding the code lines mentioned at the guide.

I posted this problem at Texas Instruments E2E Community seeking advice how to resolve the build errors. TI E2E Guru Rafael De Souza, generously provided the solution to the build errors.

File Search Path Settings that results to build errorsquickstartwithoutfix

File Search Path Settings that resolves the build errors

desouzaquicstartfix

After, you have made the necessary changes at Code Composer Studio File Search Path Settings, build quickstart example program. The build errors should have been resolved.

At Code Composer Studio, press the “Debug” button, and “Run” quickstart example program

Following the Parse Quickstart Guide further down, click the “Test” button to send a push.

A successful push screen capture can be seen on the top of this blog post.

To send a custom push notifications, go to Parse Dashboard.

succesful push notification

To see the push details select your push notification at Parse Dashboard.

Push Details

Next, I will try to integrate this Parse quickstart example program to a mobile app.

Post Updates to Twitter from TI CC3200 Launchpad Using Temboo Choreo and Energia Sketch

Here is YouTube video below after I have copied the Temboo Choreo code to Energia and build without errors.

Requirements to post updates to Twitter from CC3200 Launchpad:

  1. You need a Temboo account. If you don’t have one yet, you can register for free here.
  2. Get the latest version of Energia Sketch here.
  3. Twitter account.
  4. A TI CC3200 Launchpad.
  5. A WiFi internet connection.

Register your Application at Twitter:

  1. You need to register your application at Twitter here.
  2. At the “Create and Application” page, enter your Application Name and Description at the corresponding fields. At the Website field, enter https://www.temboo.com/oauth_helpers/confirm_twitter/.
  3. Agree to the “Developers, Rules of the Road”, and then finish creating your Twitter Application.
  4. In order to post Tweets to Twitter, set Permissions to either Read and Write, or Read, Write and Access direct messages.
  5. At the Key and Access Tokens tab, generate your Access Token.
  6. Copy your Twitter Application Access Token, Access Token Secret, Consumer Key, and Consumer Secret.

Auto-Generate your Launchpad Energia Sketch Code from Temboo:

  1. Log in to Temboo, and go to Twitter->Tweets->StatusUpdate Choreo Library.
  2. Turn the IoT Mode switch to ON, and select Texas Instruments Launchpad from the drop down menu. Also, at “How is it Connected” drop down menu, select TI CC3200 Launchpad (Wifi) and provide the details of your WiFi internet connection.
  3. Enter your Twitter Application Access Token, Access Token Secret, Consumer Key, and Consumer Secret at the Input fields.
  4. Click “Run” to test the Twitter->Tweets->StatusUpdate Choreo. If there are errors after the test, means that you have a wrong value at the input fields. If pass, your C codes below are good to be copied into Energia Sketch. (YouTube video after step 4 is shown at the top of this post)

CC3200tembootwitter.c Energia Sketch code.

//CC3200tembootwiter.c

#include <WiFi.h>
#include <WiFiClient.h>
#include <Temboo.h>
#include "TembooAccount.h" // Contains Temboo account information

WiFiClient client;

int numRuns = 1; // Execution count, so this doesn't run forever
int maxRuns = 1; // Maximum number of times the Choreo should be executed

void setup() {
 Serial.begin(9600);
 
 int wifiStatus = WL_IDLE_STATUS;

 // Determine if the WiFi Shield is present.
 Serial.print("\n\nShield:");
 if (WiFi.status() == WL_NO_SHIELD) {
 Serial.println("FAIL");

 // If there's no WiFi shield, stop here.
 while(true);
 }

 Serial.println("OK");

 // Try to connect to the local WiFi network.
 while(wifiStatus != WL_CONNECTED) {
 Serial.print("WiFi:");
 wifiStatus = WiFi.begin(WIFI_SSID, WPA_PASSWORD);

 if (wifiStatus == WL_CONNECTED) {
 Serial.println("OK");
 } else {
 Serial.println("FAIL");
 }
 delay(5000);
 }

 Serial.println("Setup complete.\n");
}

void loop() {
 if (numRuns <= maxRuns) {
 Serial.println("Running StatusesUpdate - Run #" + String(numRuns++));

 TembooChoreo StatusesUpdateChoreo(client);

 // Invoke the Temboo client
 StatusesUpdateChoreo.begin();

 // Set Temboo account credentials
 StatusesUpdateChoreo.setAccountName(TEMBOO_ACCOUNT);
 StatusesUpdateChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
 StatusesUpdateChoreo.setAppKey(TEMBOO_APP_KEY);

 // Set Choreo inputs
 String AccessTokenValue = "xxxxxxxx";
 StatusesUpdateChoreo.addInput("AccessToken", AccessTokenValue);
 String AccessTokenSecretValue = "xxxxxxxx";
 StatusesUpdateChoreo.addInput("AccessTokenSecret", AccessTokenSecretValue);
 String ConsumerSecretValue = "xxxxxxxx";
 StatusesUpdateChoreo.addInput("ConsumerSecret", ConsumerSecretValue);
 String StatusUpdateValue = "Tweet! Tweet! from Markel's TI CC3200 Launchpad!";
 StatusesUpdateChoreo.addInput("StatusUpdate", StatusUpdateValue);
 String ConsumerKeyValue = "xxxxxxxx";
 StatusesUpdateChoreo.addInput("ConsumerKey", ConsumerKeyValue);

 // Identify the Choreo to run
 StatusesUpdateChoreo.setChoreo("/Library/Twitter/Tweets/StatusesUpdate");

 // Run the Choreo; when results are available, print them to serial
 StatusesUpdateChoreo.run();

 while(StatusesUpdateChoreo.available()) {
 char c = StatusesUpdateChoreo.read();
 Serial.print(c);
 }
 StatusesUpdateChoreo.close();
 }

 Serial.println("\nWaiting...\n");
 delay(30000); // wait 30 seconds between StatusesUpdate calls
}

TembooAccount.h Energia Sketch code:

/*
IMPORTANT NOTE about TembooAccount.h

TembooAccount.h contains your Temboo account information and must be included
alongside your sketch. To do so, make a new tab in Energia, call it TembooAccount.h,
and copy this content into it. 
*/

#define TEMBOO_ACCOUNT "xxxxxxxx" // Your Temboo account name 
#define TEMBOO_APP_KEY_NAME "myFirstApp" // Your Temboo app name
#define TEMBOO_APP_KEY "xxxxxxxx" // Your Temboo app key

#define WIFI_SSID "xxxxxxxx"
#define WPA_PASSWORD "xxxxxxxx"

/* 
The same TembooAccount.h file settings can be used for all Temboo sketches.

Keeping your account information in a separate file means you can share the 
main .ino file without worrying that you forgot to delete your credentials.
*/

Post Facebook Status from TI CC3200 Launchpad Using Temboo Choreo and Energia Sketch

Here is YouTube video below after I have copied the Temboo Choreo code to Energia and build without errors.

I have introduced at my other post how, by using Temboo Choreos I am able to integrate web services to programs running on my TI Launchpad.

I would like to venture further and test how conveniently, I will be able to integrate a web service like Facebook to a program running on my TI Launchpad using Temboo Choreos and Energia Sketch. I have no prior experience in web services and before don’t know that it is possible to communicate an electronic kit to a web service like Facebook.

What I know of from browsing in the internet are Twitter message activated devices such as this brewing machine, and vending machine below.

Lets start now, to show you how to Post Facebook Status from TI CC3200 Launchpad.

Requirements to send Facebook posts from CC3200 Launchpad:

  1. You need a Temboo account. If you don’t have one yet, you can register for free here.
  2. Get the latest version of Energia Sketch here.
  3. A Facebook account, which most likely you already have one.
  4. A TI CC3200 Launchpad.
  5. A WiFi internet connection.

Get Facebook App ID and App Secret:

  1. Log in to your Facebook Developers Account. If you don’t have an account, you can make one here. After you have logged in go to Apps.
  2. If you are using an existing App, select your App on the Facebook Dashboard. You will be able to see the existing app at a drop down menu when you select App. Copy your AppID and App Secret.
  3. If you don’t have an existing App, at Apps select “Add a New App” to create a new App. Select Website and at the Site URL field of the form, enter https://www.temboo.com/oauth_helpers/confirm_facebook/ 
  4. After finish creating new App, select your App and Copy your App ID and App Secret.

Auto-Generate your Launchpad Energia Sketch Code from Temboo:

  1. Log in to Temboo, and go to Facebook->Publishing->Post Choreo Library.
  2. Turn the IoT Mode switch to ON, and select Texas Instruments Launchpad from the drop down menu. Also, at “How is it Connected” drop down menu, select TI CC3200 Launchpad (Wifi) and provide the details of your WiFi internet connection.
  3. At Input fields “click” the Get OAuth Tokens icon. A window will open providing instructions how obtain OAuth Tokens. Steps 1 and 2 are discussed in more detail at Get Facebook App ID and App Secret steps above.
  4. At Step 3, enter your AppID and AppSecret at the fields and select “NEXT“.
  5. At step 4, select “LAUNCH AUTHORIZATION”. Then you will be automatically be at Step 5 with the Access Token. Select “USE THESE VALUES”. The window will close and the Access Token value will be automatically entered at the Input Access Token field.
  6. The two other fields are the “Link” and “Message”. Since I just want to post a Message at my Facebook account, I entered my message at field box.
  7. Click “Run” to test the Facebook->Publishing->Post Choreo. If there are errors after the test, means that you have a wrong value at the input fields. If pass, your C codes below are good to be copied into Energia Sketch. (YouTube video after step 7 is shown at the top of this post)

CC3200temboofacebookpost.c Energia Sketch Code:

#include <WiFi.h>
#include <WiFiClient.h>
#include <Temboo.h>
#include "TembooAccount.h" // Contains Temboo account information

WiFiClient client;

int numRuns = 1; // Execution count, so this doesn't run forever
int maxRuns = 10; // Maximum number of times the Choreo should be executed

void setup() {
 Serial.begin(9600);
 
 int wifiStatus = WL_IDLE_STATUS;

 // Determine if the WiFi Shield is present.
 Serial.print("\n\nShield:");
 if (WiFi.status() == WL_NO_SHIELD) {
 Serial.println("FAIL");

 // If there's no WiFi shield, stop here.
 while(true);
 }

 Serial.println("OK");

 // Try to connect to the local WiFi network.
 while(wifiStatus != WL_CONNECTED) {
 Serial.print("WiFi:");
 wifiStatus = WiFi.begin(WIFI_SSID, WPA_PASSWORD);

 if (wifiStatus == WL_CONNECTED) {
 Serial.println("OK");
 } else {
 Serial.println("FAIL");
 }
 delay(5000);
 }

 Serial.println("Setup complete.\n");
}

void loop() {
 if (numRuns <= maxRuns) {
 Serial.println("Running Post - Run #" + String(numRuns++));

 TembooChoreo PostChoreo(client);

 // Invoke the Temboo client
 PostChoreo.begin();

 // Set Temboo account credentials
 PostChoreo.setAccountName(TEMBOO_ACCOUNT);
 PostChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
 PostChoreo.setAppKey(TEMBOO_APP_KEY);

 // Set Choreo inputs
 String AccessTokenValue = "xxxxxxxx";
 PostChoreo.addInput("AccessToken", AccessTokenValue);
 String MessageValue = "Hello from Temboo ! ! ! - Message was posted from CC3200 Launchpad";
 PostChoreo.addInput("Message", MessageValue);

 // Identify the Choreo to run
 PostChoreo.setChoreo("/Library/Facebook/Publishing/Post");

 // Run the Choreo; when results are available, print them to serial
 PostChoreo.run();

 while(PostChoreo.available()) {
 char c = PostChoreo.read();
 Serial.print(c);
 }
 PostChoreo.close();
 }

 Serial.println("\nWaiting...\n");
 delay(30000); // wait 30 seconds between Post calls
}

TembooAccount.h Energia Sketch code:

/*
IMPORTANT NOTE about TembooAccount.h

TembooAccount.h contains your Temboo account information and must be included
alongside your sketch. To do so, make a new tab in Energia, call it TembooAccount.h,
and copy this content into it. 
*/

#define TEMBOO_ACCOUNT "xxxxxxxx" // Your Temboo account name 
#define TEMBOO_APP_KEY_NAME "myFirstApp" // Your Temboo app name
#define TEMBOO_APP_KEY "xxxxxxxx" // Your Temboo app key

#define WIFI_SSID "xxxxxxxx"
#define WPA_PASSWORD "xxxxxxxx"

/* 
The same TembooAccount.h file settings can be used for all Temboo sketches.

Keeping your account information in a separate file means you can share the 
main .ino file without worrying that you forgot to delete your credentials.
*/

After just about less than 30 minutes, being able to post a message to Facebook using TI CC3200 Launchpad, I have a base product that I can already work on and expand to other possible applications.

There are lots of applications for having able to post a message, a link, a picture at Facebook using a TI CC3200 Launchpad. You can have it set as a home security alarm, a fire alarm, and a lot more.

Send Email from TI CC3200 Launchpad using Temboo Choreo and Energia Sketch

With Temboo, TI launchpads are able to connect to various web services, making it easier to connect Launchpad into the Internet of Things.

Not only easier but in a much faster and hassle free way. Temboo has over 2000 ready to run libraries called Choreos, that enables you to integrate web services like Yahoo, Twitter, Gmail, Facebook and many more into programs running on your Launchpad.

Let me emphasize again why the use of Temboo Choreos to integrate web services into programs running on your Launchpad, is much faster, and hassle free way, is because it just took me less than 15 mins to use Temboo and Energia Sketch, and then be able to send email using my TI CC3200 Launchpad. I followed the instructions below from Temboo.

https://www.temboo.com/hardware/ti/send-an-email

Here below is the Youtube video after I copied the generated code from Temboo to Energia Sketch.

Upgrading to current CC3200 SDK Revision for Code Composer Studio

Since I got my CC3200 Launchpad Revision 3.2, I have been using CC3200 SDK 0.5.2 and TI-RTOS 2.0.2.36 for SimpleLink Wireless MCUs. Followng the CC3200 Getting Started Guide, I was able to try several example without build errors, or warnings.

As the new CC3200 SDK 1.0.0 was just released, I downloaded it, so I can continue studying CC3200 Launchpad example programs to current SDK version.

Following the CC3200 Launchpad Getting Started Guide, I created a new CCS workspace and imported wlan_station, driverlib, simplelink, oslib and ti_rtos_config CC3200 SDK 1.0.0 example programs. It was mentioned at the CC3200 Getting Started Guide to build the ti_rtos_config first. But, I build the wlan_station and oslib first and got these errors below.

At wlan_station I am getting this warning below:

Description Resource Path Location Type
Invalid project path: Include path not found (C:\CCS6\tirtos_simplelink_2_00_02_36\products\bios_6_40_03_39\packages). wlan_station pathentry Path Entry Problem

At oslib I am getting these warnings below:

Description Resource Path Location Type
#225-D function “portCLZ” declared implicitly tasks.c /oslib line 2156 C/C++ Problem
#225-D function “prvPortStartFirstTask” declared implicitly port.c /oslib line 348 C/C++ Problem

These warnings above was solved by updating the CC3200 Add-On for Code Composer Studio. I also updated the TI-RTOS for SimpleLink Wireless MCUs as there is an update available at the CCS App Center.

ccsappcenter

After updating TI-RTOS for SimpleLink Wireless MCUs Add-On, you will see a new folder named “tirtos_simplelink_2_01_00_03” at your CCSV6 folder for this update. The update was version 2.1.0.03. (Note: This version might be different at the time of your upgrade)

Following the CC3200 Getting Started Guide for building ti_rtos_config, it is mentioned to Select the latest versions of
XDCtools and TI-RTOS for SimpleLink. Also verify the platform is selected as ti.platforms.simplelink:CC3200. (Note: This Code Composer Studio Version is 6.0.0.00190)

tirtosproperties

If you don’t select the latest version of TI-RTOS for SimpleLink Wireles MCU’s at ti_rtos_config project properties, the default 2.0.2.36 is selected. You will be able to build ti_rtos_config, but you will get this warning below building some of the example programs. You won’t be able to debug your example program with this warning below.

At email example program I am getting this warning below:

Description Resource Path Location Type
Invalid project path: Include path not found (C:\CCS6\tirtos_simplelink_2_00_02_36\products\bios_6_40_03_39\packages). email pathentry Path Entry Problem

After you have build the ti_rtos_config with correct project properties, you can now import other CC3200 launchpad example programs. After importing the CC3200 launchpad example programs I encountered this warnings below at CCS Project Explorer.

cc3200projectexplorer

If you build these example programs with warnings, you will get these error below.

At email example program I am getting this warning below:

Description Resource Path Location Type
This project was created using a version of compiler that is not currently installed: 5.1.6 [ARM]. Another version of the compiler will be used during build: 5.1.5. Please go to a CCS App Center to install the compiler of the required version, or migrate the project to one of the available compiler versions by adjusting project properties. email properties Problems.

After I change the compiler version to 5.1.5 at project properties, I was able to build the email example program without errors.

To summarize, If you are upgrading your CC3200 SDK version to current, follow some pointers mentioned in this blog and the CC3200 Getting Started Guide. If you encounter any other problems not mentioned at this blog, just ask at the Texas Instruments Engineer to Engineer Community.

Making the Email Example program work for CC3200 Launchpad

Connection with Email Server Failed
Connection with Email Server Failed

Just following the TI CC3200 Email Demo Application wiki and building and running the CC3200 Example Program at my CC3200 Launchpad led to a Error message at my Terra Term;

“Connection with Email Server Failed. Check Internet Connection and Retry

There are no specific instructions at any related documentation that mentions the need for code changes to make the Email Example Program work for CC3200 Launchpad. Maybe someone who has good experience with SMTP coding might get that idea, that there need to be some code changes to make the Email Example Program work for a CC3200 launchpad. But, for the regular person, who is just starting to learn about CC3200 launchpad, would try and try again, but end up scratching head and stuck at the error below

“Connection with Email Server Failed. Check Internet Connection and Retry”

I ask help at Texas Instruments E2E Community, and gladly someone who has experience with SMTP gave me some tips, and with those tips, I was able to make the Email Example Program work for my CC3200 Launchpad. I have sent email from CC3200 launchpad to my Yahoo Mail Inbox.

Here below are the instructions to make the Email Example Program work for CC3200 Launchpad. I am using CCS Version 6.0 and CC3200 SDK Version 0.5.2 and my CC3200 Launchpad is Revision 3.2.

  1. At file demo_config.h change SSID per your access point.
  2. If you are using Yahoo Mail to send the email change the USER, USER_RFC, and PASS with your Yahoo Email and Password as shown below.
  3. Change YAHOO_HOST_PORT to 465. The YAHOO_HOST_PORT default value is 25, and that did not work for me.
  4. If you are using Yahoo Mail to send email change at main.c, all usage of GMAIL_HOST_NAME variable to YAHOO_HOST_NAME and change all usage of GMAIL_HOST_PORT variable to YAHOO_HOST_PORT.
  5. At your Serial Console (e.g Putty, Tera Term), do not include “<” and “>” as shown in the commands.
demo_config.h
demo_config.h
Change GMAIL_HOST_NAME to YAHOO_HOST_NAME
Change GMAIL_HOST_NAME to YAHOO_HOST_NAME
Change GMAIL_HOST_PORT to YAHOO_HOST_PORT
Change GMAIL_HOST_PORT to YAHOO_HOST_PORT
Do not include <> in commands
Do not include “<” and “>” in commands.
Confirmed email receipt at my Yahoo Mail Inbox!
Confirmed email receipt at my Yahoo Mail Inbox!