Comments: CC3000 Hookup Guide

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • hydronics / about 10 years ago * / 2

    Do you Need HELP!

    If you can run the Board Test and scan networks but have no connection with the WebClient, Smart Config or Connection Test. Also if your sketch locks up when initializing the CC3000 in the Adafruit library... you may try this......

    sorry as I'm not sure which one was the final fix

    • I used Arduino 1.0.5 or 1.0.6 per Adafruit's suggestion

    • I used an external 12vdc power supply at the barrel jack

    • I used the Adafruit library sketch to upgrade the firmware

    https://learn.adafruit.com/adafruit-cc3000-wifi?view=all

    Also don't forget to change the pins (from 3 to 2) and (from 7 to 5) in the adafruit sketch if you are using a sparkfun board. Good luck!

    Update 7/19/2015: I had to roll back the firmware to version 1.26 = CC3000 firmware v1.12 to work with the Sparkfun Webclient. This actually worked fine in Arduino 1.6... but if I tried to use Fastconnect, it would only connect once and then fail on a second try. Therefore I ended up going back to Arduino 1.05 and used Adafruit's fastConnect (called SmartConfigReconnect) and it reconnects without issue. It reconnects and posts connection details and closes in ~110ms.... vs about 7 seconds using WebClient.

    • JohnathanN. / about 9 years ago / 1

      Did you have to do anything other than just change the pins on the adafruit sketch? I'm not able to get any of the adafruit sketches to work even after changing the pins.

    • Thanks for the pointers!

  • WadeB / about 10 years ago / 2

    I've built a replacement driver for the CC3000, https://github.com/wadetb/tinyhci. It's roughly half the size.

    It doesn't offer the C++ interface of the SFE library, instead it's at the socket level. But if someone wanted to, the SFE library could be ported to sit on top of it.

  • Member #1113664 / about 7 years ago / 1

    Hi,

    I'm using an Arduino UNO, version 1.8.3 in the editor and I've connected the CC3000 wifi shield (Uno and Mega compatible) and tried each of theTest sketches the library in this guide gives, including the BoardTest, ConnectionTest and WebClientTest and each of these gets stuck on the same command:

    if ( wifi.init()) { //the serial monitor doesnt' print anything beyond this line of code, simply nothing....

    any time I've modified this line to something like: if (1==1) then it continued, but for some reason, the "wifi.init()" is making a mass (-_=) ...:)

    Thanks...

  • Member #700205 / about 8 years ago / 1

    Need Help :-)

    I have Arduino UNO with CC3000 WiFi Shiled (without Power supply, only USB)

    "my Script" (part of it)

    include <Adafruit_CC3000.h>

    include <ccspi.h>

    include <SPI.h>

    include <string.h>

    include "utility/debug.h"

    // These are the interrupt and control pins

    define ADAFRUIT_CC3000_IRQ 3 // MUST be an interrupt pin!

    // These can be any two pins

    define ADAFRUIT_CC3000_VBAT 5 //from

    define ADAFRUIT_CC3000_CS 10

    // Use hardware SPI for the remaining pins // On an UNO, SCK = 13, MISO = 12, and MOSI = 11 Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,

    SPI_CLOCK_DIVIDER); // you can change this clock speed

    on my monitor i received:


    Hello, CC3000! Free RAM: 1128 Initializing... Attempting to connect to 773207497 Connected! Requested DHCP


    115200 baud

    can you help me to understand why it is stop in that point?

    Thanks Shachar

    • If you're using the Adafruit library with the SparkFun CC3000 Shield, you need to change the ADAFRUIT_CC3000_IRQ from 3 to 2, as that's the interrupt pin used on the SparkFun Shield.

  • Member #422954 / about 9 years ago / 1

    I'm a noob at the client-part of this libary and I would appreciate if someone could help me or give me a hint in which direction I should go to find answers to my questions.

    In the example for WebClientSD it gets a file / HTML (or what ever) and save it as a file on the SD-card. In my case I would like to save the output from a PHP-file. But I also gets the complete header. Example like thiis:

    HTTP/1.1 200 OK
    Server: Apache
    X-Powered-By: PHP/5.6.16
    Vary: Accept-Encoding
    Content-Type: text/html; charset=UTF-8
    Content-Length: 32
    Accept-Ranges: bytes
    Date: Sun, 17 Jan 2016 17:05:17 GMT
    X-Varnish: 1741726857
    Age: 0
    Via: 1.1 varnish
    Connection: keep-alive
    
    Hello World!
    

    I only need "Hello World!" and not the complete header. Does anyone know how I can accomplish this?

    • You'll need to parse the incoming text. You could throw away the first 13 lines, but I don't think there's a guarantee that the header is always 12 lines. Alternatively, it seems that there is a possibility that there is always a blank line between the header and the content. You could throw away all received text up to the blank line (i.e. only log text after the first "\n\n").

      [Edit] A more robust solution to finding the end of the HTTP header can be found here: http://stackoverflow.com/questions/11254037/how-to-know-when-the-http-headers-part-is-ended

      • Member #422954 / about 9 years ago / 1

        Thanks for your help. I didn't understand the code, but I found another way around in my case. Since I write the PHP-code I made it simple and started the output with a "[" and ended it with a "]". Then I made the Arduino code to check for these two characters. Like this:

        while ( client.available() ) {
         c = client.read();
         if (sd_file) {
        
           if (c == '[' ) { //'[' is my begining character
             startRead = true; //Ready to start reading the part 
           } else if (startRead) {
             if(c != ']'){ //'>' is my ending character
               sd_file.print(c);
             } else {
               startRead = false;
             }
           }
        
         }
        }
        

  • JohnathanN. / about 9 years ago / 1

    I have a local server that I want to access by IP address. I am able to use URLs to download files and what not. But when I use an IP address I get a TCP failure. Any ideas?

    • How are you calling the connect() function for TCP? Are you able to ping the server from the CC3000?

      • JohnathanN. / about 9 years ago * / 1

        I am using the WebClientSD example sketch with changes to my SSID and password and the ip address instead of www.example.com.

        here is my connect code:

        if ( !client.connect(server, 80) )
            Serial.println(F("Error: Could not make a TCP connection"));
            return;
        }
        

        server is declared like so:

        char server[] = "10.40.100.13";
        

        I just completed a ping which looks like it worked but then reports 0 packets recieved:

        -----------------------------
        SparkFun CC3000 - WebClientSD
        -----------------------------
        SD card initialization complete
        CC3000 initialization complete
        Connecting to SSID: DeviceTesting
        IP Address: 10.40.100.130
        Pinging...
        Pong!
        
        Packets sent: 4
        Packets received: 0
        Min round time (ms): 4294967295
        Max round time (ms): 0
        Avg round time (ms): 0
        
        Performing HTTP GET of: 10.40.100.13
        Error: Could not make a TCP connection
        

        • If you assign a string to server, the library attempts to use it like a URL. You'll need to create an IPAddress object and use that for connect():

          IPAddress server(192, 168, 0, 15);
          if ( !client.connect(server, 80) )
              Serial.println(F("Error: Could not make a TCP connection"));
              return;
          }
          

          Let me know if that works for you.

        • JohnathanN. / about 9 years ago / 1

          Any thoughts?

  • Member #749505 / about 9 years ago / 1

    Hi!

    trying to get the WebClient example going, but it stops and freeze at:

    SparkFun CC3000 - WebClient

    Anyone know what the problem could be?

    My shield has a red light, is this bad? (I'm new to Arduino... )

    • The red light is good - it shows that the shield has power. Are you able to run any of the other examples, like ConnectionTest, ScanTest, or PingTest?

  • Sherpa / about 10 years ago / 1

    As someone not too familiar with networking it took me a while to find I needed to use WLAN_SEC_WPA2 instead of WPLAN_SEC_WPA for a WPA-PSK network.

  • Member #504746 / about 10 years ago / 1

    Can someone explain why the MISO is not translated back to 5v in the breakout board? Arduino accepts 3v3 logic level in the case of input?

    • Correct. 3.3V is good enough to look like a logic high. It's not the best practice, but I ran out of pins on the logic level converter, so I did it to save board space and cost.

  • Member #471086 / about 10 years ago / 1

    Hey Shawn,

    I have run through this tutorial and almost all of the example sketches for the shield on an arduino uno. But one thing i can't get to resolve is the web client sketch shown in the tutorial. I don't get any feedback from the remote host site www.example.com but i also don't get any error messages. No matter how long i leave the serial monitor open it looks like this and doesn't change:


    SparkFun CC3000 - WebClient


    CC3000 initialization complete Connecting to SSID: NewThinkAir IP Address: 10.50.10.113 Performing HTTP GET of: www.example.com

    What does a first time IOT experimenter do at this point if i want to use data.sparkfun? In the fast connect sketch i do send and receive packets successfully from spark fun.

    Appreciate any help, Brett

    • That's definitely a strange one. Usually, if you make it through the process of obtaining an IP address, you can perform an HTTP GET without a problem.

      1) Which Arduino are you using? It's an UNO R3, right?

      2) Can you do the PingTest sketch? Does that work for you?

      • Member #471086 / about 10 years ago / 1

        Yes UNO R3.

        The ping test works. Here is the result of one just now:


        SparkFun CC3000 - Ping Test

        CC3000 initialization complete Connecting to: NewThinkAir Connected! IP Address: 10.50.10.113 Looking up IP address of: www.sparkfun.com IP address found: 204.144.132.37 Pinging 204.144.132.37 3 times... Pong!

        Packets sent: 5 Packets received: 1 Min round time (ms): 59 Max round time (ms): 59 Avg round time (ms): 59

        Disconnected Finished ping test

        • Can you try another HTTP site (not HTTPS) with WebClient? For example, try http://www.adafruit.com/testwifi/index.html.

          • Member #471086 / about 10 years ago / 1

            when i try that site i get this:

            SparkFun CC3000 - WebClient

            CC3000 initialization complete Connecting to SSID: NewThinkAir IP Address: 10.50.10.146 Performing HTTP GET of: http://www.adafruit.com/testwifi/index.html Error: Could not make a TCP connection

            Error: Could not close socket Finished WebClient test

            when i just try www.adafruit.com i get the same stalling action on the Performing HTTP GET step

            this is my code btw.... https://github.com/bmadres/cc3000-WebClient-Test-v2/blob/master/code

            • I was able to get "www.example.com" working with your code (I didn't change anything other than my SSID, password, and server).

              It looks like I messed up the GET command for Adafruit's site. Could you try the following? Change server[ ] to

              char server[] = "www.adafruit.com";
              

              and replace the section under // Make a HTTP GET request to:

              // Make a HTTP GET request
              client.print("GET /testwifi/index.html HTTP/1.1\r\n");
              client.print("Host: ");
              client.print(server);
              client.print("\r\n\r\n");
              client.println();
              Serial.println();
              

              • Member #616581 / about 10 years ago / 1

                Im having the same problem, even after trying his code mixed with your code. Im getting an IP address, and the ping test works as well. Im also having trouble with the m2x and data.sprakfun.com tutorials, where it hangs as soon as it tries to contact an external server etc (comments made on those two tutorials as well).

                Arduino Uno with mounted shield, using both USB and external power supply (and also just USB on its own).

                any help would be appreciated ,thanks

                • Same problem here, Sparkfun Redboard with Sparkfun cc3000 shield and external power supply. I do obtain an IP address but no http requests works, it just hangs. I've tried with your client and Adafruits but get the same results.

                  Is there something else we can do to find the solution or is the shield broken?

                  Thanks.

                  • If you are able to initialize and get an IP address, then the shield is working. Are you able to perform a GET of www.example.com?

                    • I borrowed another Sparkfun cc3000 from a friend which works perfectly so my guess is that the my shield doesn't work. Could it be something wrong with the soldering?

                      • Contact techsupport@sparkfun and they can help you narrow down what the problem is. If you're eligible for a replacement, they can also assist you with that.

                    • No, I can't make any requests at all. I've tried with www.example.com, with servers within my local network and other external ones and it just hangs. This is my Serial output using your WebClient library:

                      ---------------------------
                      SparkFun CC3000 - WebClient
                      ---------------------------
                      CC3000 initialization complete
                      Connecting to SSID: VIRUS
                      IP Address: 10.0.1.13
                      Performing HTTP GET of: www.example.com
                      

                      • JohnathanN. / about 9 years ago * / 1

                        Any resolution to this? I just got my board to day and its doing the exact same thing.

                        EDIT: I have traced the problem to these lines of code: // Make a HTTP GET request client.println(F("GET /index.html HTTP/1.1")); client.print(F("Host: ")); client.println(server); client.println(F("Connection: close")); client.println();

                        I can't find the println in the client library anywhere....this is pretty frustrating...please help.

                        • JohnathanN. / about 9 years ago / 1

                          OK I was able to fix my problem. I changed the println to print and then added /n at the end of all the print statements. Working now.

  • Member #573295 / about 10 years ago / 1

    Maybe am not looking in the correct location but TI now REQUIRES a legitimate COMPANY NAME as part of the registration process before they will let me download the SmartConfig software or anything else for that matter. I graduated years ago so the student option does not apply either. Has anyone else crossed this bridge?

  • Member #544260 / about 11 years ago / 1

    hi can i use adafruit library whith the shield ? thanks-

    • Yes, you can. You'll need to change a few of the pins in the example sketches to get it to work.

      • Member #544260 / about 11 years ago / 1

        Thanks Shawn please but I’m a bit confused because i have now the sparkfun cc3000 shield , the shield is attached to the Arduino in the same way like adafuit so please can you help me get it work ?

        • You will need to install their library (see the Adafruit walkthrough here: https://learn.adafruit.com/adafruit-cc3000-wifi). Load up the "buildtest" example and make the following changes:

          • Change ADAFRUIT_CC3000_IRQ to 2

          • Change ADAFRUIT_CC3000_VBAT to 7

          • Change WLAN_SSID to your network's name (SSID)

          • Change WLAN_PASS to your network's password

          Build and run the program, and it should work. Let me know if you have any problems getting it to run.

  • Sembazuru / about 11 years ago / 1

    Two things: 1. Please state the value (and also give a shop link) for that antenna select capacitor. I see this as potentially a commonly damaged part by users trying to configure for external antenna with marginal soldering skills. 2. Your picture of the mounted antenna shows the U.Fl connector at an awfully large angle for those little connectors. Maybe reconfigure things so the antenna cable can stay basically parallel with the PCB within the bend radius of the coax cable. Take a new picture and post that one instead. (I would imagine the pictured configuration would be flaky at best.)

      1. The capacitor is 10pF, as shown in the schematic. This is not a component that SparkFun sells individually, but if you would like to buy some, they can be found on DigiKey: 1276-1027-1-ND
      2. I will keep that in mind for the next revision. If you are not comfortable having the coax cable over the CC3000 module, then you could route the antenna to another mounting location (not on the shield) or reverse the antenna so that the cable routes beyond the edge of the board.
  • Member #105442 / about 11 years ago / 1

    Great guide, is the AES key for SmartConfig supported in the library? Thanks!


If you've found an issue with this tutorial content, please send us your feedback!