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.

Configuring static IP in serial wifi example

Other Parts Discussed in Thread: CC3200, UNIFLASH

Hi,

I am trying to implement serial_wifi example using static ip. I have edited the code in 'ConfigureSimpleLinkToDefaultState()' function in 'network_if.c'  file and in 'InitDevice()' function in 'serial_wifi.c' file.

// Enable DHCP client
//    lRetVal = sl_NetCfgSet(SL_IPV4_STA_P2P_CL_DHCP_ENABLE,1,1,&ucVal);	// Commented to disable DHCP mode
//    ASSERT_ON_ERROR(lRetVal);

//*** Added to enable static IP mode
	SlNetCfgIpV4Args_t ipV4;
	ipV4.ipV4 = (unsigned long)SL_IPV4_VAL(192,168,0,90); // unsigned long IP  address
	ipV4.ipV4Mask = (unsigned long)SL_IPV4_VAL(255,255,255,0); // unsigned long Subnet mask for this AP/P2P
	ipV4.ipV4Gateway = (unsigned long)SL_IPV4_VAL(255,255,255,255); // unsigned long Default gateway address
	ipV4.ipV4DnsServer = (unsigned long)SL_IPV4_VAL(255,255,255,255); // unsigned long DNS server address
	lRetVal = sl_NetCfgSet(SL_IPV4_STA_P2P_CL_STATIC_ENABLE, IPCONFIG_MODE_ENABLE_IPV4, sizeof(SlNetCfgIpV4Args_t), (unsigned char *) &ipV4);
	sl_Stop(0);
	sl_Start(NULL,NULL,NULL);
	ASSERT_ON_ERROR(lRetVal);
//***

I am not able to ping my device. Can anyone please guide me to configure my device for static IP?

  • Hi Tanvi,

    Thanks for your question. Please refer to the "power_measurement" SDK example where there is an example which configures the device for static IP. However, your code above seems to set the static IP correctly. How did you verify that CC3200 AP doesn't have the correct IP address?

    Best,

    Austin

  • Hi Austin,

    Thanks for your reply.

    I tried to ping my CC3200 launchpad through my PC, but was not able to ping it successfully. 

    Now I tried to load the program in serial flash using UniFlash. After which I was able to ping th launchpad successfully. Now the problem is I am not able to debug the program using CCS. While debugging, the device is not working properly.