Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

Anonymous
Not applicable

Hi,

I have a Redbear Duo and want to clear and be sure device will not try to connect unconfigured networks.

Here the question that I asked at Redbear forums : Clear Wifi DCT - WICED (Broadcom/Cypress) - Discussion Forums

Current message that show unconfigured connect trial:

Joining : �����������������������������������������������������������������������������������������������������������������������������������������������������������������

Failed to join : ����������������������������������������������������������������������������������������������������������������������������������������������������������

I am using WICED SDK 5.0.1.

0 Likes
1 Solution
PriyaM_16
Moderator
Moderator

I have modified the dct_read_write snip in WICED to clear the soft AP list of wifi_config_dct. The approach you followed appears correct.

I would suggest you lock the DCT before modifying it.

pastedImage_0.png

I have tried the application in CYW943907AEVAL1F EVK in WICED SDK 6.0.1

View solution in original post

0 Likes
6 Replies
Anonymous
Not applicable

How about this ?

static wiced_result_t config_at_worker_thread( void * arg )

{

    platform_dct_wifi_config_t  dct_wifi_config;

    if (wiced_dct_read_with_copy( &dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t) ) == WICED_SUCCESS) {

        // dct_wifi_config.device_configured = WICED_FALSE;

        memset(&dct_wifi_config, 0, sizeof(dct_wifi_config));

        if (wiced_dct_write( &dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t)) == WICED_SUCCESS) {

            const configuration_entry_t app_config[] = { {0,0,0,0} };

            r_ = wiced_configure_device( app_config );

            if (r_) GW_PRINTF("wiced_configure_device() failed! r_=%d\n", r_);

            r_ = wiced_rtos_set_event_flags(&app.events, GW_EVENT_CONFIG_FINISHED);

            if (r_) GW_PRINTF("wiced_rtos_set_event_flags(GW_EVENT_CONFIG_FINISHED) failed! r_=%d\n", r_);

        }

        else GW_PRINTF("wiced_dct_write(dct_wifi_config.device_configured=false) failed! r_=%d\n", r_);

    }

    else GW_PRINTF("wiced_dct_read(dct_wifi_config) failed! r_=%d\n", r_);

    return WICED_SUCCESS;

}

Simply with words:

  • Get DCT
  • Clear DCT
  • Write DCT to back
  • Run `wiced_configure_device()`
0 Likes
Anonymous
Not applicable

Clearing all data was a wrong choice. Only clearing the stored AP list solves my problem. But, don't know this is a right answer.

static wiced_result_t config_at_worker_thread( void * arg )

{

    platform_dct_wifi_config_t  dct_wifi_config;

    uint32_t i = 0;

    if (wiced_dct_read_with_copy( &dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t) ) == WICED_SUCCESS) {

        dct_wifi_config.device_configured = WICED_FALSE;

        for(i = 0; i < CONFIG_AP_LIST_SIZE; ++i) memset(&dct_wifi_config.stored_ap_list, 0, sizeof(wiced_config_ap_entry_t));

        // memcpy(&dct_wifi_config.mac_address, &mac_address, sizeof(wiced_mac_t));

        // dct_wifi_config.country_code = WICED_COUNTRY_TURKEY;

        if (wiced_dct_write( &dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t)) == WICED_SUCCESS) {

            const configuration_entry_t app_config[] = { {0,0,0,0} };

            r_ = wiced_configure_device( app_config );

            if (r_) GW_PRINTF("wiced_configure_device() failed! r_=%d\n", r_);

            r_ = wiced_rtos_set_event_flags(&app.events, GW_EVENT_CONFIG_FINISHED);

            if (r_) GW_PRINTF("wiced_rtos_set_event_flags(GW_EVENT_CONFIG_FINISHED) failed! r_=%d\n", r_);

        }

        else GW_PRINTF("wiced_dct_write(dct_wifi_config.device_configured=false) failed! r_=%d\n", r_);

    }

    else GW_PRINTF("wiced_dct_read(dct_wifi_config) failed! r_=%d\n", r_);

    return WICED_SUCCESS;

}

0 Likes
MichaelF_56
Moderator
Moderator

Adding the Level 1 applications team.

grsr lsri rash mady gsns ankh,wwfe

Note that it would be helpful if you could reproduce this issue using one of our eval boards since the Apps team will not have access to a Redbear Duo.

0 Likes
Anonymous
Not applicable

Thanks for the answer. I  don't have any eval board.

0 Likes
PriyaM_16
Moderator
Moderator

I have modified the dct_read_write snip in WICED to clear the soft AP list of wifi_config_dct. The approach you followed appears correct.

I would suggest you lock the DCT before modifying it.

pastedImage_0.png

I have tried the application in CYW943907AEVAL1F EVK in WICED SDK 6.0.1

View solution in original post

0 Likes
Anonymous
Not applicable

Thanks

0 Likes