How can I print the Wifi name and password on the serial screen ? #313
-
Firstly thank you so much for this library. For my school project, I need to show the wifi name and password, but I don't know how to get it from EEPROM after connecting to WiFi |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For ESP32, you can get the SSID and Password of the current AP after a connection has been established by calling the API of the ESP-IDF natively. wifi_config_t conf;
if (esp_wifi_get_config(WIFI_IF_STA, &conf) == ESP_OK) {
Serial.printf("SSID: %s\n", (char*)conf.sta.ssid);
Serial.printf("Password: %s\n", (char*)conf.sta.password);
}
|
Beta Was this translation helpful? Give feedback.
For ESP32, you can get the SSID and Password of the current AP after a connection has been established by calling the API of the ESP-IDF natively.
esp_wifi_get_config(wifi_interface_t, wifi_config_t*)
Get the configuration of specified interface. You should specify
WIFI_IF_STA
for the 1st parameter. The current configuration is returned into the second parameter.wifi_sta_config_t
STA configuration settings for the ESP32. It has an SSID and Password as public members.