Page 1 of 1

Script for interface LTE to restart

Posted: Sun Feb 04, 2018 1:00 pm
by Halfeez92
Hi,

I have an SXT LTE modem, now the problem is sometimes the LTE connection will drop and I have to manually log in into the GUI and disable and re-enable back the interface. So I wish someone can help me with the scripting that can:

- ping check at 8.8.8.8 and if there any drop more than 20 packet,
- it will auto disable it and logged then re-enable the interface back.
- else it will run for every 1 minute on the scheduler with 'Connection OK' logged.

Thank you.

Re: Script for interface LTE to restart  [SOLVED]

Posted: Sun Feb 04, 2018 1:19 pm
by Grickos
:if ( [/ping 8.8.8.8 count=10 size=64 interval=2s ] =0) do={
:log error "-----No ping";
/system routerboard usb power-reset duration=10;
:log error "----Reset USB Power";
} else={
#:log info "-----LTE OK-----";
}

Re: Script for interface LTE to restart

Posted: Sun Feb 04, 2018 1:25 pm
by Grickos
You can change what you want. but time 1min is too short. If something really is not good with lte, it will loop in, restart every minute. Or add script restart lte pauses 1.min restart then pauses 5.min ....15.min

Re: Script for interface LTE to restart

Posted: Sun Feb 04, 2018 1:30 pm
by klaus007
Hello!

I have the same problems with two NetMetals and Huawei ME909s-120 since 6.41.
At the moment I make a restart of the LTE1-interface every 24hours an I would be also interested in such script.

regards

Re: Script for interface LTE to restart

Posted: Sun Feb 04, 2018 2:51 pm
by Halfeez92
You can change what you want. but time 1min is too short. If something really is not good with lte, it will loop in, restart every minute. Or add script restart lte pauses 1.min restart then pauses 5.min ....15.min
yea i was thinking the same but i just want to give a sample situation. Because sometimes my lte interface will drop when there is no activity or in idle state

Re: Script for interface LTE to restart

Posted: Sun Feb 04, 2018 10:35 pm
by eworm
Just use "/ tool netwatch" for that...

Re: Script for interface LTE to restart

Posted: Sun Feb 11, 2018 8:20 pm
by Halfeez92
:if ( [/ping 8.8.8.8 count=10 size=64 interval=2s ] =0) do={
:log error "-----No ping";
/system routerboard usb power-reset duration=10;
:log error "----Reset USB Power";
} else={
#:log info "-----LTE OK-----";
}
Speaking of which, does LTE interface built in SXT LTE can be power reset on the system USB?

Re: Script for interface LTE to restart

Posted: Sun Feb 11, 2018 10:08 pm
by zivtal
enable/disable to lte interface not help? if you need restart, just reboot the device it's only stadalone lte device...
:if ([/ping 8.8.8.8 count=10 size=64 interval=2s]=0) do={
	:log error "LTE DOWN";
	/system reboot;
} else={
	:log info "LTE FINE";
}

Re: Script for interface LTE to restart

Posted: Sun Feb 11, 2018 10:13 pm
by zivtal
I don't really know the SXT LTE, but you can try (disable and enable lte interface):
:if ([/ping 8.8.8.8 count=10 size=64 interval=2s]=0) do={
	:log error "LTE DOWN";
	/interface disable <interface>
	/delay 1s
	/interface enable <interface>
} else={
	:log info "LTE FINE";
}

Re: Script for interface LTE to restart

Posted: Tue Feb 13, 2018 12:01 am
by owenilc
Thanks, the following scripts works for me! I add this scripts to Tools ==> Netwatch ==> Host, when Host 8.8.8.8 is down, run script.
My 4G/LTE USB Dongle is Huawei E8372h-607.
I don't really know the SXT LTE, but you can try (disable and enable lte interface):
:if ([/ping 8.8.8.8 count=10 size=64 interval=2s]=0) do={
	:log error "LTE DOWN";
	/interface disable <interface>
	/delay 1s
	/interface enable <interface>
} else={
	:log info "LTE FINE";
}

Re: Script for interface LTE to restart

Posted: Thu Nov 21, 2019 1:33 pm
by canvcol
Hello, hoping someone might have some ideas on this.

I have a wAP LTE kit in a remote location with mediocre signal. Currently I am using the system watchdog with 8.8.8.8 set to ensure things are kept alive. It is activating probably every one or two hours.

My questions:

1. Is it a bad idea to use the system watchdog in this case? (e.g. doing so many "harsh" reboots?)
(the device is now in a very remote location and I would rather not play around too much in case I lose my ability to connect remotely!)

2. If I should use one of the scripts here - would it be better to use the "/interface disable/enable" method or the "usb power-reset" method? For wAP LTE kit

3. Is there any reason not to use Tools Netwatch to implement this script? (e.g. vs scheduler)