anyone notice that newer haps have this "mode" button? could not find any info anywhere.
what is does? maybe wps? cap?
How?You can configure the button in RouterOS to do anything you want. It can launch scripts.
/system script add name=test-script source={:log info message=("1234567890");}
/system routerboard mode-button set on-event=test-script
/system routerboard mode-button set enabled=yes
Thanks, but is this documented anywhere?Code: Select all/system routerboard mode-button set on-event=test-script /system routerboard mode-button set enabled=yes
[admin@...] /system routerboard mode-button> pr
[admin@...] /system routerboard mode-button> exp
# nov/10/2017 14:08:52 by RouterOS 6.41rc52
# software id = xxxx-xxxx
#
# model = RouterBOARD 941-2nD
# serial number = xxxxxxxxxxxx
[admin@...] /system routerboard mode-button>
And even more annoying, I tried adding your example code to test. The log told me the config. had been modified, but pressing the button doesn't generate the expected log line.
In addition, nothing is reported back when you try and query the config. you have just set:Code: Select all[admin@...] /system routerboard mode-button> pr [admin@...] /system routerboard mode-button> exp # nov/10/2017 14:08:52 by RouterOS 6.41rc52 # software id = xxxx-xxxx # # model = RouterBOARD 941-2nD # serial number = xxxxxxxxxxxx [admin@...] /system routerboard mode-button>
hiIt does nothing by default.
Code: Select all/system script add name=test-script source={:log info message=("1234567890");} /system routerboard mode-button set on-event=test-script /system routerboard mode-button set enabled=yes
/system routerboard mode-button
set enabled=yes on-event=wlan_on_off
# script
/system script
add name=wlan_on_off owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":local i\r\
\n:if ( [/int wir get 0 disabled ] = true ) do={\r\
\n :foreach i in= [ /int wir find ] do={ :int wir enable \$i };\r\
\n } else={\r\
\n :foreach i in= [ /int wir find ] do={ :int wir disable \$i };\r\
\n :int wir disable \$i;\r\
\n}\r\
\n"
/system routerboard mode-button
set enabled=yes on-event=wlan_on_off
# script
/system script
add name=wlan_on_off owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":local i\r\
\n:if ( [/int wir get 0 disabled ] = true ) do={\r\
\n :foreach i in= [ /int wir find ] do={ :int wir enable \$i };\r\
\n } else={\r\
\n :foreach i in= [ /int wir find ] do={ :int wir disable \$i };\r\
\n :int wir disable \$i;\r\
\n}\r\
\n"
This should do:Can you help me with the same script but for disable/enable only one of the wireless interfaces? ex. wlan2
:if ([/interface get wlan2 disabled ]=false) do={
/interface wireless disable wlan2} else={
/interface wireless enable wlan2}
/system script add name=test-script source={:log info message=("1234567890");}
/system routerboard mode-button set on-event=test-script
/system routerboard mode-button set enabled=yes
The content of this field is displayed with syntax highlighting. Things become colored if you use something like:Script shows up in red, is that correct?
/system routerboard mode-button set on-event="/system script run test-script;" enabled=yes
[admin@MikroTik] > /system script print
Flags: I - invalid
0 name="test-script" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
dont-require-permissions=no run-count=0 source=:log info message=("1234567890");
[admin@MikroTik] > /system routerboard mode-button set on-event="/system script run test-script;" enabled=yes
[admin@MikroTik] > /system routerboard mode-button print
enabled: yes
on-event: /system script run test-script;
[admin@MikroTik] > :log info message=("1234567890")
/system routerboard mode-button set on-event=/system script run your-script
/system routerboard mode-button set on-event=your-script
Yes, that's enough for things to work. The above was my example to explain why things are shown red and how to work around.I don't think you need to doIn my case it worked just giving the script name directly to the on-event= like soCode: Select all/system routerboard mode-button set on-event=/system script run your-script
Code: Select all/system routerboard mode-button set on-event=your-script
Hi normis.The model with the button hasn't been even announced yet, you have received an early stock unit, so the feature is not documented yet.
You can either choose to ignore it for now (since you didn't even know the unit will have such a button, when you ordered it), or upgrade to the latest RouterOS v6.41RC release when it comes out, and experiment with it until manual is updated.
Hi, the mode-button works for me. I have script for disable/enable all wlan (depending of previous state wlan1)
Code: Select all/system routerboard mode-button set enabled=yes on-event=wlan_on_off # script ...[/quote] Thank you very much! It is working perfectly!