NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

CC3100 Get Weather Application

From Texas Instruments Wiki
Jump to: navigation, search
Cc31xx cc32xx return home.png
Cc31xx return sample apps.png

Overview and application details[edit]

This sample application demonstrates how to connect to openweathermap.org server and request for weather details of a city. The application opens a TCP socket w/ the server and sends a HTTP Get request to get the weather details. The received data is processed and displayed on the console

NoteNote: This wiki page is only applicable for CC3100-SDK v1.0.0 and upward releases. For documentation on older SDKs' examples, refer corresponding file in <cc3100-sdk-installation-location>\cc3100-sdk\docs\examples\'

Source Files briefly explained[edit]

i. main - Initializes the device, connects to an AP, opens a TCP socket, requests and displays the weather information.

Usage[edit]

Prerequisite: This application requires an access-point with internet connectivity

  • Connect the board to a Windows-PC and configure the terminal-program for seeing the logs - CC3100 & CC3200 Terminal Setting has detailed instructions for configuring the terminal-program
  • From openweathermap.org create an API Key and modify the 'API Key' value in main.c found below:
   #define POST_BUFFER     "&mode=xml&units=imperial&APPID=<API KEY> HTTP/1.1\r\nHost:api.openweathermap.org\r\nAccept: */"
  • Edit sl_common.h and modify the values of below macros for the device to connect to the AP
   #define SSID_NAME       "<ap_name>"
   #define SEC_TYPE        SL_SEC_TYPE_OPEN
   #define PASSKEY         ""
  • Edit below parameters in main.c for getting the weather information from server:
   #define CITY_NAME       "<city>"
  • Build and launch the application
  • See the self explanatory logs on the terminal-program's console.
    • The application connects to the weather-server and opens an TCP socket to communicate w/ it.
    • It receives and processes the weather-information and displays it on the console
  • On success, below message will be displayed on the terminal
Get_weather_1.png

Limitations/Known Issues[edit]

None

Links[edit]

{{#invoke: Navbox | navbox }} {{#invoke: Navbox | navbox }}

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article CC3100 Get Weather Application here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article CC3100 Get Weather Application here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article CC3100 Get Weather Application here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article CC3100 Get Weather Application here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article CC3100 Get Weather Application here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article CC3100 Get Weather Application here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article CC3100 Get Weather Application here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article CC3100 Get Weather Application here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article CC3100 Get Weather Application here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity