wpa_supplicant: Help chasing down regular WiFi disconnects on Raspberry Pi?

Jouni Malinen j at w1.fi
Sun Apr 7 06:30:27 PDT 2019

On Thu, Mar 21, 2019 at 07:15:33PM +0000, bls s wrote:
> On affected systems, carrier drops at semi-regular intervals (approximately every 5 1/2 to 6 minutes, but sometimes more frequently). The message in the wpa_supplicant debug log is "wlan0 ....Remove id... 'SSID' due to wpa_bss_flush_by_age" (see logs below)

That message is not of relevance for the issue, i.e., it is expected
behavior. All that there is about disconnection is this:

RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=2 linkmode=1 ifi_family=0 ifi_flags=0x1003 ([UP])
nl80211: Event message available
nl80211: Ignored event (cmd=48) for foreign interface (ifindex 3 wdev 0x0)
nl80211: Drv Event 48 (NL80211_CMD_DISCONNECT) received for wlan0
nl80211: Disconnect event
wlan0: Event DEAUTH (12) received
wlan0: Deauthentication notification
wlan0:  * reason 0 (locally generated)
Deauthentication frame IE(s) - hexdump(len=0): [NULL]
wlan0: CTRL-EVENT-DISCONNECTED bssid=4c:01:43:69:21:16 reason=0 locally_generated=1

In other words, the kernel driver is indicating that the association has
been lost. This does not look like anything that would be caused by

> When I first started looking into this, I found that the Pixel desktop (specifically, lxpanel) does wpa_cli SCANs every minute. So, I made a script (wpaping) that does a 'wpa_cli -i wlan0 scan' every 2 minutes, and the disconnects stopped. Most of the time, but not always, so still hunting for the root cause.

I'd guess this periodic scan operation keeps the driver active and not
losing some state or synchronization with the AP.

> Again, not thinking that this is a wpa_supplicant issue. I suppose this could be a brcm wireless driver issue, or some issue with a bunch of different Access Points. If it is, hoping that there's a magic config setting to correct it ;)

Looks like a driver issue to me.. Either the local driver somehow loses
the connection, e.g., due to not seeing Beacon frames from the AP or
thinking the connection is idle and not used, etc.; or the AP
disconnects the station for some reason (though, in that case the
locally_generated=1 flag should not be there).

> Thanks in advance for any guidance, suggestions, and/or condolences.

The best next step would be to debug the driver to see why it reports
disconnection in about 5.3-6 minutes from association.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list