iotappstory / ESP-Library

Software Distribution and Management Over the Air
GNU Lesser General Public License v2.1
124 stars 35 forks source link

IASLoader - login fails - if WiFi ssid contains "-" #106

Closed KlausJuhantalo closed 5 years ago

KlausJuhantalo commented 5 years ago

IASLoader - login fails - if WiFi ssid contains "-", even the WiFi credentials are correct.

After I changed WiFi ssid name to name that didnt have "-" character it worked.

Used esp32 (TTGO LoRa32-OLED-V1).

southseaboy commented 5 years ago

Use of some special characters in the password entered into the IASloader config webpage also causes a connect failure - & and % seem troublesome, whereas ^ and # seem to be OK.

Onno-Dirkzwager commented 5 years ago

As southseaboy pointed out on Discord. These special char do work when hardcoded with the presets. So this narrows it down to esp <> browser communication.

Onno-Dirkzwager commented 5 years ago

@KlausJuhantalo @southseaboy Testers wanted! I made a change to the master

This makes most special characters acceptable by your ESP. @ # * - = ( ) _ $ / ; : ' ! , . "

Still not ok: & % +

% and + are caused by how the ESPAsyncWebServer urlDecode method works.

& needs more research but seems te be used by the esp instead of printing it as a char

Bolukan commented 5 years ago

So we need also an espprintencoder. Anybody knows of one?

PS: I read you should (as easy solution) replace print(password) with printf(“%s”, password) to enable % in the string. For & I dont know but maybe it is related.

southseaboy commented 5 years ago

I know 0 from web coding, but I can enter my password which contains some of the still offending characters into Tasmota's WiFi config page and it works. In Tasmota the password is not shown in clear on the screen. I am using Chrome as browser.

southseaboy commented 5 years ago

Testing here confirms expected behaviour listed by @Onno-Dirkzwager above with one exception: % .... works for me, & + .... do not work

Onno-Dirkzwager commented 5 years ago

@southseaboy Where in the line did you put the %? If I put it on the end of the line it works. Halfway the line will take down the next char. (which is not that strange thinking about urlencoding)

southseaboy commented 5 years ago

Ah yes - I was just appending the special character(s) at then end of some normal text

Onno-Dirkzwager commented 5 years ago

Added a new release: https://github.com/iotappstory/ESP-Library/releases/latest

Should be in the library manager within an hour.

Onno-Dirkzwager commented 5 years ago

We will make a note for the following characters & % + and close this one as the original issue has been solved. Feel free to reopen if deemed necessary.

DocDoo commented 5 years ago

Hi @Onno-Dirkzwager

On the 4th of March you mentioned

We will make a note for the following characters & % + and close this one as the original issue has been solved. Feel free to reopen if deemed necessary.

Where was this note made? As I would like to review what you wrote as I suspect that I'm facing the same problem but with the password for my WiFi and not the SSID for it. In my current WiFi password I have 19 chars of lower and uppercase chars and numbers and the special char &.

Edit: Today I took the plunge and change my WiFi password for a new without the char & in it and was subsequently able to connect successfully. I suggest it is mentioned in the "Prerequiste" section in the WiFi that certain chars are not allowed in the WiFi SSID or password.