cc3000

cc3000 mbed cookbook

Information

The cc3000 host driver library is still under development, please check the revision and update your programs regularly.
Requests, issues should be reported directly for particular repository. Please read issues section Issues

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.

The patch programmer is currently unavailable. Will be back online, once we solve a licensing issue.

[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

Two boards are supported at the moment using MY_BOARD selection:

  • Wi-Go
  • 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.

Import programcc3000_hello_world_demo

cc3000 hello world demo

Examples using the cc3000 mbed host driver library:

Generic examples:

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.

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

Import programcc3000_xively_demo

Xively demo for cc3000

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.

Issues:

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.

Hardware issues:

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.

Dave Fletcher.

Projects with this module:

Import programWi-Go_IOT_Demo_MKII

Port from Avnet's Internet Of Things full WiGo demo: SmartConfig - WebServer - Exosite - Android sensor Fusion App




1 related question:


15 comments:

11 Oct 2013

Please implement cc3000::getIPAddress() and connect(). The UDP class is also very difficult to use for many applications without the Endpoint supporting broadcast mode.

12 Oct 2013

Jas Strong wrote:

Please implement cc3000::getIPAddress() and connect(). The UDP class is also very difficult to use for many applications without the Endpoint supporting broadcast mode.

Hello Jas Strong,

I read also your email, going to respond there. For people here, Ethernet interface is not yet implemented for cc3000. I considered it to implement, but there was not time at my side. I'll add it. Issue tracker should be open for all repositories here, which allows you to create new issue tracker for example this request.

Update: An issue (enhancement) created ;) I am going to add this to our cookbook, for people to use it. That's the only/acceptable way to handle all requests.

Regards,
0xc0170

07 Dec 2013

I try cc3000_ping_demo on mbed_1768 with Adafruit module. Output is:

CC3000 ping demo.

IP address: 192.168.1.37

Get an IP address of google.com

IP address of google.com: 173:194:32:132

Starting sending ping.

Received 0 replies.

Ping demo completed.

when i ping 173.194.32.132 from cmd all OK. I receive 4 replies.

what does it mean?

08 Dec 2013

Andrew Kruglov wrote:

I try cc3000_ping_demo on mbed_1768 with Adafruit module. Output is:

CC3000 ping demo.

IP address: 192.168.1.37

Get an IP address of google.com

IP address of google.com: 173:194:32:132

Starting sending ping.

Received 0 replies.

Ping demo completed.

when i ping 173.194.32.132 from cmd all OK. I receive 4 replies.

what does it mean?

Andrew, Sorry for the delay. I have just tested the Ping demo, and have got the same result. I have never tested this demo before using the TI CC3000 this is the first time, I did most of the testing using an LS Research CC3000 and there was an issue at that time. As I recall the issue was the TI hardware / firmware. I need to do further tests with wireshark, and post a note to the group. I or somebody else will then get back with a better answer for you.

Dave Fletcher.

08 Dec 2013

HI Andrew,

your not seeing any ping replies as they are being filtered, to get the CC3000 to tell your processor about ping replies you need to add HCI_EVNT_WLAN_ASYNC_PING_REPORT to the set_event_mask.

if you can roll back to the previous version it will work or manually make the changes here : https://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/rev/ca8c234997c0

Were looking in to adding them back to the current version.

Carl - SolderSplash

Andrew Kruglov wrote:

I try cc3000_ping_demo on mbed_1768 with Adafruit module. Output is:

CC3000 ping demo.

IP address: 192.168.1.37

Get an IP address of google.com

IP address of google.com: 173:194:32:132

Starting sending ping.

Received 0 replies.

Ping demo completed.

when i ping 173.194.32.132 from cmd all OK. I receive 4 replies.

what does it mean?

08 Dec 2013

Hi Carl,

Thanks for your operative response. Ping work. I reseived 5 replies.

Regards, Andrew.

Carl - SolderSplash Labs wrote:

HI Andrew,

your not seeing any ping replies as they are being filtered, to get the CC3000 to tell your processor about ping replies you need to add HCI_EVNT_WLAN_ASYNC_PING_REPORT to the set_event_mask.

if you can roll back to the previous version it will work or manually make the changes here : https://mbed.org/users/Kojto/code/cc3000_hostdriver_mbedsocket/rev/ca8c234997c0

Were looking in to adding them back to the current version.

Carl - SolderSplash

Andrew Kruglov wrote:

I try cc3000_ping_demo on mbed_1768 with Adafruit module. Output is:

CC3000 ping demo.

IP address: 192.168.1.37

Get an IP address of google.com

IP address of google.com: 173:194:32:132

Starting sending ping.

Received 0 replies.

Ping demo completed.

when i ping 173.194.32.132 from cmd all OK. I receive 4 replies.

what does it mean?

12 Dec 2013

Hello Martin Kojtal,

Possible for you to do a demo for SMTP?

Thank you,.

12 Dec 2013

In some program for WiFiDipCortex I try using host_driver and mbed rtos. Program doesn't works. It hangs.
Well, I get rtos_basic sample from Handbook, slightly change it for WiFiDipCortex , compile and run. It works. I include board startup code for host driver

    NVIC_SetPriority(SSP1_IRQn, 0x0);
    NVIC_SetPriority(PIN_INT0_IRQn, 0x1);
    // SysTick set to lower priority than Wi-Fi SPI bus interrupt
    NVIC_SetPriority(SysTick_IRQn, 0x2);

Run samle. After few iterations it hang.

Does it possible using rtos and cc3000 host driver in one programm?
Thanks,
programm http://mbed.org/users/kruglov2a/code/rtos_basic_dc

12 Dec 2013

@Andrew,

