Community discussions

 
anarkikrzysiek
just joined
Topic Author
Posts: 4
Joined: Fri Jan 30, 2015 3:45 pm

USB on/off

Tue Mar 10, 2015 9:50 am

Hello,
I'm new here.
My question is:
Is there any possible way to script on/off USB port at specific time ?
I found command to reset for some time but i didn't found way to off/on port.

Thanks for help
 
User avatar
PaulsMT
MikroTik Support
MikroTik Support
Posts: 283
Joined: Tue Feb 10, 2015 3:21 pm

Re: USB on/off

Tue Mar 10, 2015 1:42 pm

You can't simply disable port, but you can disable USB power at specific time, or specific conditions, for example:

{
:local time [system clock get time];
:if ($time>12:30:00 && $time<17:40:00) do={
/system routerboard usb power-reset duration=1d}}

This command will disable power for 1 day, when time is between 12:30:00 - 17:40:00

If conditons changes or you want to enable usb faster, do command again, and set duration=1s

/system routerboard usb power-reset duration=1s,

Now usb will be back ok even before 24h period.
 
anarkikrzysiek
just joined
Topic Author
Posts: 4
Joined: Fri Jan 30, 2015 3:45 pm

Re: USB on/off

Tue Mar 10, 2015 5:46 pm

Thanks a lot.
 
solelunauno
Member Candidate
Member Candidate
Posts: 107
Joined: Mon Jul 16, 2012 7:00 pm
Location: Roseto Capo Spulico CS Italy
Contact:

Re: USB on/off

Wed Jan 30, 2019 10:47 am

You can't simply disable port, but you can disable USB power at specific time, or specific conditions, for example:

{
:local time [system clock get time];
:if ($time>12:30:00 && $time<17:40:00) do={
/system routerboard usb power-reset duration=1d}}

This command will disable power for 1 day, when time is between 12:30:00 - 17:40:00

If conditons changes or you want to enable usb faster, do command again, and set duration=1s

/system routerboard usb power-reset duration=1s,

Now usb will be back ok even before 24h period.
It isn't so simple. I tested it on mAP. It seems to work for one day on two, but in a long period USB power will return enabled randomly before the duration requested from the script. I don't know why, at this moment. Tested with routeros 6.43.8
SL1 Systems srl MTCNA MTCRE

Who is online

Users browsing this forum: No registered users and 12 guests