This document discusses how to build IoT applications using the CC3100 user API. It describes an application that connects to a weather server to request and display weather details. It also explains how to configure the CC3100 module as both a wireless client and HTTP server. The CC3100 can be assigned a static IP address and connect to an access point. As a server, it hosts web pages from flash memory and allows clients to request pages through a browser using the CC3100's IP.
2. • Get whether application using CC3100:
This 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 window as shown below.
6. • To perform this application, we need to set an
IP address for the device CC3100 with TIVA
Launchpad. We can set IP address for the
device CC3100 statically or dynamically as we
discussed in the session.
• The below steps demonstrates the
configuration of a static IP address for CC3100
TIVA Launchpad.
7. • Here the device connects to the Access Point
(APwith the configured static IP.
• The static IP address is stored inside the non-
volatile memory of CC3100.
• The basic steps for assigning IP address to a
CC3100 device are given in the flowchart
shown in figure.
9. • We can also make CC3100 module as a HTTP
server with TIVA Launchpad.
• HTTP is an acronym for Hyper Text Transfer
Protocol.
• HTTP is a client/server protocol used to deliver
hypertext resources (HTML web pages,
images, query results, and so forth) to the
client side.
10. • HTTP works on top of a predefined TCP/IP. (
Transmission Control Protocol / Internet
Protocol).
• HTTP web server allows endusers to remotely
communicate with the CC3100 by using a
standard web browser.
11. • The HTTP web server enables the following
functions:
• Device configuration
• Device status and diagnostic
• Application-specific functionality
12. • The HTTP server handles the HTTP request by
listening on the HTTP socket id which is by
default 80.
• Based on the request type, such as HTTP GET
or HTTP POST, the server handles the request
URI resource and content.
• The server then composes the appropriate
HTTP response and returns it to the client.
13. • The server communicates with the serial flash
file system, which hosts the web page files.
• The files are saved in the serial flash with their
individual filenames.
14. • If we configure CC3100 as a server then it will
be in Access Point (AP) mode with a pre-
defined SSIDNAME and uses the sample HTML
pages stored in Flash which can be accessed
by the clients.
• Clients can connect to CC3100 and request for
web-pages using the IP of device from any
standard web browser.
15. • There are pre-programmed html pages
already residing on the flash and new HTML
pages can be downloaded on serial-flash of
CC3100 using CCS_UniFlash utility using a
separate tool EMU-BOOST.
• The scope of this study will be to use the
existing html pages already pre-programmed
in the flash by default.
• The flowchart for using CC3100 device as a
HTTP server is given in below figure.