Comments (2)
For those looking to do the same thing, here are the function you need to access the SSID and password before the connection is made:
ESP8266
String getStoredSSID(){
struct station_config conf;
wifi_station_get_config(&conf);
return (char *) conf.ssid;
}
ESP32
String getStoredSSID(){
wifi_config_t cachedConfig;
esp_err_t configResult = esp_wifi_get_config( (wifi_interface_t)ESP_IF_WIFI_STA, &cachedConfig );
if( configResult == ESP_OK ){
return (char *) cachedConfig.ap.ssid;
}
}
With both of these, you can get the saved password by replacing 'ssid' with 'password'.
from wifimanager.
esp32 cannot obtain ssid until you init wifi.
also already in wm
// check if the module has a saved ap to connect to
bool getWiFiIsSaved();
// helper to get saved password, if persistent get stored, else get current if connected
String getWiFiPass(bool persistent = true);
// helper to get saved ssid, if persistent get stored, else get current if connected
String getWiFiSSID(bool persistent = true);
Also this is already doable in esp
WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); // wifi_scan_method_t scanMethod
WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL); // wifi_sort_method_t sortMethod - WIFI_CONNECT_AP_BY_SIGNAL,WIFI_CONNECT_AP_BY_SECURITY
from wifimanager.
Related Issues (20)
- Dedicated Parameter Page HOT 1
- Unable to save/retrieve custom variables in WiFiManager
- Q: ESP Reboot after successful initial connection to own wifi possible (bind issue with Async Webserver from AP to STA)
- Esp32 wroom 32 UE
- Question: Is there a way to detect if the WiFi connection is successful before the config portal closes? HOT 1
- Force remove DNS input from Captive portal
- Question: Is possible change deep link to redirect to an App instead of Captive Portal HOT 3
- Add new Release to platformio HOT 5
- Custom Param doesn't load when starting ConfigPortal on demand & WiFi has been already connected.
- Hi
- How to refresh (repaint) custom param element on setValue() HOT 2
- unable to do OTA update for esp32 s3. update failed due to error in downloading version. unable to find the where the exact issue is?
- OTA UPDATE ISSUE HOT 1
- Changing STA config's authmode causes the STA config's SSID to become empty
- Custom configuration, on demand server, and invoking web server for future config updates
- CN language strings 界面设置为中文的解决办法 HOT 2
- Blue LED HOT 1
- OnDemand AP fails with unhandled exception HOT 2
- Enhancement request : reconnect to AP when available, even if portal was started
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifimanager.