This project connects Tiva Connected Launchpad to Exosite Cloud using TI SimpleLink WiFi CC3100.
Features:
- Sends temperature data from Sensor Hub Booster Pack TMP006 Sensor to Exosite Cloud. The temperature data is displayed at a Exosite Dashboard Widget.
- Tiva Connected Launchpad on board led’s D2 and D3, are toggled on and off from Exosite Dashboard.
- Sends Tiva Connected Launchpad switch press count to Exosite cloud. The switch press count is displayed at a Exosite Dashboard Widget. Switch press count is limited to 15 only, for demoing purposes. The switch press count is reset to 0 after reaching the set limit of 15.
- Sends an email alert if Tiva Connected Launchpad on-board switch 1 press count have reached the set trigger level. This is set at Exosite Dashboard.
Hardware Block Diagram:
Hardware Setup:
Overall Pin Compatibility:
Exosite Cloud Overview:
Exosite is a internet of things software as a service(Saas) company that provides a platform for Internet of Things.
Using the Exosite Platform, data from your device can be virtualized and represented graphically using Exosite Dashboard Widgets. Some Exosite Dashboard Widgets are Big Number Widget, Line Graph Widget, On/Off Switch Widget, which all can be seen at the Exosite Dasboard screenshot below for this project.
Temperature data from my device is sent to Exosite Cloud and is being represented graphically at Exosite Dashboard, using Big Number Widget and Line Graph Widget.
Note: More information about Exosite Services can be found at their website.
To display your data at a Exosite Dashboard Widget stored at a Dataport or Data Source named Sensor Hub BP Temp. Set it as Data Source for that Exosite Dashboard Widget. See, as shown above.
Exosite Terms:
- CIK (Client Interface Key)
- Device private key.
- Generated when you make a new device at Exosite Portal Account.
- Dataport
- Data storage of time stamped values that can be written and read from.
- Dataport Alias
- Use to identify a Dataport.
- Dataport Type
- integer, float, string.
- For “string” type, the maximum size of a value that can be written is 64KB.
Tools to generate HTTP Requests to Exosite:
Write to Exosite Dataport:
- Using curl command line tool. Input below at Windows command prompt.
curl http://m2.exosite.com/onep:v1/stack/alias -H "X-Exosite-CIK: YOUR_CIK_HERE" -H "Accept: application/x-www-form-urlencoded; charset=utf-8" -d sensortemp=77"
- Using Exoline. Input below at Windows command prompt.
exo write YOUR_CIK_HERE sensortemp
-
-
value
=
“
77
“
- Using exosite write C API.
exosite_write(“sensortemp=77”, 13);
Note: replace YOUR_CIK_HERE with your device CIK.
Read to Exosite Dataport:
- Using curl command line tool. Input below at Windows command prompt.
curl http:
/
/
m2.exosite.com
/
onep:v1
/
stack
/
alias?sensortemp
-
H
"X-Exosite-CIK: YOUR_CIK_HERE"
-
H
"Accept: application/x-www-form-urlencoded; charset=utf-8"
- Using Exoline. Input below at Windows command prompt.
exo read YOUR_CIK_HERE sensortemp
- Using exosite read C API.
char
cbuffer[20];
uint16_t response_length = 0;
Read_status = exosite_read(
"sensortemp"
, cbuffer, 20, &response_length);
Note: replace YOUR_CIK_HERE with your device CIK.
Program Resources:
- TI Code Composer Studio 6.1.0.
- TI CC3100 SDK, SimpleLink API’s.
- Exosite C library for SimpleLink devices.
- Tivaware for Tiva Connected Launchpad.
- getting_started_with_wlan_station for Tiva Connected Launchpad + CC3100 BP.
- temperature_tmp006 example program for Tiva Connected Launchpad + Sensor Hub Booster Pack.
SPI communication between Tiva MCU and CC3100 BP:
- SPI API’s are mapped to SimpleLink API’s.
- spi_Open(), initializes the Tiva MCU SPI Peripheral and Interrupt to communicate with CC3100 BP.
- spi_Open() is mapped to SimpleLink API sl_IfOpen().
- sl_IfOpen(), is called within sl_Start().
- sl_Start(), is called within your main function to start the SimpleLink device.
Basic steps to connect your device to Exosite:
- Initialize device.
- Connect device to WiFi Access Point using SimpleLink API’s.
- Create socket to Exosite using SimpleLink API’s.
exosite_write() and exosite_read() key facts:
- Calls exosite_pal API which internally calls SimpleLink API sl_Socket(), that creates socket to Exosite.
- Calls exosite_pal API which internally calls SimpleLink API sl_Send(), that sends data to an open TCP Socket.
- Calls exosite_pal API which internally calls SimpleLink API sl_Close(), that closes socket to Exosite.
exosite_pal(Physical Application Layer) API’s:
- Part of Exosite C Library for SimpleLink Devices.
- Calls SimpleLink API’s.
Program Flowchart:
Tera Term Output:
Tiva Connected Launchpad Led On/Off, from Exosite Dashboard:
Send switch press count to Exosite Dashboard:
Comments