sieren / Homepoint

Espressif ESP32 Based Smarthome screen for MQTT
MIT License
630 stars 89 forks source link

Wifi password is not applied correctly #176

Closed Floo92 closed 3 years ago

Floo92 commented 3 years ago

Hi,

my Wifi password contains some special characters, including a "+". This is apparently not evaluated correctly in the firmware. The debug output shows the following:

I (1782) wifi station: connect to ap SSID:WLAN_2.4G password:Test! #2q

Here's what I entered in the wifi configuration: SSID: WLAN_2.4G Password: test!+#2q

The "+" is replaced by a " " and no wifi connection is established.

I would like to keep my wifi password :D.

Floo92 commented 3 years ago

The problem is already fixed in the master branch. In data/captive/app.js (v0.07.2)

var params = "ssid=" + document.getElementsByName("ssid")[0].value + "&ssidPassword=" + document.getElementsByName("ssidPassword")[0].value + "&loginName=" + document.getElementsByName("loginName")[0].value + "&loginPassword=" + document.getElementsByName("loginPassword")[0].value

is replaced by

var params = "ssid=" + encodeURIComponent(document.getElementsByName("ssid")[0].value) + "&ssidPassword=" + encodeURIComponent(document.getElementsByName("ssidPassword")[0].value) + "&loginName=" + encodeURIComponent(document.getElementsByName("loginName")[0].value) + "&loginPassword=" + encodeURIComponent(document.getElementsByName("loginPassword")[0].value)