Connect wifi station to specific BSSID AP programmatically

Hi everyone,

I have an OpenWrt 22.03.4 device, let's name it "StationDevice" with a conf like this one:

config wifi-device 'radio1'
  option type 'mac80211'
  option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0+1'
  option band '5g'
  option disabled '0'
  option channel 'auto'
  option country 'IT'
  option htmode 'HE20'
  option cell_density '1'
config wifi-iface 'wifi_wsta1'
  option device 'radio1'
  option disabled '0'
  option encryption 'psk2'
  option ieee80211w '0'
  option ifname 'wsta1'
  option key 'KEYHERE12345'
  option mode 'sta'
  option ssid '5G-ACCESS'
  option wds '0'

There multiple access points around StationDevice, all having the same SSID (5G-ACCESS) and WPA PSK2 password.

When StationDevice boots it will automatically select one of the available access points around.

Imagine a certain situation which causes StationDevice to select an AP which is not the best one, for example the nearest APs are momentarily turned off, suppose the best APs then come back online, what commands can I use to tell StationDevice to connect to the best AP programmatically, without changing the configuration?

Tell what system? The device? The AP? What's connecting to what? Where's OpenWRT involved?

There's so much more info you need to provide to even begin getting towards an answer.

1 Like

I tried to add clarity to the question, please let me know if there's still information missing.

Is the question clearer now? I hope so, any help will be appreciated, thanks in advance.