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.

Security in CC3200 AP mode

Other Parts Discussed in Thread: CC3200

Hello everyone,

I am trying to configure CC3200 in AP mode with WPA security. I am following CC3200 SimpleLink Network Processor Subsystem - Programmer's guide.

I have written following code..

        sl_Start(NULL,NULL,NULL);
	sl_WlanSetMode(ROLE_AP);
	len = strlen(SSID_NAME);
	sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, len,(unsigned char*)SSID_NAME);
	sec_type = SL_SEC_TYPE_WPA;
	sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, (unsigned char*)&sec_type);
	len = strlen(PASS_KEY);
	sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, len, (unsigned char*)PASS_KEY);
	sl_Stop(100);

But it is not configured into WPA security mode it always configured into open mode i.e device directly connects with it without entering password.. Can anyone tell me what wrong I am doing here..??

Please help me to solve this issue..


Thanks

Niral

  • Niral,

    Which development board and SDK version are you using? Can you please check if any of the functions is returning an error?

    Below is the code snippet for configuring C3200 ES1.32 device in AP mode (w/ WPA security):

    static int ConfigureAPMode()
    {
        SINT32 retVal = -1;
        UINT8  secType = SL_SEC_TYPE_WPA;
    
        retVal = sl_WlanSetMode(ROLE_AP);
        ASSERT_ON_ERROR(__LINE__, retVal);
    
        retVal = sl_WlanSet(SL_WLAN_CFG_AP_ID,
                            WLAN_AP_OPT_SSID,
                            strlen((const char *)SSID_NAME),
                            (unsigned char*)SSID_NAME);
        ASSERT_ON_ERROR(__LINE__, retVal);
    
        retVal = sl_WlanSet(SL_WLAN_CFG_AP_ID,
                            WLAN_AP_OPT_SECURITY_TYPE, 1,
                            (unsigned char *)&secType);
        ASSERT_ON_ERROR(__LINE__, retVal);
    
        retVal = sl_WlanSet(SL_WLAN_CFG_AP_ID,
                            WLAN_AP_OPT_PASSWORD,
                            strlen((const char *)PASSWORD),
                            (unsigned char *)PASSWORD);
        ASSERT_ON_ERROR(__LINE__, retVal);
    
        /* Restart network processor */
        retVal = sl_Stop(SL_STOP_TIMEOUT);
        ASSERT_ON_ERROR(__LINE__, retVal);
    
        /* Reset status bits if any */     
    
        retVal = sl_Start(NULL,NULL,NULL);
        ASSERT_ON_ERROR(__LINE__, retVal);
        
        return retVal; /* Mode */
    }

    SDK's 'getting_started_with_wlan_ap' application demonstrates how to configure CC3200 in AP mode

    BR,

    Praneet

     

     

  • Hello Praneet,

    I have successfully configured CC3200 in AP mode with WPA security. I can connect other wi-fi device to AP but now  problem is CC3200 not responds to event "SL_NETAPP_IP_LEASED" when client connects. Is there any other event which occurs when any station connects to CC3200 when it is in AP mode??  What does "ASSERT_ON_ERROR" function do??

    Regards,

    Niral

  • Niral,

    You should get two events:

    - SL_WLAN_STA_CONNECTED_EVENT: When a station connects to CC3200

    - SL_NETAPP_IP_LEASED: When 3200 leases an IP to the connected client

     

    In 'getting_started_with_wlan_ap' application of SDKv0.5.2, 'ASSERT_ON_ERROR' returns the error-code to the caller.

    #define ASSERT_ON_ERROR(line_number, error_code) \
                {\
                    /* Handling the error-codes is specific to the application */ \
                    if (error_code < 0) return error_code; \
                    /* else, continue w/ execution */ \
                }

    BR,

    Praneet

  • I am using those only.. Below snippet represent how I am doing it..

    void sl_NetAppEvtHdlr(SlNetAppEvent_t *pNetAppEvent)
    {
    	switch( pNetAppEvent->Event )
    	{
    		case SL_NETAPP_IPV4_ACQUIRED:
    		case SL_NETAPP_IPV6_ACQUIRED:
    			g_usIpObtained = 1;
    			g_ulApIp = ((SlNetAppEvent_t*)pNetAppEvent)->EventData.ipAcquiredV4.ip;
    			break;
    
    		case SL_NETAPP_IP_LEASED:
    			g_usIpLeased = 1;
    			UART_PRINT("New Client Connected");
    			g_ulStaIp =((SlNetAppEvent_t*)pNetAppEvent)->EventData.ipLeased.ip_address;
    			break;
    		default:
    		break;
    	}
    }

    Even if IP leased by CC3200 and station gets an IP "New Client connected" is never printed on my serial terminal. What wrong I am doing..?? Is there any pre-configuration need to be done before to use these events.