-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WiFi.SSID returning null or empty using esp_wifi_sta_get_ap_info #1743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Great solution!!!! |
You can also extract this directly from nvs.
|
just another ping on this: ran into this issue recently. @megazero1316's solution appears to work great. any idea why it hasn't been merged in yet? |
yes, is good solution |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
looks like a bug in IDF. commenting here to stop stale[bot] from closing this issue. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
@me-no-dev : is |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
it grabs the configuration so I imagine it's the one configured. |
no, the original code does not: https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiSTA.cpp#L547 it grabs I think IDF works as designed. it should not return an SSID if not currently connected. Question is, what does a Arduino user expect? Should we return the configured SSID if not connected? |
this is a good question... maybe we should |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: 30/jul/2018
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 92600
Description:
As far as i know that if esp32 connected to a wifi it store the configuration in the flash but calling WiFi.SSID() return null after restarting esp32, what i notice is that the SSID is called from esp_wifi_sta_get_ap_info while the psk is called esp_wifi_get_config in WiFiSTA.cpp
the way i solved this problem is i copied the code in WiFi.psk() and added to WiFi.SSID() like this :
and everything went good for me , is this consider a good solution for this problem ? as i was looking for others solutions but couldn`t find
Sketch:
The text was updated successfully, but these errors were encountered: