-->
Page 1 of 2

Can I get current SSID? Something like WiFi.getSSID()?

PostPosted: Sun Nov 15, 2015 1:30 pm
by avc
Is there a way to get the SSID to which the ESP is currently connected to? something like WiFi.localIP()? I know after WiFi.scannetwork, I can loop through SSID(i), but I want to get the SSID to which it is connected right now. I tried WiFi.SSID() and it did not return anything. I Saw WiFi.getNetworkInfo() but not sure if that is the one to use and I could not find any documentation on how to get the SSID from this.

thanks for any hints.

Re: Can I get current SSID? Something like WiFi.getSSID()?

PostPosted: Sun Nov 15, 2015 1:44 pm
by jifopy
Does this help? https://www.arduino.cc/en/Reference/WiFiSSID

Are you defining the ssid or scanning and connecting to an ssid? This probably doesn't help you but I just print the SSID I've defined.

//Wifi Configuration
const char* ssid = "wirelessssid";
const char* password = "xxxxxx";
IPAddress local_ip(172, 2, 2, 65);
IPAddress gateway(172, 2, 2, 1);
IPAddress subnet(255, 255, 255, 0);

And then

lcd.print(ssid);

Re: Can I get current SSID? Something like WiFi.getSSID()?

PostPosted: Sun Nov 15, 2015 2:51 pm
by torntrousers
WiFi.SSID() works for me, so odd that it doesn't for you. A bug in your test, or the SSID() code?

Re: Can I get current SSID? Something like WiFi.getSSID()?

PostPosted: Sun Nov 15, 2015 6:31 pm
by avc
You are right. WiFi.SSID() works. I was trying in AP mode, my bad. Thanks very much.