i am finishing my first real project with Arduino Yun, everything seems to work fine but i am facing with a "stupid" issue.
I have created a web page to allow users to decide wether to use Yun as an AP or to use the Yun as a Client over their Wifi.
Basically i just see user decision and i change wifi config via UCI command then i call for a reboot. Actually it works fine, i can move from one config to the other in an easy way.
Now, i have to face two issues:
User enters a wrong SSID
In this case, the script wifi-live-or-reset detects the problem and after 60 seconds it calls the wifi-reset-and-reboot script reconfiguring the Yun as an AP with default SSID
User enters a correct SSID but with a wrong password
In this case, the script wifi-live-or-reset is not correctly understanding the issue because linux is trying to connect so on the iwconfig output SSID is set to the real wifi name (and not to off/any). When Linux stops trying the connection, the wifi-live-or-reset script has already gone so nothing happens and the Yun is "bricked". You have to connect via ethernet cable or switch off access point and restart Yun, in this way the system will fall into the 1) case.
As you can imagine, i can not ask to my customer to switch off their AP if the enter a wrong password (i think this will happen often!)....i was just trying to imagine how can i detect case 2) and call the wifi-reset-and-reboot script.
If you have any suggestion, please tell me! Meanwhile i will try to find a solution....