raspap-webgui icon indicating copy to clipboard operation
raspap-webgui copied to clipboard

Warn user when he enters a wrong WiFi password

Open emmanuelgeoffray opened this issue 7 years ago • 11 comments

I think it would be super useful if the user would be warned if he enters a wrong password in the "Configure Wifi Client" section.

I would be glad to help on this feature. What do you think would be the best implementation? From what I have seen, the password and SSID are stored in wpa_supplicant.conf. Before doing this, may be the app should try to switch wifi and retrieve errors if any? Not sure how to switch wifi though, but I can search a command line for that.

Best, Emmanuel

emmanuelgeoffray avatar Dec 22 '17 10:12 emmanuelgeoffray

hey @billz any thoughts on that? I am still needing this feature, so I think I will impement it pretty soon.

Thank you, Emmanuel

emmanuelgeoffray avatar Feb 11 '18 14:02 emmanuelgeoffray

hey @billz thanks for all the recent updates any thoughts on that? I am still needing this feature, and did not have time to implement it! But if you have an idea on how to do it, let's do it! I see many humans entering wrong passwords!

Thank you, Emmanuel

emmanuelgeoffray avatar Jan 22 '19 17:01 emmanuelgeoffray

I also would enjoy this feature, but in my opinion it's a little hard to implement.

Is it possible to verify the password while the WiFi is still in AP mode?

If you switch to client mode, you'd have to reconnect your device to the Pi after verifying, and it could also take several seconds to change to client mode, verify the password and change back to AP mode.

dalmago avatar Jan 22 '19 17:01 dalmago

Indeed it does not look trivia but feasible : https://unix.stackexchange.com/q/407168, https://superuser.com/a/903893, https://raspberrypi.stackexchange.com/a/61137 Many people complains about detecting wrong password and switching from one wifi to an other depending on the password entered.

Maybe, this kind of behaviour could be an option in the global settings. If you activate it, it took more times but it is safe for every human.

I think that waiting some seconds before getting an error could be understandable if you guarantee the connectivity.

gabrielstuff avatar Jan 22 '19 17:01 gabrielstuff

this could be implemented as an asynchronous process.

  • in the ui, enter a psk and hit "connect"; let raspap do its usual thing
  • start a process that, for a limited time, watches the wpa_supplicant log and looks for the error message
  • if the error message is found, that process puts some sort of state file somewhere
  • the raspap ui gets an xhr-based polling feature that talks to an endpoint that checks for that state file and if it exists, the ui shows a notification
  • polling stops if the state file says "all fine"

first i thought about websockets but that would require an actively runnig php server process. right now, lighty just execute raspap on each request. on the other hand, i could write some sort of control server in go and hook that up as a websocket source to the ui. then we can do other fancy real-time stuff. that control server could also be running with elevated privileges to do things without that sudo dance. i mean, we give sudo access to "arbitrary" scripts that my contain anything anyway.

also: we could move everything over to the go server, piece by piece, and in the end have only one binary to deploy.

glaszig avatar Aug 02 '19 12:08 glaszig

我在客户端设置界面输入连接wifi密码连接一直都是提示报错,

密码长度需要介于8~63个字符

无法更改连接WiFi

wangkai88 avatar Oct 12 '19 12:10 wangkai88