Trigger Reboot on Interface Status

Hi all,

I am having occasional issues with the LTE interface on my routerOS SXTR LTE6. Every few months it will randomly stop working and the LTE interface will be ‘invalid’. When this happens I have to reboot the router and everything starts working again.

The problem is, this is a backup LTE for WAN failover, so I only ever find out it’s broken when I need it the most.

Is there a way to automatically trigger a reboot if the interface goes ‘invalid’?

Sort of a script that says:

IF (interface.lte1.status == invalid) THEN reboot;

In whatever scripting language RouterOS supports :slight_smile:

Thanks!

RouterOS has its own bespoke scripting language; see here for documentation.

It looks like on RouterOS 7, there is an “inactive” status for LTE interfaces that exists. Looks like this can be checked programmatically with something like…


/interface/lte/get lte1 inactive

…which returns a boolean. Another strategy could be to check and see how many LTE interfaces are inactive with…


/interface/lte/print count-only where inactive

…and if that is > 0 then you know the problem is happening.

As far as what to do once you detect the problem, though, most LTE radios interface through the USB bus. I don’t have a SXTR&FG621-EA to check or play with myself, but I have to believe this is true of this device as well. So instead of rebooting the whole device, have you tried simply powercycling the USB port/bus that the LTE radio is internally connected to?

You can do this via:


/system/routerboard/usb/power-reset duration=5

…which will turn power off to the LTE modem for 5 seconds, then turn it back on. If that works, then it would be a much quicker solution than a whole router reboot!

Well, if the frequency this is happening is months, and if the USB power reset works, it would be easier (even if not “proper” or “elegant”) to put on scheduler a script that resets it every day at (say) 5:00 ( rebooting daily the router could be “too much” and be not so good for the lifetime of the electronics, while resetting just the USB power shouldn’t be a problem and - besides - would keep the log while the reboot is destructive for logs kept in memory).

The (general) issue with scripts that are triggered by a single condition (like the invalid or inactive) that produce a reboot or a reset is that if something else causes the condition, the script might cause a boot loop [1], so there would the need of a slightly more sophisticated script that once the condition is found attempts to do the reset/whatever a finite number of times, then disables itself and somehow throws an alarm.


[1] that in the case of an unsupervised/not used device could potentially go on for months, and this is not good.

Hello, same issue with hAP ax lite LTE6 and 7.18.2. I tried 7.19rc no more luck…
The only thing to do is to reboot or power-reset the routerboard…
I just opened a ticket.

The logs :
lte,error lte1: no response for: AT+GTANTINFO?
interface,info lte1 link down
lte,info lte1 mbim: error: expired transaction #28
interface,info lte1 link up
interface,info lte1 detect UNKNOWN
lte,error lte1: no response for: AT+CEREG=2
interface,info lte1 link down
lte,error lte1: no response for: AT E0 V1
lte,error lte1: no response for: AT E0 V1
lte,error lte1: no response for: AT E0 V1
lte,error lte1: no response for: AT E0 V1