Jump to content

Unable to connect with a Static IP CC3200 launchpad

Recommended Posts


I have CC3200 launchpad and it is working fine with dynamic ip.

Now i have to connect it to static ip and here the problems starts.

I am using windows 7 32 and other pc with windows 7 64bit with energia to program it and i already formatted and install the new service pack.

Now when i load wifigethostip it works cool and gives information as asked in the code but when i load static ip addressing sketch it does not connect with my router and it displays IP Adress as

Please guide to connect it to net using static ip address

Attached is the code for both along with the serial monitor O/P

 * get host IP by hostname demo
 * Type a hostname into the serial terminal
 * and the corresponding IP address will be printed
 * By Noah Luskey: 2 July 2014
#ifndef __CC3200R1M1RGC__
// Do not include SPI for CC3200 LaunchPad
#include <SPI.h>
#include <WiFi.h>

// your network name also called SSID
char ssid[] = "SarlaA";
// your network password
char password[] = "thisishitech";
// your network key Index number (needed only for WEP)
int keyIndex = 0;

void setup()
  // put your setup code here, to run once:
  Serial.println("**Simplelink IP by name demo**");
  // attempt to connect to Wifi network:
  Serial.print("Attempting to connect to Network named: ");
  // print the network name (SSID);
  // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
  WiFi.begin(ssid, password);
  while ( WiFi.status() != WL_CONNECTED) {
    // print dots while we wait to connect
  Serial.println("\nYou're connected to the network");
  Serial.println("Waiting for an ip address");
  while (WiFi.localIP() == INADDR_NONE) {
    // print dots while we wait for an ip addresss

  Serial.println("\nIP Address obtained");
  // you're connected now, so print out the status  

#define STRLEN 32
char buffer[STRLEN];
int  bufferIndex = 0; 

void loop()
  while(Serial.available()) {
      buffer[bufferIndex] = Serial.read();
    // is this the terminating not carriage return
    if( buffer[bufferIndex] != '\r')
      // keep reading
    buffer[ bufferIndex ] = 0; // terminate the string with a 0
    bufferIndex = 0;  // reset the index ready for another string

    Serial.print("Getting IP for ");
    IPAddress IP(0,0,0,0);
    int iRet = WiFi.hostByName(buffer, IP);
    if(iRet < 0) {
      Serial.println("Host name lookup failed");
    } else {

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("Network Name: ");

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.println(" dBm");


#include <SPI.h>
#include <WiFi.h>

// the IP address for the shield:
IPAddress ip(192, 168, 1, 12);    

char ssid[] = "SarlaAP5";    // your network SSID (name) 
char pass[] = "thisishitech"; // your network password (use for WPA, or use as key for WEP)

int status = WL_IDLE_STATUS;

void setup()
  // Initialize serial and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only

  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present"); 
    while(true);  // don't continue


  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to SSID: ");
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:

  // print your WiFi shield's IP address:
  Serial.print("IP Address: ");

void loop () {}

I have tried changing different ip address which are free but it does not connect to internet.

Please guide!!!!



Link to post
Share on other sites

I formated and loaded the new service pack, then i loaded WiFiGetHostIP sketch (first sketch) it worked fine and gave me output as  in the first window but when i load sketch to connect it to a static ip it fails displays IP Adress as

Again repeated the procedure formated loaded new service pack and the wifigethostip it worked but agian when i loaded the static ip sketch it again says the same ip as


the Please guide !!!!

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...