[SOLVED] wifi reset if wrong password


hi,

i finishing first real project arduino yun, seems work fine facing "stupid" issue.

i have created web page allow users decide wether use yun ap or use yun client on wifi.
basically see user decision , change wifi config via uci command call reboot. works fine, can move 1 config other in easy way.

now, have face 2 issues:

1) user enters wrong ssid
    in case, script wifi-live-or-reset detects problem , after 60 seconds calls wifi-reset-and-reboot script reconfiguring yun ap default ssid

2) user enters correct ssid wrong password
  in case, script wifi-live-or-reset not correctly understanding issue because linux trying connect on iwconfig output ssid set real wifi name (and not off/any). when linux stops trying connection, wifi-live-or-reset script has gone nothing happens , yun "bricked". have connect via ethernet cable or switch off access point , restart yun, in way system fall 1) case.

as can imagine, can not ask customer switch off ap if enter wrong password (i think happen often!)....i trying imagine how can detect case 2) , call wifi-reset-and-reboot script.

if have suggestion, please tell me! meanwhile try find solution....

best regards
ettore

it seems found solution...

if system trying connect wifi network iwconfig output shows ssid ifconfig not showing ip address (at least in situation accept dhcp-client config....it should tried in static mode).
so changed wifi-live-or-reset script in following way:

code: [select]

....
iface_exists=""
iface_is_managed=""
iface_has_ssid=""
iface_is_access_point=""
iface_has_ip=""

update_vars() {
        iface_exists=`/usr/sbin/iwconfig $iface`
        iface_has_no_ssid=`/usr/sbin/iwconfig $iface | grep essid\:off\/any`
        iface_is_access_point=`/usr/sbin/iwconfig $iface | grep mode\:master`
        iface_has_ip=`/sbin/ifconfig $iface | grep inet`
}
....
if [ "$iface_exists" = "" ]
        then
                wait_for_iface
        elif [ "$iface_is_access_point" != "" ]
        then
                blink-stop
                exit 0
        elif [ "$iface_has_no_ssid" != "" ]
        then
                wait_for_iface
        else
                if [ "$iface_has_ip" = "" ]
                then
                        wait_for_iface
                else
                        blink-stop
                        rm -f /last_dmesg_with_wifi_errors.log
                        exit 0
                fi
        fi
....


maybe there more polite solution works :)


Arduino Forum > Products > Arduino Yún (Moderator: fabioc84) > [SOLVED] wifi reset if wrong password


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support