Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

How to change domain name (mysimplelink.net) and SSID

Other Parts Discussed in Thread: CC3200, CC3100

Hi,

In Httpserver example and out of box example. we access the web with following url.

http://mysimplelink.net

I am trying to find a place where I can change it to something for my own url. The reason is that we are building a device that will go in to field and will accept configuration using httpserver. We would like to brand it with our own url and SSID name. Can someone please let me know where to change url and SSID of AP mode.

I tried to grep "http://mysimplelink.net" in SDK and only file I found is httpserver/main.c where it is present as printf.

  • I have some additional information for you, but not the whole story.

    If you change the Device Name to your companyname, you can on Apple devices (iOS and Macintosh) use http://companyname.local

    Unfortunately this does not work on Windows, as this is mDNS which is making this work, and Windows does not support mDNS out of the box. You could recommend custom installs Bonjour for Windows, then they will be able to use the above URL.

    Also, there is a similar service for Windows that you could implement in your code, but the name escapes me for now!

    The only other advice I can give, is that the IP address will always be 192.168.1.1, so you can suggest the customer types in http://192.168.1.1 

    As for changing http://mysimplelink.net, I am not sure how/if you can.

    Glenn.

  • As for SSID, here is the code

        // Set SSID name for AP mode
        unsigned char  str[15] = "CompanyNameAP";
        unsigned short  length = strlen((const char *)str);
        sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, length, str);

    Glenn

  • And for the url;

            unsigned char str[32] = "domainname.net";
            unsigned char len = strlen((const char *)str);
            retVal = sl_NetAppSet(SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DOMAIN_NAME,
            		len, (unsigned char*)str);
    

    Note that ‘domainname.net’ must be all lower case, and if you omit a zone (.net) you have to type in the browser anyhow the ‘.’ (domainname.).

  • Thanks Leo, that works great!

  • Thank you very much Leo.

  • Thanks Vipin and Glenn my pleasure.

  • Thank you guys.

    I was struck with this problem for a long time.

    This post helped a lot.

    Regards,

    Abhishek.

  • Hi Abhishek,

    I've recently put together a library that includes theseand other commonly used functions for the CC3100/CC3200.

    https://github.com/remixed123/startproject_ios

    Glenn
  • Thank you so much Glenn,

    I will go through the library and get back.

    Warm regards,

    Abhishek.

  • Feel free to follow my github or star the useful repositories. I should be adding more examples and useful stuff over time.

    Glenn.
  • Hello Glenn,

    In the httpserver code, i used the code given by you to change the SSID name. I copied the code in the ConnectToNetwork() function.

    Although the SSID name of CC3200 changes to CompanyNameAP, my computer rapidly connects-disconnects to the CC3200.

    The connection icon in the right side of task bar shows rapid fluctuations from red-cross icon (indicating disconnect) to blinking icon (indicating connection).

    This happens even after i restart the CC3200 device.

    Why does this happen ??

    Can you help me where exactly should i change the SSID name in the httpserver code ??

    Thank you in advance.

    Regards,

    Abhishek.

  • Hi Abhishek,

    Check out the following post for details on using SimpleLink APIs from within the HTTP Callbacks.

    It is quite possible you are experiencing issues due to this. The post includes code to work around the issue, and is the recommend way to work with SimpleLink APIs from with the HTTP Callback.

    Glenn.

  • Hi Glenn,

    I am able to change the SSID but not the URL. Below is the piece of code, where I am making changes.

    sl_Start(0,0,0);
    unsigned char ucSSID_R[] = "MY_WIFI_DEVICE";
    lRetVal = sl_WlanSet(SL_WLAN_CFG_AP_ID,
    WLAN_AP_OPT_SSID, 14, (unsigned char *)ucSSID_R);

    sl_Stop(SL_STOP_TIMEOUT);
    //Connect to Network

    lRetVal = sl_Start(0,0,0);

    unsigned char str1[32];
    unsigned char str[32] = "rajeshreddy.cdr";
    unsigned char len = strlen((const char *)str);
    lRetVal = sl_NetAppSet(SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DOMAIN_NAME,
    len, (unsigned char*)str);

    lRetVal = sl_NetAppGet(SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DNS_OPT_DOMAIN_NAME,
    &len, (unsigned char *)str1);

    lRetVal = sl_NetAppStop(SL_NET_APP_HTTP_SERVER_ID);

    I can access the page using 192.168.1.1, but not with the domain name. I tried both "rajeshreddy.cdr" and "mysimplelink.net" after this code change, but didn't succeed.

    Before this code modification, I was able to access the page using the url "mysimplelink.net".

    Please let me know what changes are required further in the code.

    Thanks,

    Rajesh

  • Hi,

    I want to change  domain name and AP-mode SSID name in httpsever example. I made changes in code like this

    //****************************************************************************
    long ConnectToNetwork()
    {
        char ucAPSSID[32]="HOPE";
        unsigned short len, config_opt;
        long lRetVal = -1;
        long retVal;
        unsigned char str[32] = "domainname.net";
        unsigned char length = strlen((const char *)str);
    
        // staring simplelink
        g_uiSimplelinkRole =  sl_Start(NULL,NULL,NULL);
    
        // Device is not in STA mode and Force AP Jumper is not Connected
        //- Switch to STA mode
        if(g_uiSimplelinkRole != ROLE_STA && g_uiDeviceModeConfig == ROLE_STA )
        {
            //Switch to STA Mode
            lRetVal = sl_WlanSetMode(ROLE_STA);
            ASSERT_ON_ERROR(lRetVal);
    
            lRetVal = sl_Stop(SL_STOP_TIMEOUT);
    
            g_usMCNetworkUstate = 0;
            g_uiSimplelinkRole =  sl_Start(NULL,NULL,NULL);
        }
    
        //Device is not in AP mode and Force AP Jumper is Connected -
        //Switch to AP mode
        if(g_uiSimplelinkRole != ROLE_AP && g_uiDeviceModeConfig == ROLE_AP )
        {
             //Switch to AP Mode
            lRetVal = sl_WlanSetMode(ROLE_AP);
            ASSERT_ON_ERROR(lRetVal);
    
            lRetVal = sl_Stop(SL_STOP_TIMEOUT);
    
            g_usMCNetworkUstate = 0;
            g_uiSimplelinkRole =  sl_Start(NULL,NULL,NULL);
        }
    
        //No Mode Change Required
        if(g_uiSimplelinkRole == ROLE_AP)
        {
           //waiting for the AP to acquire IP address from Internal DHCP Server
           while(!IS_IP_ACQUIRED(g_ulStatus))
           {
    
           }
    
           //Stop Internal HTTP Server
           lRetVal = sl_NetAppStop(SL_NET_APP_HTTP_SERVER_ID);
           ASSERT_ON_ERROR( lRetVal);
    
           //Start Internal HTTP Server
           lRetVal = sl_NetAppStart(SL_NET_APP_HTTP_SERVER_ID);
           ASSERT_ON_ERROR( lRetVal);
    
    
           retVal = sl_NetAppSet(SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DOMAIN_NAME,length, (unsigned char*)str);
    
    
           char iCount=0;
           //Read the AP SSID
           memset(ucAPSSID,'\0',AP_SSID_LEN_MAX);
           len = AP_SSID_LEN_MAX;
           config_opt = WLAN_AP_OPT_SSID;
           lRetVal = sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt , &len,
                                                  (unsigned char*) ucAPSSID);
    
    
    
    
           lRetVal= sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, len,(unsigned char*)ucAPSSID);
    
    
    
            ASSERT_ON_ERROR(lRetVal);
    
           Report("\n\rDevice is in AP Mode, Please Connect to AP [%s] and"
              "type [mysimplelink.net] in the browser \n\r",ucAPSSID);
    
           //Blink LED 3 times to Indicate AP Mode
           for(iCount=0;iCount<3;iCount++)
           {
               //Turn RED LED On
               GPIO_IF_LedOn(MCU_RED_LED_GPIO);
               osi_Sleep(400);
    
               //Turn RED LED Off
               GPIO_IF_LedOff(MCU_RED_LED_GPIO);
               osi_Sleep(400);
           }
    
        }

    I flashed the httpserver.ucf and then flashed /run the httpserver .bin. But it still shows the default AP-SSID name and domain name. Did I include the code to change SSID name and domain name at a correct place? if not where these part of code should be included?

    Thanks.