Skip to content

How can I print the Wifi name and password on the serial screen ? #313

Answered by Hieromon
10furkan60 asked this question in Q&A
Discussion options

You must be logged in to vote

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);
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@10furkan60
Comment options

Answer selected by Hieromon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants