AutoTools Timeout error when executing ssh command

Discussion in 'AutoApps' started by trohn_javolta, Nov 13, 2017.

  1. trohn_javolta

    trohn_javolta New Member

    Joined:
    Mar 9, 2016
    Messages:
    14
    Likes Received:
    0
    Hi, I have created a shortcut on my homescreen with tasker which, amongst other things, sends a ssh command via autotools ssh option.
    However, if I take my phone, unlock it and press tap the shortcut, nothing happens and later I get this error:
    com.jcraft.jsch.JSchException: java.net.ConnectException: failed to connect to /192.168.1.1 (port 22): connect failed: ETIMEDOUT (Connection timed out)
    This ONLY happens if I freshly pull the phone out, unlock it and tap the shortcut.
    If I wait a bit and tap the shortcut everything works as expected.
    My question is if it's possible to make the waittime longer or do a retry upon timeout error.
    I know I can add a wait task in tasker, in fact I have a wait task of 30 ms. I don't really wanna make that longer since this would delay all following tasks :/
    Maybe autotools could do a retry if it gets time out error.
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    In Tasker you can make the action continue on error and then retry the action if there's an error. Can you please try that?
     
  3. trohn_javolta

    trohn_javolta New Member

    Joined:
    Mar 9, 2016
    Messages:
    14
    Likes Received:
    0
    Not really an option. The shortcut works as a switch, press it once starts a harmony hub activity, press it again turns the devices off.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    But that should not keep you from doing what I said at all.. You can still check for errors even if it is a switch
     
  5. trohn_javolta

    trohn_javolta New Member

    Joined:
    Mar 9, 2016
    Messages:
    14
    Likes Received:
    0
    Ok, did that.
    Now I should wait and report errors from within tasker?
    I guess it will be the same timeout errors but I will report.
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    What I meant is, in Tasker, when it errors out you can simply retry :)
     
  7. trohn_javolta

    trohn_javolta New Member

    Joined:
    Mar 9, 2016
    Messages:
    14
    Likes Received:
    0
    A plugin in the task first fills a variable with current value from harmony hub.
    If everything is switched off, the variable is filled with 'poweroff'. Task then checks variable and if its value is 'poweroff' start activity xy is sent to harmony hub.
    If I press shortcut again, the variable is filled with different value and poweroff will be sent to harmony hub.
     

Share This Page