Page 1 of 1

ESP32 scan for ssid

Posted: Mon Apr 03, 2023 7:46 pm
by WingNut
Quick Q about this macro. It returns and index number to a max of 8. What determines which ssid is which index id. If for example i put this in a loop and prints the results to a screen, will it always be the same wifi connection for 0, for 1 etc? And what determines this? Is it signal strength?

Thanks in advance
N - esp noob

Re: ESP32 scan for ssid

Posted: Mon Apr 03, 2023 11:28 pm
by BenR
Hello,

Wifi routers with broadcast ssid enabled periodically send out their ssid. The esp simple listens for these messages and reports them in the order it receives them.

So no it won't always be the same order and is best to check the names of ssids from the scan before connecting.

Re: ESP32 scan for ssid

Posted: Tue Apr 04, 2023 6:18 am
by WingNut
Thanks Ben