Client roaming not working (Router in sta mode)

Dear All,

I have a router installed on a mobile device. It only roams once it looses contact to some AP (all APs with same SSID, PSK).

  • Router: Linksys WRT1900ACS
  • OS: OpenWrt 18.06.2, r7676-cddd7b4c77

I have uninstalled wpa-mini and installed full wpad. I am using wpa_supplicant v2.7-devel.

What have I tried:

  • Enabling bgscan in the wireless config. Does not work as the NIC driver does not support it
  • Enabling CONFIG_BGSCAN_LEARN and CONFIG_BGSCAN_SIMPLE in wpa_supplicant build time configuration, rebuild the OS and exchange the binary
  • Modifying the var/run/wpa_supplicant-wlan0.conf. Adding bgscan="simple:30:-45:300" to it. However when I either restart the wpa_suppicant (starting as seen in ps | grep wpa_supplicant output) or restart wifi the new option disappears
  • Setting the bgscan in the wpa_cli
  • I have further written a script that manually forces roaming (periodically scanning for better wifi and swap once a threshold is reached). This, however, is very unclean as it terminates existing TCP connections

None of the approaches really works. It seems like OpenWRT was never meant to support roaming as a client. But as it uses wpa_suppicant, it must somehow be supported from Software side.

Any help is really appreciated. Thanks a lot!

Best Regards,


I don't know if that option is actually built in to the build of wpad.

./var/run is a RAM disk. Just prior to starting an instance of wpad, wpad's standard hostapd ./ wpa_supplicant format config file is dynamically built from the OpenWrt config files by the /lib/netifd/ script (script is in the hostapd-common package). This script can be modified to place more options into the /var/run/wpa_supplicant.conf.

Thank you for the hint. This way, I at least manage to write the bgscan into the config file:


But it does not have an effect! Do you have some other idea?

Shouldn't it be inside the network={...} block?

According to But I can try to write it into the network file.

This option can also be set outside of all network blocks for the bgscan
parameter to apply for all the networks that have no specific bgscan

For anyone facing the same Problem:

The current version of the wpa_supplicant/wpad does not support the bgscan parameter. Hence I compiled my own wpa_supplicant binary and modified /lib/netifd/ such that it writes the bgscan parameter into /var/run/wpa_supplicant.conf. Long story short... It works!

I don't really understand why the openwrt team did not initially include it.


Hi, Mangad

Could you give me some tips.
I still try it.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.