I’ve committed a change to the esp32wifi component, to try to support a promiscuous mode for the wifi client. This should make it work the way it does on cellphones, computers, and pretty much all equipment. Rather than specifying a specific wifi AP to connect to, it just connects to whichever it can (based on where it has connected to in the past).

Up until now, we’ve supported the wifi client mode as follows:


That seems to work well, and reconnection now seems pretty robust.

What I’ve committed today supports this variant:


The module should then connect to either SSID1 or SSID2, whichever comes into range.

I’ve got no idea how phones, laptops, etc, actually implement it, and can’t find much information on the ESP32 resources or forums. There is certainly no magic ‘here is a list of SSIDs - connect to whichever comes close’ function in the wifi libraries. So, I ended up implementing the following logic:


It’s not elegant, but seems to work. Change is isolated in esp32wifi.{h,cpp}, which is pretty small and manageable at the moment. Please give it a go, and let me know how it works out for you.

Regards, Mark.

P.S. Also found (and cleaned up) a big stonking memory leak in ‘wifi scan’.