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.

LAUNCHXL-CC3235SF: newbie question: how to connect to 5GHz network

Part Number: LAUNCHXL-CC3235SF
Other Parts Discussed in Thread: CC3235SF,

Hello, 

I have made modifications to the mqtt_client_CC3235SF_LAUNCHXL_tirtos7_ticlang example (with WIFI credentials and MQTT broker address only). Because I emulate the network using my mobile, I can easily switch between a 2.4GHz and a  5GHz AP. Everything functions properly when connecting to a 2.4GHz WiFi access point (AP). However, the code does not seem to find any 5GHz network. 

I attempted to resolve the issue by adding the SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G flag using the sl_WlanSetMode() function, but it did not solve the problem. The AP and LAUNCHXL-CC3235SF are in close proximity, and I can successfully connect to the AP using my laptop, so it shouldn't be an issue with the AP.

I also tried the manual connection method mentioned in the swru455m document (section 4.3.3.3), but this approach also did not resolve the problem.

SlWlanScanParam5GCommand_t ScanParamConfig5G;
ScanParamConfig5G.ChannelsMask = 0x3FFFFFFF; // Select ChannelsMask for channels 36, 40, 44, 48
ScanParamConfig5G.RssiThreshold = -99;
ret = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,
                 SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G,
                 sizeof(ScanParamConfig5G),
                 (uint8_t *)(&ScanParamConfig5G));
assert (ret == 0);

uint8_t WifiMode = 1;
ret = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,
                 SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G, 1,
                 (uint8_t *)&WifiMode);

/* Enable scan */
uint8_t hiddenSsid = 1;
uint8_t policyOpt = SL_WLAN_SCAN_POLICY(1, hiddenSsid);
/* Set scan policy - this API starts the scans */
uint32_t ScanIntervalinSec = 5;
ret = sl_WlanPolicySet(SL_WLAN_POLICY_SCAN, policyOpt,
                     (uint8_t*)(&ScanIntervalinSec),
                     sizeof(ScanIntervalinSec));
assert (ret == 0);

sleep(ScanIntervalinSec);

uint8_t* ssid = (uint8_t*)"test5G";
SlWlanSecParams_t secParams;
secParams.Key = (signed char*)"Chong1234";
secParams.KeyLen = strlen((const char *)(secParams.Key));
secParams.Type = SL_WLAN_SEC_TYPE_WPA_WPA2;
ret = sl_WlanSetMode(ROLE_STA);
ret = sl_Stop(SL_STOP_TIMEOUT);
ret = sl_Start(0, 0, 0);
ret = sl_WlanConnect((const signed char *)(ssid),
                           strlen((const char *)(ssid)), 0,
                           &(secParams), 0);
assert (ret == 0);

But I am able to scan for 5GHz WiFi AP stations and show in terminal with following code. 

/* Set scan parameters for 5Ghz */
SlWlanScanParam5GCommand_t ScanParamConfig5G;
ScanParamConfig5G.ChannelsMask = 0x3FFFFFFF; // Select ChannelsMask for channels 36, 40, 44, 48
ScanParamConfig5G.RssiThreshold = -99;
ret = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,
                 SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G,
                 sizeof(ScanParamConfig5G),
                 (uint8_t *)(&ScanParamConfig5G));
assert (ret == 0);

uint8_t WifiMode = 1;
ret = sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,
                 SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G, 1,
                 (uint8_t *)&WifiMode);

/* Enable scan */
uint8_t hiddenSsid = 1;
uint8_t policyOpt = SL_WLAN_SCAN_POLICY(1, hiddenSsid);
/* Set scan policy - this API starts the scans */
uint32_t ScanIntervalinSec = 5;
ret = sl_WlanPolicySet(SL_WLAN_POLICY_SCAN, policyOpt,
                     (uint8_t*)(&ScanIntervalinSec),
                     sizeof(ScanIntervalinSec));
assert (ret == 0);

sleep(ScanIntervalinSec);

