Community discussions

 
slalumiere
just joined
Topic Author
Posts: 1
Joined: Fri Jul 05, 2013 5:32 pm

Turn Wireless On / Off

Fri Jul 05, 2013 6:13 pm

Hi,

I'm working in building automation systems and one of the buildings we control has MikroTik installed. Few of our controllers have problems of connection on long terms connections when connected through the Wireless. The only 100% functionnal solution I've found is turning on/off the wireless on the MikroTik, which let the controllers "re-discover" the connection. Losing the connection for a few seconds is not critical on these controllers.

I'm not comfortable enough in RouterOS scripting language to script anything functionnal.

I need to execute a script that turn the Wireless OFF for 10 seconds every 1 hour. If I loose power while the Router wireless card is stopped, I need to automatically turn it on back again when the power is back.

Thanks in advance for the help!


Simon Lalumière
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Turn Wireless On / Off

Wed Jul 17, 2013 3:16 pm

you have to create scheduler script that is executed on startup to set wireless interface enabled.

and another one that will do your what you want at set interval.

please see how commands are written in CLI as you dont have anything fancy.
 
efaden
Forum Guru
Forum Guru
Posts: 1711
Joined: Sat Mar 30, 2013 1:55 am
Location: New York, USA

Re: Turn Wireless On / Off

Mon Jul 22, 2013 7:20 pm

you have to create scheduler script that is executed on startup to set wireless interface enabled.

and another one that will do your what you want at set interval.

please see how commands are written in CLI as you dont have anything fancy.
Something like this should work. Set to run on startup and then every hour... I haven't tested it.
:global firstRun

:if ([ :typeof $firstRun ] = nil ) do={
  /interface enable [find name="wlan1"] 
  :set firstRun false
} else
  /interface disable [find name="wlan1"]
  :delay 10s
  /interface enable [find name="wlan1"]
}
 
User avatar
ohara
Member
Member
Posts: 371
Joined: Mon Jun 13, 2011 11:30 pm
Location: Warsaw

Re: Turn Wireless On / Off

Mon Jul 22, 2013 7:26 pm

Simon, not sure what you mean by "long terms connections". In my point of view disabling/enabling the radio is just a workaround and not a fix. If you want to give us more details we could provide you with some ideas, like upgrading software and firmware...
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Turn Wireless On / Off

Tue Jul 23, 2013 10:50 am

as ohara wrote - while this will work, it is better to get to the root of the problem.

Also, you can look into netwatch, to monitor the link, and then do the "trick" to get wifi back. then your scheduler script have to be executed only on startup if at all.

Who is online

Users browsing this forum: No registered users and 10 guests