Community discussions

MikroTik App
 
runbound
Member Candidate
Member Candidate
Topic Author
Posts: 125
Joined: Fri Apr 19, 2013 9:28 am

how to reboot for more than 1 minute

Tue Nov 23, 2021 3:40 am

can anybody help me,
this is my scenario, if mikrotik received sms for less than 1 minute then proceed
if more than 1 minute the usb port reboot and remove the usb port



:foreach i in=[/tool sms inbox find where message="2"] do={

:if ([/tool sms inbox get timestamp] < 1m) do={
/system script run [find name="*2"]
}

:if ([/tool sms inbox get timestamp] > 1m) do={

/sys routerboard usb power-reset
/tool sms inbox remove $i;
:delay 4s;
/port remove usb
:delay 10s
/tool sms set port=usb

}

}
}
} on-error={:log error message="
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 724
Joined: Tue Dec 17, 2019 1:08 pm

Re: how to reboot for more than 1 minute

Tue Nov 23, 2021 4:51 am

Create a Scheduler with parameter "start-time=startup"
And use ":delay 60" to wait 60 sec before executing your script.

Exemple :
2021-11-23_03-51-05.jpg
You do not have the required permissions to view the files attached to this post.
 
runbound
Member Candidate
Member Candidate
Topic Author
Posts: 125
Joined: Fri Apr 19, 2013 9:28 am

Re: how to reboot for more than 1 minute

Tue Nov 23, 2021 4:57 am

thats not possible. its only a delay.
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 724
Joined: Tue Dec 17, 2019 1:08 pm

Re: how to reboot for more than 1 minute

Tue Nov 23, 2021 5:22 am

Maybe i didn't understand your Request....

I taught you needed a way to Check 60 Sec after boot,
If your device received a SMS and if not Reset USB

What did i understand wrong ?
 
runbound
Member Candidate
Member Candidate
Topic Author
Posts: 125
Joined: Fri Apr 19, 2013 9:28 am

Re: how to reboot for more than 1 minute

Tue Nov 23, 2021 5:40 am

sorry for my bad english

if mikrotik received sms in less than 1 minute
then call script name *2

if more than 1 minute since mikrotik recieved the message
execute of rebooting usb port

i need to reboot the usb port because sometimes sms in mikrotik hang and cannot delete
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 724
Joined: Tue Dec 17, 2019 1:08 pm

Re: how to reboot for more than 1 minute

Tue Nov 23, 2021 5:57 am

Ahhh ...It was my mistake

When receiving a SMS the modem sometimes get "Stuck"
Because of this, you want to constantly check if the modem is "Stuck"
and if so, reset the Modem / USB-Device.
 
runbound
Member Candidate
Member Candidate
Topic Author
Posts: 125
Joined: Fri Apr 19, 2013 9:28 am

Re: how to reboot for more than 1 minute

Tue Nov 23, 2021 6:05 am

yes sir like for example
mikrotik received sms at 12:00pm.

and if sms stuck and cannot delete at 12:02pm
thats 2 minutes already then reset the Modem / USB-Device by executing in /sys routerboard usb power-reset
 
runbound
Member Candidate
Member Candidate
Topic Author
Posts: 125
Joined: Fri Apr 19, 2013 9:28 am

Re: how to reboot for more than 1 minute

Wed Dec 01, 2021 2:58 pm

anyone can help pls

Who is online

Users browsing this forum: No registered users and 16 guests