MikroTik USB Power - Schedule Off/On

Suppose, you have a project in a rural area where broadband internet is not strong, and you want to get internet via 4G-Modem. In that case the modem will be heat more if its power 24 hour runs.

Another thing is sometimes the modem unexpectedly can be hang ! So, you need to restart MikroTik with a regular interval.

Here we will configure MikroTik for this scenario.

Firstly, set timezone manually.
Winbox > System > Clock

Then, set up time update online, from time.google.com and time.windows.com
Winbox > System > SNTP Client

We will reboot MikroTik in every 4 hours interval. And in night (01:00 am - 05:00 am) the modem should be powered off.

1) Create a reboot script

Winbox > System > Scripts

Script name = reboot

Source = /system reboot

2) Create a scheduler

Winbox > System > Scheduler

Scheduler name = reboot

Start date = Nov/06/2022

Start time = 00:00:00

Interval = 04:00:00

On Event = reboot

3) Create script to power off the USB and disable reboot scheduler

Winbox > System > Scripts

Script name = usb-off

Source:

/system routerboard usb power-reset duration=1d
/system scheduler disable [/system scheduler find name=reboot]

4) Create USB off schedule

Winbox > System > Scheduler

Scheduler name = usb-off

Start date = Nov/06/2022

Start time = 01:00:00

Interval = 1d 00:00:00

On Event = usb-off

5) Create script to power on the USB and enable reboot scheduler


Winbox > System > Scripts

Script name = usb-on

Source:

/system routerboard usb power-reset duration=0
/system scheduler enable [/system scheduler find name=reboot]

6) Create USB on schedule


Winbox > System > Scheduler

Scheduler name = usb-on

Start date = Nov/06/2022

Start time = 05:00:00

Interval = 1d 00:00:00

On Event = usb-on


Now that our configuration is done !

Post a Comment