I first came across this when I was trying to make a python program that used programs to scan for wireless networks. I've used the following tools:
iwlist, iw, wpa_cli, nmcli, and iwconfig
I run into the same behavior on all of them. Suppose you're sitting by your computer and wireless access point/router. Type out one of the following commands, assuming your wifi adapter is named wlan0, turn of the router, then press enter in the terminal window.
iw wlan0 scan | grep SSID iwlist wlan0 scan | grep SSID wpa_cli -i wlan0 scan && wpa_cli -i wlan0 scan_results nmcli device wifi rescan && nmcli device wifi list
All of the commands still show the SSID for quite some time. I imagine longer than it would take for the E&M standing wave to disappear. Does anyone have any fix for this problem?
I solved this quite awhile ago, my apologies for leaving it unanswered. The following wpa_supplicant settings are responsible for the wifi behavior mentioned above:
bss_expire_count and bss_expire_age
The former is how many scans the SSID has to be missing from before it removes it from the list. The latter is the time in seconds to display an SSID after it's no longer broadcasting