Page 1 of 1

Run script by Mode Button on Hap ac^2

Posted: Wed Jul 11, 2018 9:02 am
by Airis777
I faced with the problem of running script by Mode button on Hap ac^2.
When I push the button, script executes but with big delay. Sometimes it takes about 1-1.5 min. Sometimes script performs instantly.
When I run script manually from /system/script window it always executes instantly.
I think the problem probably in priority of the hardware interrupt.

Anybody faced with this problem? Maybe someone have experience using this feature in the RB750Gr3 router?

Posted: Thu Jul 12, 2018 4:28 am
by Tester007
I will duplicate my answer from another thread here:

Yes, I'm facing the delays too. Sometimes it looks like my hap lite just don't recognize I pressed a button on it, and some time later (~ 5-30 sec) it will recognize it and react to it.
Also today it seemed like the script on the button was running twice: enabling wireless interface for a short period of time, then disabling it after ~10 sec. I added comment to the start of it, so now I will see for sure if script is running twice for one press or it's something else.

I'm using next script for the button to disable/enable wireless interface:
:log info message=("mode button was pressed");
:local i
:if ( [/int wir get 0 disabled ] = true ) do={
:foreach i in= [ /int wir find ] do={ :int wir enable $i };
} else={
:foreach i in= [ /int wir find ] do={ :int wir disable $i };
}

Re: Run script by Mode Button on Hap ac^2

Posted: Thu Jul 12, 2018 9:43 am
by Airis777
I also use mode button for disabling/enabling wireless interfaces and indicate the current status on the user's LED.
I use software version 6.43rc42, but 6.42.5 doesn't work correctly for this feature either.
May be someone know how to debug this case and find the reason for this behaviour?

Re: Run script by Mode Button on Hap ac^2

Posted: Sun Sep 16, 2018 3:50 pm
by Tester007
Seems like this is now fixed in 6.43 (Stable), at least for my hap lite.

Re: Run script by Mode Button on Hap ac^2

Posted: Mon Sep 17, 2018 10:51 am
by Airis777
Thanks, I'll try.

Re: Run script by Mode Button on Hap ac^2

Posted: Tue Sep 25, 2018 8:26 am
by Airis777
Yes, it seems, now it works, as expected. Need to observe more.