please create a new question, many of us follow the questions section. We will be able to start a discussion there. Does your demo work if you skip those priorities? RTX uses systick, lowering its priority might cause problems. I haven't personally tested cc3000 with RTOS yet, should be possible, although cc3000 blocking approach is not ideal for operating system.

@Wen qian, There are libraries for SMTP, have you tested any? Share your code, again create a new question if any problems. I am not planning to create a SMTP demo in the following days.

Regards,
0xc0170

18 Dec 2013

Hello Martin Kojtal,

Sorry for late reply. I was thought this forum will auto generate an email to acknowledge me when i get someone reply.

Ya, i did try the sample code from Cookbook » SMTPClient (http://mbed.org/cookbook/SMTPClient). It's works for me. You just have to edit what Segundo Equipo hav mention in his coding. But before you start edit the parameter you have 2 things to know. 1) online check whether your country have any free SMTP service provider? 2) understand the SMTP protocol (eg: MAIL FROM, RCPT TO, DATA, Subject:, From:, To:, <next line>, <text>, QUIT). You can test it on your PC using Telnet before you use mbed.

It is quite interesting. Once everything done we can use mbed to trigger us something via email. If you have time then we can open a new topic for cc3000 SMTP.

I have request a sample CC3000 module from TI. This module look like QFN footprint but i just plan direct solder the wire on pad then the other end will use breadboard to connect to mbed. Do you have any idea? and Do you have tutorial how to connect CC3000 to mbed?

Thank you,.

24 Jan 2014

I have used UDP server code for LPC179 The module is receiving the data properly but while transmitting it was struck at hci_event_handler in while(1) loop. Did i miss any thing. Please sole my issue.

24 Jan 2014

Lakshmi Praveen wrote:

I have used UDP server code for LPC179 The module is receiving the data properly but while transmitting it was struck at hci_event_handler in while(1) loop. Did i miss any thing. Please sole my issue.

Please don't spam the mbed community, I saw your issue already twice. This does not serve a purpose at all, neither how much details you provided. What code do you run from client and from server? I replied to you in Questions section. Please reply there.

Regards,
0xc0170

07 Feb 2014

Has anyone been able to get this to work with the lpc1114? I have no problems flashing it via FTDI. With a little debugging, I see that lines 98-99 of cc3000_wlan.cpp are where I'm hanging:

while(_spi.wlan_irq_read() == 0) printf("y");
while(_spi.wlan_irq_read() != 0) printf("z");
printf("done\n\r");

I've added the print statements. I see a single y, then 59 z's, then nothing. I'm not sure if this is the SCLK stopping as per the last paragraph, though my SCLK wire is only 3":

if the SCLK wire is too long the SCLK will stop

I'm running off power from the FTDI chip 3.3V, but am not sure if the current supplied is not enough, possibly?

When I construct a cc3000 instance:

#define IRQ dp17
#define EN dp25
#define CS dp26
#define MOSI dp2
#define MISO dp1
#define SCLK dp6
cc3000 wifi(IRQ, EN, CS, SPI(MOSI, MISO, SCLK), SSID, PASS, WPA2, false);

I'm running the adafruit cc3000 breakout board. So my wire mappings are:

  • lpc1114 -> cc3000
  • dp17 -> IRQ
  • dp25 -> VBEN
  • dp26 -> CS
  • dp2 -> MOSI
  • dp1 -> MISO
  • dp6 -> CLK

The adafruit board is also getting Vin from the FTDI chip, and 3V3 pin on adafruit cc3000 is floating.

Is there anything obvious about what I am doing wrong?

07 Feb 2014

Nick Desaulniers wrote:

Has anyone been able to get this to work with the lpc1114? I have no problems flashing it via FTDI. With a little debugging, I see that lines 98-99 of cc3000_wlan.cpp are where I'm hanging:

while(_spi.wlan_irq_read() == 0) printf("y");
while(_spi.wlan_irq_read() != 0) printf("z");
printf("done\n\r");

I've added the print statements. I see a single y, then 59 z's, then nothing. I'm not sure if this is the SCLK stopping as per the last paragraph, though my SCLK wire is only 3":

if the SCLK wire is too long the SCLK will stop

I'm running off power from the FTDI chip 3.3V, but am not sure if the current supplied is not enough, possibly?

When I construct a cc3000 instance:

#define IRQ dp17
#define EN dp25
#define CS dp26
#define MOSI dp2
#define MISO dp1
#define SCLK dp6
cc3000 wifi(IRQ, EN, CS, SPI(MOSI, MISO, SCLK), SSID, PASS, WPA2, false);

I'm running the adafruit cc3000 breakout board. So my wire mappings are:

  • lpc1114 -> cc3000
  • dp17 -> IRQ
  • dp25 -> VBEN
  • dp26 -> CS
  • dp2 -> MOSI
  • dp1 -> MISO
  • dp6 -> CLK

The adafruit board is also getting Vin from the FTDI chip, and 3V3 pin on adafruit cc3000 is floating.

Is there anything obvious about what I am doing wrong?

I expect your problem is due to you using 3.3v to power a 3.3v regulator on the Adafruit board. You need to supply 5v to the 5v input pin on the Adafruit board, with a current greater than 350mA. Your debug shows that the program has hung waiting for the interrupt. Please post in the question section next time.

Dave.

09 Feb 2014

Quote:

I expect your problem is due to you using 3.3v to power a 3.3v regulator on the Adafruit board. You need to supply 5v to the 5v input pin on the Adafruit board, with a current greater than 350mA. Your debug shows that the program has hung waiting for the interrupt. Please post in the question section next time.

Dave.

Oops! Still no beans though: https://mbed.org/questions/2505/adafruit-cc3000-lpc1114/