[GH-ISSUE #1283] How to get saved SSID and Password #1099

Open
opened 2026-02-28 01:28:31 +03:00 by kerem · 1 comment
Owner

Originally created by @rickyanwar on GitHub (Aug 25, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1283

i make like this to get wifi ssid and password, but when reboot i got blank, any solution for this ?

     String ssid = WiFi.SSID();
     String password = WiFi.psk();
Originally created by @rickyanwar on GitHub (Aug 25, 2021). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1283 i make like this to get wifi ssid and password, but when reboot i got blank, any solution for this ? ``` String ssid = WiFi.SSID(); String password = WiFi.psk(); ```
Author
Owner

@Sudesha228 commented on GitHub (Aug 28, 2021):

We can do it with ESP8266.

#include <EEPROM.h> //The EEPROM libray
String string_Value;
float float_Value=111.2222;

void setup() {
string_Value=String(float_Value,4);
string_Value=string_Value+";";
EEPROM.begin(512);
for(int n=0; n< string_Value.length();n++){
EEPROM.write(n,string_Value[n]);
}
/* Configuration Variables for the AP name and IP. */
const char *ssid = "Test";
const char *password = "Password";
IPAddress ap_local_IP(192,168,1,1);
IPAddress ap_gateway(192,168,1,254);
IPAddress ap_subnet(255,255,255,0);EEPROM.commit();
}

void loop() {
// put your main code here, to run repeatedly:
}

WiFi.softAPConfig(ap_local_IP, ap_gateway, ap_subnet)
WiFi.softAP(ssid, password);

ESP8266WebServer server(80);

server.on("/", handleRoot);
server.onNotFound(handleNotFound);
server.begin();

server.send(200, "text/html", "

You are connected

");

"

You are connected

"

<!-- gh-comment-id:907570322 --> @Sudesha228 commented on GitHub (Aug 28, 2021): We can do it with ESP8266. #include <EEPROM.h> //The EEPROM libray String string_Value; float float_Value=111.2222; void setup() { string_Value=String(float_Value,4); string_Value=string_Value+";"; EEPROM.begin(512); for(int n=0; n< string_Value.length();n++){ EEPROM.write(n,string_Value[n]); } /* Configuration Variables for the AP name and IP. */ const char *ssid = "Test"; const char *password = "Password"; IPAddress ap_local_IP(192,168,1,1); IPAddress ap_gateway(192,168,1,254); IPAddress ap_subnet(255,255,255,0);EEPROM.commit(); } void loop() { // put your main code here, to run repeatedly: } WiFi.softAPConfig(ap_local_IP, ap_gateway, ap_subnet) WiFi.softAP(ssid, password); ESP8266WebServer server(80); server.on("/", handleRoot); server.onNotFound(handleNotFound); server.begin(); server.send(200, "text/html", "<h1>You are connected</h1>"); "<h1>You are connected</h1>"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1099
No description provided.