Community discussions

MikroTik App
 
alessio79
just joined
Topic Author
Posts: 4
Joined: Fri May 15, 2015 7:20 pm

External button

Fri Jun 12, 2015 4:34 pm

Hi All,

For a project I need to enable/disable the WiFi interface from an external electrical contact. Is possible to use a button and a script to do this?

Thank you

Regards

Alessio
 
alessio79
just joined
Topic Author
Posts: 4
Joined: Fri May 15, 2015 7:20 pm

Re: External button

Tue Jun 16, 2015 12:01 pm

This is my first solution, using 2 ether ports (loop back on ether4 and ether5), when ether5 goes UP (by reley) the script Enable the wlan1. This is only a workaround...

# Checking ether5 link status:
:global "state"
:global "laststate"
/interface ethernet monitor ether5 once do={:set "state" $status}
:if ($"state" != $"laststate") do={
  :if ($"state" != "link-ok") do={
    # LINK DOWN
    /interface disable wlan1
  } else {
    # LINK UP
    /interface enable wlan1
  }
  :set "laststate" $"state"
}
 
dsimic
just joined
Posts: 9
Joined: Tue Jun 09, 2015 3:53 am

Re: External button

Thu Jun 18, 2015 5:53 pm

Perhaps the router's serial port could be used for that purpose; see http://www.papouch.com/en/shop/product/ ... -mikrotik/ , which is a product that allows monitoring of an external switch, confirming that serial ports are usable for such purposes.

Who is online

Users browsing this forum: bbd and 18 guests