Omega2+ // Wifi shut down ? Apcli link down.



  • Hi,

    After some problems for configuring my wifi, I run into a new problem.

    My Omega2+ disconnect wifi after some times :
    For example :

    [   39.743241] !!! APCLI LINK UP - IF(apcli0) AuthMode(7)=WPA2PSK, WepStatus(6)=AES!
    [   ...]
    [  583.277377] !!! APCLI LINK DOWN - IF(apcli0)!!!
    
    [ 2025.448630] !!! APCLI LINK UP - IF(apcli0) AuthMode(7)=WPA2PSK, WepStatus(6)=AES!
    [ 4183.494187] !!! APCLI LINK DOWN - IF(apcli0)!!!
    

    So if I don't have a serial connection to the omega, I can't restart wifi...

    Is there a reason for this disconnection ? Is there a way to change that ?
    Or perhaps I can setup a cron that check if there is connectivity and if not, restart network ?

    Thanks for your help !



  • In addition, for my proposition to setup a cron which restart network when wifi is down :
    Is there a log file where I can see this output :

    [  583.277377] !!! APCLI LINK DOWN - IF(apcli0)!!!
    

    I see this output on the serial console, but can't find it in log files...
    My goal is to search for this "words" to detect if wifi restart is needed or not...

    Additionally :

    /# ls -alh /var/log/
    drwxr-xr-x    2 root     root          80 Jan 10 16:24 .
    drwxrwxrwt   18 root     root         500 Jan 12 12:42 ..
    -rw-r--r--    1 root     root           0 Jan 10 16:24 lastlog
    -rw-r--r--    1 root     root           0 Jan 10 16:24 wtmp
    

    Is this a normal behavior ? Nothing is logged in Omega ?

    Thanks,



  • Ok I reply to myself, I found this : https://wiki.openwrt.org/doc/howto/log.essentials

    So a

    logread
    

    Give me my logs !



  • EDIT : correct the script (the test wasn't working) !

    Here is my try :

    /root/wifi-restart.sh :

    #!/bin/sh
    
    # Get last log line containing "APCLI"
    LASTAPCLILOG=$(logread -e "APCLI" | tail -1)
    
    # If this line contain the "DOWN" word
    # then we have to restart wifi.
    case "$LASTAPCLILOG" in
      *DOWN*)
            logger -t mwi "WiFi is down, try to restart WiFi";
            wifimanager
        ;;
    esac
    
    

    (the "else" part is not necessary but it was for debugging)

    And the crontab line :

    * * * * * /root/wifi-restart.sh
    

    now I'm waiting for disconnection to see if it works :)

    ++



  • I correct my script, to handle some problems at omega startup.
    Sometimes, the wifi won't connect. So my script now restart wifi if the last "APCLI status" is not "UP".
    So it work with no status too.

    #!/bin/sh
    
    # Get last log line containing "APCLI"
    LASTAPCLILOG=$(logread -e "APCLI LINK" | tail -1)
    
    # If this line doesn't contain the "APCLI LINK UP" words
    # then we have to restart wifi.
    case "$LASTAPCLILOG" in
      *"APCLI LINK UP"*)
        ;;
      *)
        logger -t mwi "WiFi is down, try to restart WiFi";
        wifimanager
       ;;
    esac
    
    

Log in to reply
 

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.