cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

mvpablo
New Contributor II

Hi

I'm trying to  connect my dev kit to WiFi using the WICED SDK  wiced_network_up() function and the device gets the error 4

the function gets stuck trying to get an IP address. See stack trace below and configuration.

I know this takes quite some time first time to connect in the network that I'm testing (2.4 GHz). sometimes around 20 to 40 seconds

If I switch to the 5GHz  channel the process is successful right away

Is there a way to configure the process to reattempt to get the IP several times or wait longer time before it throws the error?

thanks

Starting WICED Wiced_006.004.000.0061

Platform CYW943907AEVAL1F initialised

Started ThreadX v5.8

WICED_core Initialized

Initialising NetX_Duo v5.10_sp3

Creating Packet pools

WLAN MAC Address : C4:AC:59:98:AE:36

WLAN Firmware    : wl0: May  2 2019 02:34:15 version 7.15.168.130 (r714231) FWID 01-7fc7cd46

WLAN CLM         : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2019-05-02 02:29:29

Joining : mynetwork

Failed to join : mynetwork

Joining : mynetwork

Successfully joined : mynetwork

Obtaining IPv4 address via DHCP

L1420 : dhcp_client_init() : DHCP CLIENT hostname = [WICED IP]

Unable to obtain IP address via DHCP

/* This is the default AP the device will connect to (as a client)*/

#define CLIENT_AP_SSID       "mynetwork"

#define CLIENT_AP_PASSPHRASE "mynetworkpass"

#define CLIENT_AP_BSS_TYPE   WICED_BSS_TYPE_INFRASTRUCTURE

#define CLIENT_AP_SECURITY   WICED_SECURITY_WPA2_MIXED_PSK

#define CLIENT_AP_CHANNEL    1

#define CLIENT_AP_BAND       WICED_802_11_BAND_2_4GHZ

0 Likes
1 Solution
mvpablo
New Contributor II

I guess it is a problem with my router and how flaky is my 2.4 wifi channel.

thanks for your answer

View solution in original post

0 Likes
5 Replies
AditiB_81
Moderator
Moderator

Hi,

Can you share your code example or provide us with the pointers to reproduce the issue? Why is it that initially it takes around 20 to 40 seconds to connect to your network? Does that happen every time or only at the initial stage?

Thanks

0 Likes
mvpablo
New Contributor II

I have no idea why the first time it takes several seconds to join a 2.4Ghz network. Maybe it is my router. But once it is done the first time, then when I reset the dev kit it will join faster.

Below is the only code I'm executing

void application_start( ) {

    wiced_result_t ret = WICED_SUCCESS;

    ret = wiced_network_up( WICED_AWS_DEFAULT_INTERFACE, WICED_USE_EXTERNAL_DHCP_SERVER, NULL );

  if ( ret != WICED_SUCCESS )

    {

        WPRINT_APP_INFO( ( " Not able to join the requested AP\n\n" ) );

        return;

    }

}

0 Likes
AditiB_81
Moderator
Moderator

Hello,

I tried to use the same code to see if I am able to join the requested AP and obtain the IP address. Below is the snapshot attached and my device can resolve the IP address.

pastedImage_0.png

I see in your previous response that you provided the details of the default AP that the device will connect to

/* This is the default AP the device will connect to (as a client)*/

#define CLIENT_AP_SSID       "mynetwork"

#define CLIENT_AP_PASSPHRASE "mynetworkpass"

#define CLIENT_AP_BSS_TYPE   WICED_BSS_TYPE_INFRASTRUCTURE

#define CLIENT_AP_SECURITY   WICED_SECURITY_WPA2_MIXED_PSK

#define CLIENT_AP_CHANNEL    1

#define CLIENT_AP_BAND       WICED_802_11_BAND_2_4GHZ

Have you added this in your main application? Or changed the SSID and PASSPHRASE in the wifi_config_dct.h? Did you used the "default wifi_config_dct.h" file in the "include" folder in WICED or added it to the application folder?

Did you face the same problem with other APs as well? Did you trying changing the AP?

Thanks

0 Likes
mvpablo
New Contributor II

I guess it is a problem with my router and how flaky is my 2.4 wifi channel.

thanks for your answer

View solution in original post

0 Likes
gica_284176
New Contributor II

Dear PaMu

Maybe help you, a try for day, to have an ip from a router, with dhcp, with a random success.

I found that the first 3 byte on the mac, must be listed in the router, registered  from IEEE.

The other is your mac dependind , for the board.

If the first isn't listed, no answer from router.

Example

// 3 bytes Address Cypress Semiconductor from IEEE registered list

    ETH_uniqueId[0] = 0x00 ;

    ETH_uniqueId[1] = 0xa0 ;

    ETH_uniqueId[2] = 0x50 ;

    // 3 bytes my mac from psoc5lp  micro ID

    ETH_uniqueId[3] |= CY_GET_XTND_REG8((void CYFAR *) (CYREG_FLSHID_CUST_TABLES_WAFER_NUM ));

    ETH_uniqueId[4] =  CY_GET_XTND_REG8((void CYFAR *) (CYREG_FLSHID_CUST_TABLES_X_LOC));

    ETH_uniqueId[5] = CY_GET_XTND_REG8((void CYFAR *) (CYREG_FLSHID_CUST_TABLES_Y_LOC)) ;

After this, work like a candy

Best Regards

CocoritoCocorito

0 Likes