/* Show scan networks in terminal */
SlWlanNetworkEntry_t Entries[10];
_u8 i;
_i16 resultsCount = sl_WlanGetNetworkList(0,10,&Entries[0]);
UART_PRINT("resultsCount:%d\r\n",resultsCount);
for(i=0; i< resultsCount; i++)
{
    UART_PRINT("%d. ", i + 1);
    UART_PRINT("SSID: %.32s        ", Entries[i].Ssid);
    UART_PRINT("BSSID: %x:%x:%x:%x:%x:%x    ", Entries[i].Bssid[0], Entries[i].Bssid[1], Entries[i].Bssid[2], Entries[i].Bssid[3], Entries[i].Bssid[4], Entries[i].Bssid[5]);
    UART_PRINT("Channel: %d    ", Entries[i].Channel);
    UART_PRINT("RSSI: %d    ", Entries[i].Rssi);
    UART_PRINT("Security type: %d    ", SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(Entries[i].SecurityInfo));
    UART_PRINT("Group Cipher: %d    ", SL_WLAN_SCAN_RESULT_GROUP_CIPHER(Entries[i].SecurityInfo));
    UART_PRINT("Unicast Cipher bitmap: %d    ", SL_WLAN_SCAN_RESULT_UNICAST_CIPHER_BITMAP(Entries[i].SecurityInfo));
    UART_PRINT("Key Mgmt suites bitmap: %d    ", SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(Entries[i].SecurityInfo));
    UART_PRINT("Hidden SSID: %d    ", SL_WLAN_SCAN_RESULT_HIDDEN_SSID(Entries[i].SecurityInfo));
    UART_PRINT("PMF Enable: %d    ", SL_WLAN_SCAN_RESULT_PMF_ENABLE(Entries[i].SecurityInfo));
    UART_PRINT("PMF Required: %d\r\n", SL_WLAN_SCAN_RESULT_PMF_REQUIRED(Entries[i].SecurityInfo));
}

  • Hi Leo,

    Are you able to connect to the 5G AP with the network terminal demo?

  • Thank you for your reply.

    No. I am not able to 5G AP with the network terminal demo. 

    Here is the command I sent to terminal

            ============================================
               Network Terminal Example Ver: 1.0.1.0
            ============================================
    
             CHIP: 0x31100019
             MAC:  3.7.0.1
             PHY:  3.1.0.26
             NWP:  4.13.0.2
             ROM:  8738
             HOST: 3.0.1.71
             MAC address: 34:03:de:10:f6:f4
    
            ============================================
    
    ================================================================================
    Available commands:
    
    help                scan                setpolicy           wlanconnect         
    wlan_ap_start       addprofile          getprofile          wlandisconnect      
    wlan_ap_stop        connected_stations  ping                send                
    recv                createfilter        enablefilter        mdnsadvertise       
    enablewowlan        deletefilter        disablefilter       mdnsquery           
    radiotool           p2pstart            AntSelectionEnable  SoftRoamingEnable   
    CoexEnable          p2pstop             AntSelectionDisable SoftRoamingDisable  
    CoexDisable         APTransitionEnable  TrigRoamingEnable   clear               
    Countrycode         APTransitionDisable TrigRoamingDisable  
    
    ================================================================================
    
    
    user:wlanconnect -s "test5G" -p "Chong1234" -t WPA2      
    [wlanconnect] : Timeout expired connecting to AP: test5G

  • Can you change the AP's settings to open network and try again? And is the CC3235 able to scan for it?

  • Despite changing the AP's settings to an open network, the problem continues to persist. After several days of trial and error, it seems the error escalated to a more severe level:

    [WIFI::ERROR] FATAL ERROR: Abort NWP event detected: AbortType=2, AbortData=0x36a

    Even when running the example network_terminal project and power cycle the board multiple times, it now displays an error in the terminal.

    Network Terminal - Couldn't configure Network Processor - -4107

  • Hi Leo,

    The error code you are getting

    #define SL_ERROR_ROLE_STA_ERR                                           (-4107L)
    Means it cant set the device to the station role.

    Lets try to work back. Erase the board and download the newest sdk and reflash the network example. Let me know if you still get errors after a new start.

    Best,

    Rogelio

  • Hi, 

    Thank you for your response.

    I have taken the necessary steps to start afresh. This involved erasing the flash memory from CC3235SF LP and reinstalling CCS (Code Composer Studio) and CC32xxSDK from the ground up. And the problem resume back to my original question. 

    Based on my analysis after more testing, I believe the issue might be related to the emulation of the access point. I have attempted to use both Windows 10 and an Android mobile hotspot, but unfortunately, the CC3235SF LP cannot detect either of them. Because I can successfully scan 5GHz WiFi channel that is advertise from a real router.

    In light of this, I would like to inquire about the specific requirements for successfully emulating a 5G access point. If I can emulate an access point from my phone or laptop, it would significantly expedite the development process.

    Here is the scan result.

            ============================================
               MQTT client Example Ver: 2.0.3
            ============================================
    
             CHIP: 0x31100019
             MAC:  3.7.0.1
             PHY:  3.1.0.26
             NWP:  4.13.0.2
             ROM:  8738
             HOST: 3.0.1.71
             MAC address: 34:03:de:10:f6:f4
    
            ============================================
    resultsCount:9
    
    1. 
    SSID: Oliver Home        
    BSSID: 4:d4:c4:c3:fd:20    
    Channel: 2    
    RSSI: -73    
    Security type: 4    
    Group Cipher: 8    
    Unicast Cipher bitmap: 8    
    Key Mgmt suites bitmap: 2    
    Hidden SSID: 0    
    PMF Enable: 0    
    PMF Required: 0
    
    2. 
    SSID:         
    BSSID: 24:f2:7f:8c:d2:c0    
    Channel: 11    
    RSSI: -69    
    Security type: 0    
    Group Cipher: 0    
    Unicast Cipher bitmap: 0    
    Key Mgmt suites bitmap: 0    
    Hidden SSID: 1    
    PMF Enable: 0    
    PMF Required: 0
    
    3. 
    SSID:         
    BSSID: 24:f2:7f:8c:d2:c1    
    Channel: 11    
    RSSI: -69    
    Security type: 4    
    Group Cipher: 8    
    Unicast Cipher bitmap: 8    
    Key Mgmt suites bitmap: 2    
    Hidden SSID: 1    
    PMF Enable: 0    
    PMF Required: 0
    
    4. 
    SSID: DIRECT-c7-HP M255 LaserJet        
    BSSID: da:12:65:9a:26:c7    
    Channel: 6    
    RSSI: -77    
    Security type: 4    
    Group Cipher: 8    
    Unicast Cipher bitmap: 8    
    Key Mgmt suites bitmap: 2    
    Hidden SSID: 0    
    PMF Enable: 0    
    PMF Required: 0
    
    5. 
    SSID: Wireless_FC        
    BSSID: a2:47:e3:51:81:77    
    Channel: 13    
    RSSI: -29    
    Security type: 4    
    Group Cipher: 8    
    Unicast Cipher bitmap: 8    
    Key Mgmt suites bitmap: 2    
    Hidden SSID: 0    
    PMF Enable: 0    
    PMF Required: 0
    
    6. 
    SSID:         
    BSSID: 24:f2:7f:8c:d0:50    
    Channel: 56    
    RSSI: -88    
    Security type: 0    
    Group Cipher: 0    
    Unicast Cipher bitmap: 0    
    Key Mgmt suites bitmap: 0    
    Hidden SSID: 1    
    PMF Enable: 0    
    PMF Required: 0
    
    7. 
    SSID:         
    BSSID: 24:f2:7f:8c:d0:51    
    Channel: 56    
    RSSI: -88    
    Security type: 4    
    Group Cipher: 8    
    Unicast Cipher bitmap: 8    
    Key Mgmt suites bitmap: 2    
    Hidden SSID: 1    
    PMF Enable: 0    
    PMF Required: 0
    
    8. 
    SSID:         
    BSSID: f4:2e:7f:a0:10:d0    
    Channel: 128    
    RSSI: -91    
    Security type: 0    
    Group Cipher: 0    
    Unicast Cipher bitmap: 0    
    Key Mgmt suites bitmap: 0    
    Hidden SSID: 1    
    PMF Enable: 0    
    PMF Required: 0
    
    9. 
    SSID:         
    BSSID: 24:f2:7f:8c:d5:90    
    Channel: 108    
    RSSI: -90    
    Security type: 0    
    Group Cipher: 0    
    Unicast Cipher bitmap: 0    
    Key Mgmt suites bitmap: 0    
    Hidden SSID: 1    
    PMF Enable: 0    
    PMF Required: 0

  • Hi Leo,

    Turning on your phone hotspot should work just fine. I would check the ssid is not hidden or else you wont find it on a scan.

    Best,

    Rogelio