Community discussions

MikroTik App
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 10:12 am

I am trying to figure out if it's possible for the router to turn the wireless on and off itself at a specific set time ?

I have a sat internet with 3-6 AM not counted towards the meter, so I figured all smartphones could update then automatically without me having to be up if I could set the wifi to come on itself without me having to be up.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26376
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 10:22 am

Yes, the "System Scheduler" menu does that. In there, make a new rule that will run the script "/interface wireless enable wlan1" at the specified time. Make a second rule that does the reverse at some other time.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26376
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 10:24 am

You can also use the "access list", where you would enter specific client MAC addresses and the times when they are allowed to use WiFi. This is better if you want to control it per-device.
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 10:51 am

I tried to follow, http://abiadonis.blogspot.com/2015/11/m ... XBfE1GQyvE , but couldn't figure it out.
 
User avatar
karlisi
Member
Member
Posts: 438
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 11:34 am

What exactly is not working?
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 8:01 pm

What exactly is not working?
I need WLAN to come on between 3 AM and 6 AM, cutting off at 6.
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Is it possible to script when Wireless WLAN comes on?

Thu Jul 20, 2017 9:53 pm

The demonstration shows wlan1. You may have to alter the command to reflect your environment.

Use commands like this in scheduler if you wanted to enable / disable by SSID (make sure to adjust MikroTik123 to what your SSID actually is):
/interface wireless disable [ find where ssid="MikroTik123" ]
/interface wireless enable [ find where ssid="MikroTik123" ]
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 2:54 am

The demonstration shows wlan1. You may have to alter the command to reflect your environment.

Use commands like this in scheduler if you wanted to enable / disable by SSID (make sure to adjust MikroTik123 to what your SSID actually is):
/interface wireless disable [ find where ssid="MikroTik123" ]
/interface wireless enable [ find where ssid="MikroTik123" ]
What do I put in interval? I assume the start time is going to be when I want it to open, 03:00:00 and stop time of 06:00:00 ?

Then use the on event to do the actual command ? Wlan1 is indeed the right name for it.

Do I use / interface wireless disable WLAN1 like the other page said ? then / interface wireless enablement WLAN1 to turn it on at 03 ?
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 3:02 am

One scheduler job with the command for each action (one to turn on, one to turn off).
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 3:04 am

One scheduler job with the command for each action (one to turn on, one to turn off).
But what command? What interval ? etc ?
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 3:15 am

Well, I gave you the two commands. The schedule is up to you. We can lead you to water but we can't make you drink. Make an effort please. The forum is unpaid support.

3AM - 6AM you want a SSID turned on or available. This means a scheduler task of interval 1 day at 3AM needs to execute an enable command and a scheduler task of interval 1 day at 6AM needs to execute a disable command.
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 3:55 am

Well, I gave you the two commands. The schedule is up to you. We can lead you to water but we can't make you drink. Make an effort please. The forum is unpaid support.

3AM - 6AM you want a SSID turned on or available. This means a scheduler task of interval 1 day at 3AM needs to execute an enable command and a scheduler task of interval 1 day at 6AM needs to execute a disable command.
The commands work,
  /interface wireless disable [ find where ssid="YUNoBringFajitasLady" ]
/interface wireless enable [ find where ssid="YUNoBringFajitasLady" ]
I tested: start time: 19:56:00 , interval 00:00:00 and it didn't come on at 7:56 PM.

edit: testing again with interval of 24:00:00 (1d)
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 4:06 am

Still nothing, checked the clock and it's set right.

I also tried: /interface wireless enable wlan1 , interval 24:00:00 .

edit: Found the "problem". It wont run till tomorrow.
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 5:41 am

Good deal!
 
DangerRanger
just joined
Topic Author
Posts: 8
Joined: Thu Jul 20, 2017 10:07 am

Re: Is it possible to script when Wireless WLAN comes on?

Fri Jul 21, 2017 1:41 pm

Good deal!
Confirmed, the script to bring it up worked.

Who is online

Users browsing this forum: lonthong2002 and 54 guests