wifi link lost notification when turn off AP

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

cross mob
WaLo_3890256
Level 2
Level 2
5 replies posted 10 questions asked 5 questions asked

Hello,

We are using modus2.0 running psoc6 CY8CKIT_062_WIFI_BT with AWS FreeRTOS.

Our wifi role is station, connected to hotspot device like cell phone, laptop, or "real" access point.

If station disassociated with ap, we should get an link lost event notification.

#define WLC_E_DISASSOC_IND                12 /**< 802.11 DISASSOC indication occurs when the connected station gets disassociates from SOFTAP,

                                                  also when STA gets diassociated by the AP*/

1. When turn off hotspot device, we can receive WLC_E_DISASSOC_IND and link is down.

2. But when connected to general access point, if turn off that ap, we can't receive event so that the network state machine is wrong.

For my understanding, I think both scenario is the same, but why no.2 can't receive event?

Could you help how to clarify this issue?

Thanks.

BR,

Wayne

0 Likes
1 Solution
WaLo_3890256
Level 2
Level 2
5 replies posted 10 questions asked 5 questions asked

After that found "WLC_E_LINK" will be triggered when AP is being shutdown. But we need to check "whd_join_status".

If AP is down, "reverse of JOIN_LINK_READY" is also be triggered. So we can use this status to notify network state machine has been changed.

case WLC_E_LINK:
   if ( (event_header->flags & WLC_EVENT_MSG_LINK) != 0 )
  {
  WPRINT_WHD_DEBUG( ("JOIN_LINK_READY!!!!\n") );
  whd_driver->internal_info.whd_join_status[event_header->bsscfgidx] |= JOIN_LINK_READY;
  }
   else
  {
  WPRINT_WHD_DEBUG( ("~JOIN_LINK_READY!!!!\n") );
  _onNetworkStateChangeCallback( AWSIOT_NETWORK_TYPE_WIFI, eNetworkStateDisabled );
  whd_driver->internal_info.whd_join_status[event_header->bsscfgidx] &= ~JOIN_LINK_READY;
  }
   break;

View solution in original post

0 Likes
5 Replies
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

Hello WaLo_3890256

Can you check the wireshark logs and see if the AP is sending out the 802.11 disassoc event frames?

Thanks

Hello,

I have used omnipeek air sniffer, if shut down AP directly, AP won't send Deauthentication packet to client. So that client can't receive WLC_E_DISASSOC_IND.

Is there any way to track if connection activity is still good or lost in whd driver?

Thanks.

BR,

Wayne

0 Likes

WaLo_3890256

If the AP doesn't send the disassoc event, then there is nothing much the WHD driver can do.

You can check the link status/connectivity in this case by pinging the AP periodically.

Thanks

0 Likes

Hi MuraliR,

Thanks for your reply. I understand what you mean. In our application we can't do ping specific AP periodically.

Actually we need to know the link status to notify our network state machine. If AP is being shut down or RF environment is not good(if our module is far away from AP), we should get the event that connection is down.

We have enable all debug configuration in whd_debug.h, but we can't see any log when shut down AP directly.

We also add "WLC_E_BEACON_RX/WLC_E_BEACON_FRAME_RX/WLC_E_BCNLOST_MSG" to join_events table. But there is no event come in "whd_wifi_join_events_handler" when AP is shut down.

#define WPRINT_ENABLE_WHD_ERROR

#define WPRINT_ENABLE_WHD_INFO

#define WPRINT_ENABLE_WHD_DEBUG

const whd_event_num_t join_events[]  =

{

     WLC_E_SET_SSID, WLC_E_LINK, WLC_E_AUTH, WLC_E_DEAUTH, WLC_E_DEAUTH_IND, WLC_E_DISASSOC_IND,      WLC_E_PSK_SUP, WLC_E_CSA_COMPLETE_IND, WLC_E_DISASSOC, WLC_E_BEACON_RX,

     WLC_E_BEACON_FRAME_RX, WLC_E_BCNLOST_MSG, WLC_E_NONE

};

Is there any beacon value or any other events we can implement so that we can know the connection status?

Thanks for your help.

0 Likes
WaLo_3890256
Level 2
Level 2
5 replies posted 10 questions asked 5 questions asked

After that found "WLC_E_LINK" will be triggered when AP is being shutdown. But we need to check "whd_join_status".

If AP is down, "reverse of JOIN_LINK_READY" is also be triggered. So we can use this status to notify network state machine has been changed.

case WLC_E_LINK:
   if ( (event_header->flags & WLC_EVENT_MSG_LINK) != 0 )
  {
  WPRINT_WHD_DEBUG( ("JOIN_LINK_READY!!!!\n") );
  whd_driver->internal_info.whd_join_status[event_header->bsscfgidx] |= JOIN_LINK_READY;
  }
   else
  {
  WPRINT_WHD_DEBUG( ("~JOIN_LINK_READY!!!!\n") );
  _onNetworkStateChangeCallback( AWSIOT_NETWORK_TYPE_WIFI, eNetworkStateDisabled );
  whd_driver->internal_info.whd_join_status[event_header->bsscfgidx] &= ~JOIN_LINK_READY;
  }
   break;

0 Likes