Table of Contents
cc3000 mbed cookbook¶
The Host Driver library¶
This library defines compatible API with the official mbed socket interface, which enables to use many mbed libraries.
An issue tracker is enabled for the host driver, please fill bug report there.
The Firmware update¶
In order to use the cc3000 module with this code, make sure at least V1.11 firmware is loaded. Look at the Avent-Wi-Go-System page (FirmwareUpdate box where are instructions and a binary to be loaded).
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
Two boards are supported at the moment using MY_BOARD selection:
- Wifi DipCortex
- Mbed board example (to show how to set it)
#define WIGO 1 #define WIFI_DIPCORTEX 2 #define MBED_BOARD_EXAMPLE 3 #define UNDEFINED 4 #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.
The hello world demo. It only connects to an access point, using DHCP and prints a message if DHCP is completed.
Examples using the cc3000 mbed host driver library:¶
If you want to try Smart config with cc3000, start with this demo. You can easily set your cc3000 with a smartphone using an application provided by Texas Instruments. Please read the demo's homepage for more details. This demo still using the older interface, to show what you can do with API for cc3000.
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.
The TCP client/server and the UDP client/server demos can be tested with the scripts which are available at Socket handbook
cc3000 tcp server demo (please check mbed socket interface for python script to test this demo) mbed.org/handbook/Socket
The websocket demo uses the websocket server available on mbed. Follow this guide Websocket and mbed
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.
cc3000 twitter demo, uses supertweet services. Set your account there and then fill a user and a secret inside the demo.
Wifi DipCortex demos:
Kitchen Sink Demo, a complete demo project, allowing you to exercise your CC3000 module ( Work in progress )
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.
I opened an issue tracker on all repositories. To report a bug or request a new feature, go to the issue tracker tab in the repository webpage and create a new one.
If you are running the latest TI CC3000 Package 1.28 (reports as 1.13) firmware your module may lock up if you attempt to send UDP data to certain IP addresses, 220.127.116.11 is one such address. To avoid the lock up you must issue two gethostbyname requests for the hostname "localhost", see this project for an example :
Small demo to purely test UDP, depends on the module already being configured to auto connect to an access point
If you are a student, or somebody starting out in the embedded world, please read this part very carefully before connecting your CC3000 evaluation board to a power supply. It requires just over 350mA's at 3.3v while transmitting in some situations, most development boards do not have the capability to supply the extra power required. You could damage your development board or just fail to get a reliable connection if your power supply is not capable.
Two boards that do have a supply sufficient to power the module are the WiFi DipCortex and the Adafruit breakout board. The adafruit breakout board can also be used with 5v MCUs
Do not connect any of the eval boards, to the LPC1768 mbed 3.3v or 5v power pins as they cannot supply the 350mA Tx current that is required, but do work very well with the mbed when connected to an external power supply. So if you are having problems please check your power supply first. Another issue you may see is, when using connecting wires, you need to keep them as short as possible, if the SCLK wire is too long the SCLK will stop, so it is best to keep it 4" / 100mm long. If you are wondering how to connect to the mbed, you can either make or buy one of the base boards that are available from a number of suppliers.