Ok just a new post here because the old one is getting quite long..
I think I may have cracked it. There is another file
/data/misc/wifi/wpa_supplicant.conf.
When I add the bgscan line into there it parses the line upon starting wpa_supplicant because it throws an error when starting complaining this is not a global variable. So I added it manually to the network specific configuration area like so:
Code:
ctrl_interface=wlan0
driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
update_config=1
device_name=endeavoru
manufacturer=HTC
model_name=HTC One X
model_number=HTC One X
serial_number=SH34BW101272
device_type=10-0050F204-5
config_methods=physical_display virtual_push_button
p2p_disabled=1
disassoc_low_ack=1
p2p_go_max_inactivity=60
p2p_go_ht40=1
p2p_multi_chan=1
concurrent_sched_scan=1
autoscan=periodic:30
network={
ssid="Mobile-Wireless"
psk="<VERYSECRETPASSWORD"
key_mgmt=WPA-PSK
priority=2
bgscan="simple:20:-30:20"
}
Bottom line under network configuration
bgscan="simple:20:-30:20". Beware this is a very bad setting because it implies now:
Do background scans when the signal gets lower than -30db (so almost continuously, this was on purpose for my testing)
Then rescan every 20 seconds, and I believe the second 20 value is the scan interval when the signal is good.
Despite being a bad value'd test setup.
IT WORKSSS!!!
I can see it re scanning every 20 seconds and considering the roaming candidates. WHOOHOO.
I'm not sure how to put a line in that file from source because it's maintained on the fly I guess because the network is added to it when you connect to it and provide the key. So someone has to make a change in the code that appends lines in that file upon connecting to an unknown network and saving it in there.
In case anyone goes working on this; a sensible config like would be:
bgscan="simple:30:-65:300"
So don't bgscan unless the signal gets worse than -65db and then once every 30 seconds.
When the signal is good do it every 300 seconds.
:victory::victory::victory::victory::victory:
So now all we need is a developer who can change whatever code that generates that /data/misc/wifi/wpa_supplicant.conf to include an extra line per network that gets added. That should resolve the issue. Again, I have no dev skills so I'm kindly asking someone to have a look at this.
So until this gets merged we actually have a manual fix.. ADB pull the file, put the line in the network section. Push it back and fix the permissions and ownership. Then reboot or wpa_cli reconfigure.
Re-testing now on the stock CM10.2 20131002 nightly to see if it works without the CONFIG_BGSCAN=y