You are viewing an older revision! See the latest version

cc3000

cc3000 mbed cookbook

Information

The cc3000 host driver library is still under development, please check the revision and update your programs regularly.

The Host Driver library

This library defines compatible API with the official mbed socket interface, which enables to use many mbed libraries.

Import librarycc3000_hostdriver_mbedsocket

cc3000 hostdriver with the mbed socket interface

An issue tracker is enabled for the host driver, please fill bug report there.

The Patch Programmer

In order to use the cc3000 module with this code, make sure at least V1.11 firmware is loaded.

[Repository '/users/frankvnk/code/CC3000_PatchProgrammer_MKII/' not found]

Generic demos description

There are 3 files which are important:

  • The main header file - the configuration file
  • The init code file - init routines for specific boards
  • The main code file - demo code

NOTE: The main header file contains configuration parameters for connection and the board configuration. Please set it before flashing your board.

Two boards are supported at the moment using MY_BOARD selection:

  • Wi-Go
  • Wifi DipCortex

#define WIGO           1
#define WIFI_DIPCORTEX 2
#define UNDEFINED      3

#define MY_BOARD WIGO

To select any other board, set UNDEFINED macro for MY_BOARD macro inside the main header file and write your own init routine inside the init code file.

To set acces point password, security and SSID name, use the following defines which are located in the main header file.

// use this defines in AP_SECURITY
#define NONE 0
#define WEP  1
#define WPA  2
#define WPA2 3

// use smart config
#define USE_SMART_CONFIG 0

 // Default SSID Settings
#define AP_KEY       "test"
#define AP_SECURITY  WPA2            // WPA2 must be enabled for use with iPhone or Android phone hotspot!
#define SSID         "test"


The hello world demo. It only connects to an access point, using DHCP and prints a message if DHCP is completed.

Import programcc3000_hello_world_demo

cc3000 hello world demo

Examples using the cc3000 mbed host driver library:

Generic examples:

Import programcc3000_simple_socket_demo

cc3000 simple socket demo (not using EthernetInterface) !

Import programcc3000_ping_demo

Connect to SSID, get ip by dhcp, ping google.com, display statistics

There's a known issue with a bind to any port (0) for cc3000. Please set the bind address inside NTP client to any port except 0.

Import programcc3000_ntp_demo

ntp demo for cc3000

The TCP client/server and the UDP client/server demos can be tested with the scripts which are available at Socket handbook

Import programcc3000_tcp_client_demo

tcp client for cc3000, using mbed socket interface

Import programcc3000_tcp_server_demo

cc3000 tcp server demo (please check mbed socket interface for python script to test this demo) mbed.org/handbook/Socket

Import programcc3000_udp_client_demo

cc3000 udp client demo

Import programcc3000_udp_server_demo

cc3000 UDP server demo

The websocket demo uses the websocket server available on mbed. Follow this guide Websocket and mbed

Import programcc3000_websocket_demo

cc3000 websocket demo for cc3000

Twitter demo uses supertweet service. Please visit http://www.supertweet.net/ to register before importing this program, in case you are not registered there and your twitter has not enabled an access to this service.

Import programcc3000_twitter_demo

cc3000 twitter demo, uses supertweet services. Set your account there and then fill a user and a secret inside the demo.

Import programcc3000_http_client_demo

cc3000 http client

Wifi DipCortex demos:

Kitchen Sink Demo, a complete demo project, allowing you to exercise your CC3000 module ( Work in progress )

Import programWiFiDip-KitchenSink

WiFi DipCortex / CC3000 Demo - Contains a menu driven set of tests to initalise and control the CC3000 radio. Also allowing you to test various TCP and UDP connections.

Projects with this module:


All wikipages