CC3000 Wifi Shiels, Request DHCP loops

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sunokok
 
Posts: 1
Joined: Tue May 08, 2018 10:23 am

CC3000 Wifi Shiels, Request DHCP loops

Post by sunokok »

Hi guys!
I am trying to get the connection details using Arduino & Adafruit CC3000. But my code gets stuck on checkDHCP() method. I have also tried to set a static IP address, and then setDHCP again to enable it. (The setup() function is from the Adafruit Library HTTPServer sketch)Here is my setup function:

Code: Select all

void setup(void)
{
  Serial.begin(115200);
  pinMode(ldrPin, INPUT);
  Serial.println(F("Hello, CC3000!\n")); 

  Serial.print("Free RAM: "); Serial.println(getFreeRam(), DEC);
  
  // Initialise the module
  Serial.println(F("\nInitializing..."));
  if (!cc3000.begin())
  {
    Serial.println(F("Couldn't begin()! Check your wiring?"));
    while(1);
  }

  
  Serial.print(F("\nAttempting to connect to ")); Serial.println(WLAN_SSID);
  if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {
    Serial.println(F("Failed!"));
    while(1);
  }
   
  Serial.println(F("Connected!"));
  
  Serial.println(F("Request DHCP"));
  while (!cc3000.checkDHCP())
  {
    delay(100); // ToDo: Insert a DHCP timeout!
  }  

  // Display the IP address DNS, Gateway, etc.
  while (! displayConnectionDetails()) {
    delay(1000);
  }
  
  // Start listening for connections
  httpServer.begin();
  
  Serial.println(F("Listening for connections..."));
}

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”