[GH-ISSUE #1372] Dash in SSID is converted to e28093 #1175

Closed
opened 2026-02-28 01:28:51 +03:00 by kerem · 4 comments
Owner

Originally created by @JohnvanderPol2 on GitHub (Mar 15, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1372

While testing a simple example of the Wifimanager i could connect to one wifi network, but when connecting to another SSID it kept failing.

I traced the problem to the SSID not being correct, even though it was selected in the WifiManager Web Interface
It kept complaining that
no WPG–OFFICE found, reconnect after 1s
While i use the SSID hardcoded (WPG-OFFICE), the WIFI does connect
When comparing the the two strings that should be equal, to my surprise they were not.

WPG–OFFICE -> 575047e280934f46464943450a
WPG-OFFICE -> 575047 2d 4f46464943450a
As can be seen it shows the dash "2d" with an unicode character "e28093"
This happens somewhere in the webinterface, and it takes this malformed SSID.

I have seen several posts more of people having problems with SSID, and I saw most of them also use a dash.
It took me several days of confusion to understand the problem.

I think its a simple error to fix.
I am taking a look now if i can "fix" the unicode character in the saveConfigCallback

Sample code
if(wifimanager.getWiFiIsSaved())
{
String storedssid=wifimanager.getWiFiSSID(true);
DBG_OUTPUT_PORT.printf("stored ssid to %s\n", storedssid.c_str());
String storedpw=wifimanager.getWiFiPass(true);
DBG_OUTPUT_PORT.printf("stored password %s\n", storedpw.c_str());//for debugging only
WiFi.begin(storedssid.c_str(), storedpw.c_str());//somehow it is not able to autoconnect sometimes, so connect when we can
int counter=0;
while(WiFi.status() != WL_CONNECTED)
{
delay(500);
if(counter==0)
{
DBG_OUTPUT_PORT.println(F("Connecting"));
}
else
{
if(strcmp(storedssid.c_str(),"WPG-OFFICE")!=0)
{
DBG_OUTPUT_PORT.print(storedssid.c_str());
DBG_OUTPUT_PORT.println("WPG-OFFICE");
}
if(strcmp(storedpw.c_str(),"xxxxxxx")!=0)
{
DBG_OUTPUT_PORT.print(storedpw.c_str());
DBG_OUTPUT_PORT.println("xxxxxxxx");
}
DBG_OUTPUT_PORT.print(F("."));
}
if(counter > 30)
{
DBG_OUTPUT_PORT.println(F("Switching to hardcoded credentials"));
break;
}
counter++;
}
counter=0;
if(WiFi.status() != WL_CONNECTED)
{
WiFi.begin("WPG-OFFICE","xxxxxxxxx");//somehow it is not able to autoconnect sometimes, so connect when we can
while(WiFi.status() != WL_CONNECTED)
{
delay(500);
if(counter==0)
{
DBG_OUTPUT_PORT.println(F("Connecting"));
}
else
{
DBG_OUTPUT_PORT.print(F("."));
}
if(counter > 30)
{
DBG_OUTPUT_PORT.println(F("Switching to wifimanager to connect"));
break;
}
counter++;
}
}
}
else
{
DBG_OUTPUT_PORT.println(F("No saved SSID data"));
}
DBG_OUTPUT_PORT.println(F("Starting autoconnect"));
if(WiFi.status() != WL_CONNECTED)
{//use the wifimanager to configure it correctly
if(!wifimanager.autoConnect("Nursery"))//no Acces Point name, nor a password for now
{
DBG_OUTPUT_PORT.println(F("failed to connect and hit timeout"));
ESP.restart();
}
if(shouldSaveConfig)
{//
saveConfiguration();
}
}
DBG_OUTPUT_PORT.printf("Connecting to %s\n", wifimanager.getWiFiSSID().c_str());
DBG_OUTPUT_PORT.printf("Password %s\n", wifimanager.getWiFiPass().c_str());//for debugging only
DBG_OUTPUT_PORT.printf("local ip %s\n", WiFi.localIP());

here logging generated with the included sample

stored ssid to WPG–OFFICE
stored password xxxxxxxx
Connecting
WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.scandone
no WPG–OFFICE found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.scandone
no WPG–OFFICE found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.scandone
no WPG–OFFICE found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.scandone
no WPG–OFFICE found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.scandone
no WPG–OFFICE found, reconnect after 1s
wifi evt: 1
STA disconnect: 201
reconnect
WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.WPG–OFFICEWPG-OFFICE
.Switching to hardcoded credentials
scandone
wifi evt: 2
Connecting
....scandone
state: 0 -> 2 (b0)
.state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 5
cnt

connected with WPG-OFFICE, channel 1

Originally created by @JohnvanderPol2 on GitHub (Mar 15, 2022). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1372 While testing a simple example of the Wifimanager i could connect to one wifi network, but when connecting to another SSID it kept failing. I traced the problem to the SSID not being correct, even though it was selected in the WifiManager Web Interface It kept complaining that no WPG–OFFICE found, reconnect after 1s While i use the SSID hardcoded (WPG-OFFICE), the WIFI does connect When comparing the the two strings that should be equal, to my surprise they were not. WPG–OFFICE -> 575047e280934f46464943450a WPG-OFFICE -> 575047 2d 4f46464943450a As can be seen it shows the dash "2d" with an unicode character "e28093" This happens somewhere in the webinterface, and it takes this malformed SSID. I have seen several posts more of people having problems with SSID, and I saw most of them also use a dash. It took me several days of confusion to understand the problem. I think its a simple error to fix. I am taking a look now if i can "fix" the unicode character in the saveConfigCallback Sample code if(wifimanager.getWiFiIsSaved()) { String storedssid=wifimanager.getWiFiSSID(true); DBG_OUTPUT_PORT.printf("stored ssid to %s\n", storedssid.c_str()); String storedpw=wifimanager.getWiFiPass(true); DBG_OUTPUT_PORT.printf("stored password %s\n", storedpw.c_str());//for debugging only WiFi.begin(storedssid.c_str(), storedpw.c_str());//somehow it is not able to autoconnect sometimes, so connect when we can int counter=0; while(WiFi.status() != WL_CONNECTED) { delay(500); if(counter==0) { DBG_OUTPUT_PORT.println(F("Connecting")); } else { if(strcmp(storedssid.c_str(),"WPG-OFFICE")!=0) { DBG_OUTPUT_PORT.print(storedssid.c_str()); DBG_OUTPUT_PORT.println("WPG-OFFICE"); } if(strcmp(storedpw.c_str(),"xxxxxxx")!=0) { DBG_OUTPUT_PORT.print(storedpw.c_str()); DBG_OUTPUT_PORT.println("xxxxxxxx"); } DBG_OUTPUT_PORT.print(F(".")); } if(counter > 30) { DBG_OUTPUT_PORT.println(F("Switching to hardcoded credentials")); break; } counter++; } counter=0; if(WiFi.status() != WL_CONNECTED) { WiFi.begin("WPG-OFFICE","xxxxxxxxx");//somehow it is not able to autoconnect sometimes, so connect when we can while(WiFi.status() != WL_CONNECTED) { delay(500); if(counter==0) { DBG_OUTPUT_PORT.println(F("Connecting")); } else { DBG_OUTPUT_PORT.print(F(".")); } if(counter > 30) { DBG_OUTPUT_PORT.println(F("Switching to wifimanager to connect")); break; } counter++; } } } else { DBG_OUTPUT_PORT.println(F("No saved SSID data")); } DBG_OUTPUT_PORT.println(F("Starting autoconnect")); if(WiFi.status() != WL_CONNECTED) {//use the wifimanager to configure it correctly if(!wifimanager.autoConnect("Nursery"))//no Acces Point name, nor a password for now { DBG_OUTPUT_PORT.println(F("failed to connect and hit timeout")); ESP.restart(); } if(shouldSaveConfig) {// saveConfiguration(); } } DBG_OUTPUT_PORT.printf("Connecting to %s\n", wifimanager.getWiFiSSID().c_str()); DBG_OUTPUT_PORT.printf("Password %s\n", wifimanager.getWiFiPass().c_str());//for debugging only DBG_OUTPUT_PORT.printf("local ip %s\n", WiFi.localIP()); here logging generated with the included sample stored ssid to WPG–OFFICE stored password xxxxxxxx Connecting WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .scandone no WPG–OFFICE found, reconnect after 1s wifi evt: 1 STA disconnect: 201 reconnect WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .scandone no WPG–OFFICE found, reconnect after 1s wifi evt: 1 STA disconnect: 201 reconnect WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .scandone no WPG–OFFICE found, reconnect after 1s wifi evt: 1 STA disconnect: 201 reconnect WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .scandone no WPG–OFFICE found, reconnect after 1s wifi evt: 1 STA disconnect: 201 reconnect WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .scandone no WPG–OFFICE found, reconnect after 1s wifi evt: 1 STA disconnect: 201 reconnect WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .WPG–OFFICEWPG-OFFICE .Switching to hardcoded credentials scandone wifi evt: 2 Connecting ....scandone state: 0 -> 2 (b0) .state: 2 -> 3 (0) state: 3 -> 5 (10) add 0 aid 5 cnt connected with WPG-OFFICE, channel 1
kerem closed this issue 2026-02-28 01:28:51 +03:00
Author
Owner

@token9 commented on GitHub (Mar 20, 2022):

I ran into the same issue today.
When connecting with dlink–xxxxxxxx
*wm:[1] Connecting to NEW AP: dlink–xxxxxxxx
*wm:[2] [EVENT] WIFI_REASON: 201
*wm:[2] [EVENT] WIFI_REASON: NO_AP_FOUND

when connecting with SSID dlinkxxxxxxxx
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] Connect to new AP [SUCCESS]

<!-- gh-comment-id:1073284777 --> @token9 commented on GitHub (Mar 20, 2022): I ran into the same issue today. When connecting with dlink–xxxxxxxx *wm:[1] Connecting to NEW AP: dlink–xxxxxxxx *wm:[2] [EVENT] WIFI_REASON: 201 *wm:[2] [EVENT] WIFI_REASON: NO_AP_FOUND when connecting with SSID dlinkxxxxxxxx *wm:[2] Connection result: WL_CONNECTED *wm:[1] Connect to new AP [SUCCESS]
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2022):

tested on git, works fine

[V][Parsing.cpp:239] _parseRequest():  Arguments: s=MyHotspot-test+%26&p=Hotspot1234%21
*wm:[2] <- HTTP WiFi save  
*wm:[3] Method: POST
*wm:[3] Sent wifi save page 
*wm:[2] processing save 
*wm:[2] Connecting as wifi client... 
*wm:[3] STA static IP:
*wm:[2] setSTAConfig static ip not set, skipping 
*wm:[1] Connecting to NEW AP: MyHotspot-test &
*wm:[3] Using Password: Hotspot1234
*wm:[3] WiFi_enableSTA enable
*wm:[1] connectTimeout not set, ESP waitForConnectResult... 
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:419] _eventCallback(): STA IP: 192.168.1.39, MASK: 255.255.255.0, GW: 192.168.1.1
*wm:[2] Connection result: WL_CONNECTED
*wm:[3] lastconxresult: WL_CONNECTED
*wm:[1] Connect to new AP [SUCCESS] 
*wm:[1] Got IP Address: 
*wm:[1] 192.168.1.39 
*wm:[2] [CB] _savewificallback calling 
[CALLBACK] saveCallback fired
*wm:[2] shutdownConfigPortal 
<!-- gh-comment-id:1076675401 --> @tablatronix commented on GitHub (Mar 23, 2022): tested on git, works fine ```php [V][Parsing.cpp:239] _parseRequest(): Arguments: s=MyHotspot-test+%26&p=Hotspot1234%21 *wm:[2] <- HTTP WiFi save *wm:[3] Method: POST *wm:[3] Sent wifi save page *wm:[2] processing save *wm:[2] Connecting as wifi client... *wm:[3] STA static IP: *wm:[2] setSTAConfig static ip not set, skipping *wm:[1] Connecting to NEW AP: MyHotspot-test & *wm:[3] Using Password: Hotspot1234 *wm:[3] WiFi_enableSTA enable *wm:[1] connectTimeout not set, ESP waitForConnectResult... [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 4 - STA_CONNECTED [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP [D][WiFiGeneric.cpp:419] _eventCallback(): STA IP: 192.168.1.39, MASK: 255.255.255.0, GW: 192.168.1.1 *wm:[2] Connection result: WL_CONNECTED *wm:[3] lastconxresult: WL_CONNECTED *wm:[1] Connect to new AP [SUCCESS] *wm:[1] Got IP Address: *wm:[1] 192.168.1.39 *wm:[2] [CB] _savewificallback calling [CALLBACK] saveCallback fired *wm:[2] shutdownConfigPortal ```
Author
Owner

