Page 1 of 1

External button

Posted: Fri Jun 12, 2015 4:34 pm
by alessio79
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

Re: External button

Posted: Tue Jun 16, 2015 12:01 pm
by alessio79
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"
}

Re: External button

Posted: Thu Jun 18, 2015 5:53 pm
by dsimic
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.