Multiple network to the same SSID with d-bus api

Dan Williams dcbw at
Wed Jun 21 08:40:36 PDT 2017

On Mon, 2017-06-12 at 23:14 +0200, Radoslaw Martyniszyn wrote:
> Hello,
> In my application I would like to connect to a predefined AP 1
> (BSSID+SSID) or select any AP 2 with the same SSID in case default AP
> 1
> disappears or I cannot connect to it. I believe that could be
> achieved
> by the following config:
> network={
>   ssid="theSameSSID"
>   bssid=00:11:22:33:44:55
>   psk="theSamePSK"
>   priority=1
> }
> network={
>   ssid="theSameSSID"
>   psk="theSamePSK"
>   priority=0
> }
> Could I use wpa_supplicant d-bus API to achieve above functionality?
> I think I could achieve above functionality creating two instances of
> network fi.w1.wpa_supplicant1.Interface.AddNetwork. Network1 would
> contain SSID, BSSID, priority=1 while Network2 would
> contain SSID, priority=0. Next I would call
> fi.w1.wpa_supplicant1.Interface.SelectNetwork on Network1. Does my
> plan make any sense? Should wpa_supplicant connect to Network2
> automatically if there is no AP1? My initial test showed that
> wpa_supplicant do not connect to AP2 in case I turn off AP1, but I
> need to check that more deeply.

Yes, this is how it works.  You call AddNetwork and in response you
will get a unique D-Bus Object Path that represents the network.  The
Object Path is what you pass to the SelectNetwork and that allows you
to uniquely specify the network even if they have the same SSID.

If you do not select a specific network, the supplicant will auto-
select one for you.  It should respect the "priority" property.  But if
it's not, getting the "-dddt" output from the supplicant would be


More information about the Hostap mailing list