Announcements
IMPORTANT: Cypress Developer Community currently doesn’t allow sign-in to prepare for the upcoming transition. To learn more, check out our announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

Wi-Fi Combo

lefeno
New Contributor II

Hi,
I am using CYW54907 dev board, WICED SDK 6.6. My board is placed in a mix 2.4GHz, 5GHz network, 2 network has different SSID.

Normally, I can connect to 2.4GHz network and 5GHz network well. But sometimes I cant connect 2.4GHz network or even if I connect the network successfully, I cant get the ip address. I did use a phone hotspot and place the hotspot near my board, but it still can't connect. The issue lasts for 1-2 days.

I don't store ssid and password on default_wifi_config_dct.h or on dct field, I join network using wiced_join_ap_specific(). Strangely enough, if I load scan example, put my network info in default_wifi_config_dtc.h, let it autoconnect via wiced_init(), and constantly press reset button, it can recover. I don't see this case with 5GHz network.

What is the problem with my board and how can i troubleshoot it? I had some fellows who connect to 2.4GHz smoothly, but their environment doesn't have 5GHz network, so I wonder if it's because of my dev board hardware or the mixed 2.4GHz and 5GHz network has some unwanted effects on joining network.

Thanks

0 Likes
2 Replies
AditiB_81
Moderator
Moderator

Hi,

Can you provide the code example that you're using in your case setup?

Thanks

Aditi

0 Likes
lefeno
New Contributor II

Here is the code example, written in cpp. Hope it help. It needs to connect 4-5 days continuously before can connect to 2.4GHz network in 1-2 days.

#include <internal/wiced_internal_api.h>
#include "wiced.h"

uint32_t connect_to_wifi(wiced_ap_info_t* wicedApInfo, uint8_t passwordLen, const char* password) {
    wiced_result_t result;
    if (wicedApInfo->security == WICED_SECURITY_OPEN) {
        result = wiced_join_ap_specific(wicedApInfo, 0, 0);
    } else {
        result = wiced_join_ap_specific(wicedApInfo, passwordLen, password);
    }
    WPRINT_APP_INFO(("Connect to SSID=%s err=%d\n\n", wicedApInfo->SSID.value, result));
    if (result == WICED_SUCCESS) {
        result = wiced_ip_up(WICED_STA_INTERFACE, WICED_USE_EXTERNAL_DHCP_SERVER, NULL);
    }
    return result;
}

void application_start(void) {
    wiced_init();
    wiced_ap_info wicedApInfo;
    memset(&wicedApInfo, 0, sizeof(wicedApInfo));
    const char* ssid = "SSID 2.4G";
    const char* password = "12345678";
    wicedApInfo.SSID.length = strlen(ssid);
    memcpy(wicedApInfo.SSID.value, ssid, strlen(ssid));
    wicedApInfo.bss_type = WICED_BSS_TYPE_INFRASTRUCTURE;
    wicedApInfo.security = WICED_SECURITY_WPA2_MIXED_PSK;
    auto ret = connect_to_wifi(&wicedApInfo, strlen(password), password);
    WPRINT_APP_INFO(("connect_to_wifi err=%d\n\n", ret));
}
}
0 Likes