This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3200: How to change network(ssid and password) in program cc3200 ?

Part Number: CC3200
Other Parts Discussed in Thread: ENERGIA,

Hi ,


I am using cc3200 launchpad and energia IDE . I want to change network in program like ssid and password  so problem is i can connect to one network which ssid and password declare initially but when I am changing ssid and password in program then it is connecting to old ssid and password so why it is happening ?

  • after changing ssid and password

    printout the strings using serial.print after and before wifi.begin(ssid ,password);

  • but still it is connecting to old network only
  • can u post the piece of code 

  • Hi

    #include <WiFi.h>

    WiFiUDP Udp;
    int status = WL_IDLE_STATUS;
    unsigned int localPort = 2390; // local port to listen on
    char ssid_old[] = "PAYNET1" ; // default network name also called SSID
    char password_old[] = "9886468697@insemi";
    char ssid_new[] = "amol";
    char password_new[] = "9665413788";

    void setup() {

    Serial.begin(115200);
    Serial.print("Attempting to connect to Default Network named: ");
    Serial.println(ssid_old);
    WiFi.begin(ssid_old, password_old); // attempt to connect default network name specified
    delay(1000);

    while ( WiFi.status() != WL_CONNECTED) // loop run until wifi get connected to specified network
    {
    Serial.print(".");
    delay(300);
    }

    Serial.println("\nYou're connected to the network");
    Serial.println("Waiting for an ip address");

    while (WiFi.localIP() == INADDR_NONE) // loop run until to get ip address of current network
    {
    Serial.print(".");
    delay(300);
    }

    Serial.println("\nIP Address obtained");
    printWifiStatus();
    WiFi.disconnect();
    delay(10000);

    // Trying to change network

    Serial.print("Attempting to connect to Default Network named: ");
    Serial.println(ssid_new);
    WiFi.begin(ssid_new, password_new); // attempt to connect default network name specified
    delay(1000);
    while ( WiFi.status() != WL_CONNECTED) // loop run until wifi get connected to specified network
    {
    Serial.print(".");
    delay(300);
    }

    Serial.println("\nYou're connected to the network");

    while (WiFi.localIP() == INADDR_NONE) // loop run until to get ip address of current network
    {
    Serial.print(".");
    delay(300);
    }

    Serial.println("\nIP Address obtained");
    printWifiStatus(); // call function to print current wifi status

    }

    void loop() {
    // put your main code here, to run repeatedly:

    }


    void printWifiStatus()
    {
    Serial.print("\n**************** WIFI STATUS **************\n");
    Serial.print("SSID: ");
    Serial.println(WiFi.SSID()); // print the SSID of the network you're attached to


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

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


    this code example i am trying .
  • hi,

    before connecting to new ssid add  sl_WlanProfileDel(0xff);

    and compile the code;

  • hi ,
    still same problem it has only IP address has changed its not shifting to new network .