Difficulty in connecting 2.4GHz network

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lefeno
Level 2
Level 2
First like received 10 sign-ins 5 replies posted

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
1 Solution
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

I tried your code example and tried to connect to a 2.4GHz network i.e. my phone's hotspot. I was able to connect to the network successfully. I tried resetting a few times, sometimes the join failed but on the next reset the join passes. I can change the band of my phone's hotspot to 5 GHz as well. Basically, mine is also a mixed environment.

So, the issue is not reproducible in my setup. Ideally, mix environment shouldn't cause such issues. I will suggest trying with other APs of mixed environments and seeing if the issue is reproducible in that case.

Thanks

Aditi

View solution in original post

3 Replies
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

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

Thanks

Aditi

0 Likes
lefeno
Level 2
Level 2
First like received 10 sign-ins 5 replies posted

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));
}
}
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

I tried your code example and tried to connect to a 2.4GHz network i.e. my phone's hotspot. I was able to connect to the network successfully. I tried resetting a few times, sometimes the join failed but on the next reset the join passes. I can change the band of my phone's hotspot to 5 GHz as well. Basically, mine is also a mixed environment.

So, the issue is not reproducible in my setup. Ideally, mix environment shouldn't cause such issues. I will suggest trying with other APs of mixed environments and seeing if the issue is reproducible in that case.

Thanks

Aditi