@token9 commented on GitHub (Mar 25, 2022):

Yes confirmed now works OK, cheers
tested on ESP32-WROOM-32D PlatformIO arudino with master

*wm:[2] processing save
*wm:[2] Connecting as wifi client...
*wm:[2] setSTAConfig static ip not set, skipping
*wm:[1] Connecting to NEW AP: dlink-xxxxxx
*wm:[1] connectTimeout not set, ESP waitForConnectResult...
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] Connect to new AP [SUCCESS]
*wm:[1] Got IP Address:
*wm:[1] 192.168.1.100
*wm:[2] [CB] _savewificallback calling
0000312.701: saveWifiConfigCallback called.
*wm:[2] shutdownConfigPortal
*wm:[0] [ERROR] disconnect configportal - softAPdisconnect FAILED
*wm:[2] restoring usermode STA
*wm:[2] wifi status: WL_CONNECTED
*wm:[2] wifi mode: STA
*wm:[2] configportal closed
*wm:[1] config portal exiting

<!-- gh-comment-id:1079078735 --> @token9 commented on GitHub (Mar 25, 2022): Yes confirmed now works OK, cheers tested on ESP32-WROOM-32D PlatformIO arudino with master *wm:[2] processing save *wm:[2] Connecting as wifi client... *wm:[2] setSTAConfig static ip not set, skipping *wm:[1] Connecting to NEW AP: dlink-xxxxxx *wm:[1] connectTimeout not set, ESP waitForConnectResult... *wm:[2] Connection result: WL_CONNECTED *wm:[1] Connect to new AP [SUCCESS] *wm:[1] Got IP Address: *wm:[1] 192.168.1.100 *wm:[2] [CB] _savewificallback calling 0000312.701: saveWifiConfigCallback called. *wm:[2] shutdownConfigPortal *wm:[0] [ERROR] disconnect configportal - softAPdisconnect FAILED *wm:[2] restoring usermode STA *wm:[2] wifi status: WL_CONNECTED *wm:[2] wifi mode: STA *wm:[2] configportal closed *wm:[1] config portal exiting
Author
Owner

@tablatronix commented on GitHub (Mar 25, 2022):

Ill cut a new release

<!-- gh-comment-id:1079309808 --> @tablatronix commented on GitHub (Mar 25, 2022): Ill cut a new release
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#1175
No description provided.