-
-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn user when he enters a wrong WiFi password #142
Comments
hey @billz Thank you, |
hey @billz Thank you, |
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. |
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. |
this could be implemented as an asynchronous process.
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. |
我在客户端设置界面输入连接wifi密码连接一直都是提示报错, 密码长度需要介于8~63个字符 无法更改连接WiFi |
Not sure where this is but I think I could help. Unfortunately I know only Javascript and Rust. My Bash game is weak and I haven't written a line of PHP code in more than a decade. But with some guidance and if Rust is an option I could start making some contributions. |
@dejang thanks for the offer to help. This one is somewhat tricky in that
In command line mode, enabling a network with an incorrect PSK will only return
One possible hacky solution is to run wpa_cli in a script and fool it into thinking it's in interactive mode. A better alternative might be to enable and parse wpa_supplicant's logs, as @glaszig suggests, or use
The latter is speculative and untested. |
Thank you for the detailed answer @billz. I believe there are ways to run interactive processes from PHP, NodeJS, Rust, Python etc. and intercept the input/output streams. So based on that, spawning a child process from the programming language used (PHP/NodeJS/Rust) of |
there you go: proc_open(). |
yup, that could work. @dejang in terms of the implementation, it would be great to use our existing stack wherever possible rather than adding new dependencies to the project. Glad to collaborate on a PR / proof of concept. |
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
The text was updated successfully, but these errors were encountered: