Hi,
has someone got a solution with a 8266 to join a Wi-Fi network, which SSID contains spaces?
I tried to escape the spaces with \%20 without luck, it just cannot connect.
Connecting with Smart Config worked once, but it cannot reconnect a second time.
Maybe another Wi-Fi library can do the magic?
If you could get it to work, I'd appreciate to learn how...
Regards
Laszlo
Connect an ESP8266 to a SSID containing spaces?
Re: Connect an ESP8266 to a SSID containing spaces?
hi... which is the problem in just to call
i had a similar issue with a command-like shell in which user need to connect wifi by a command like "WIFI SSID PASSWD" ... i instructed (i.e. FORCED xD) users to use urlencoded credentials to avoid writing additional spaces or special chars that could confuse tokenizer, but after decoded credentials could still contain spaces with no problems... anyway, if you need some urldecode function, i share mine:
Code: Select all
WiFi.begin("my spaced ssid", "my spaced password")
Code: Select all
char* urlDecode(char* url) {
char tmp[strlen(url) + 1];
char* src = url;
char* dst = tmp;
char hex[3];
char rep;
do {
rep = *src;
if ( rep == '%' ) { // escape
strlcpy(hex, src + 1, sizeof(hex)); // hexadecimal single byte
rep = (char) strtol(hex, NULL, 16); // store as char, if fails just truncates string
src += strlen(hex); // increment src according length read
}
*dst++ = rep;
} while ( *src++ );
return strcpy(url, tmp);
}
Re: Connect an ESP8266 to a SSID containing spaces?
Strange: elsewhere, with another ESP8266 and using a TPM router using the same name: "Fritz!Box Fon WLAN 7360", it worked OoB !
???
???
Who is online
Users browsing this forum: No registered users and 31 guests