Community discussions

MikroTik App
 
sin3vil
just joined
Topic Author
Posts: 21
Joined: Sat May 26, 2018 10:05 pm

Getting LTE bus interface via script

Sun Dec 13, 2020 7:23 pm

Hello everyone,

Using an RB953 with two LTE modules.
For reasons I'd prefer not to go into detail, I need to run /system routerboard usb power-reset duration=3s bus=1 command for a specific interface, say lte1.
The command requires the bus interface to reset power to.

Is there a way to get the bus a specific LTE interface is on, in a scriptable manner?

Interface name, lte1, lte2 etc does not seem to always coincide with which bus/slot it's plugged in.

You could possible get it via /system resource usb print, but this does not work if both modules are the same.
[admin@LTE1-2] > sys resource  usb print detail 
 0 device="1-0" vendor="Linux 3.3.5 ehci_hcd" name="RB400 EHCI" serial-number="rb400_usb" vendor-id="0x1d6b" device-id="0x0002" speed="480" ports=1 usb-version=" 2.00" 

 1 device="2-0" vendor="Linux 3.3.5 ehci_hcd" name="RB400 EHCI" serial-number="rb400_usb" vendor-id="0x1d6b" device-id="0x0002" speed="480" ports=1 usb-version=" 2.00" 

 2 device="2-1" vendor="MikroTik" name="R11e-LTE6" serial-number="000000000000" vendor-id="0x2cd2" device-id="0x0004" speed="480" usb-version=" 2.00" 

 3 device="1-1" vendor="MikroTik" name="R11e-LTE6" serial-number="000000000000" vendor-id="0x2cd2" device-id="0x0004" speed="480" usb-version=" 2.00" 
Running the command blind, for both bus interfaces, is not an option.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1366
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: Getting LTE bus interface via script

Mon Dec 14, 2020 12:25 pm

In /Interface lte we not have detail from what bus specific lte is connected.
You must do test way. Of course we should see SN here and can recognise unit by SN itself but this now work :(

/system routerboard usb power-reset duration=1s bus=1 ; #do reboot a lte1 or lte2 means device 1-1
/system routerboard usb power-reset duration=1s bus=2 ; # should reboot second lte module, means 2-1
This is constance and not swap.
MTCNA + MTCRE + MTCINE | ~600 users at ~150 RouterBoards in EMEA | Telegram: @SiB_PL | Buy me a caffe
WinBox Tip: F6 works as ALT+TAB | Gliffy.com - free network schematic | prnt.sc - free ScreenShot software
 
sin3vil
just joined
Topic Author
Posts: 21
Joined: Sat May 26, 2018 10:05 pm

Re: Getting LTE bus interface via script

Fri Jan 29, 2021 5:31 pm

In /Interface lte we not have detail from what bus specific lte is connected.
You must do test way. Of course we should see SN here and can recognise unit by SN itself but this now work :(

/system routerboard usb power-reset duration=1s bus=1 ; #do reboot a lte1 or lte2 means device 1-1
/system routerboard usb power-reset duration=1s bus=2 ; # should reboot second lte module, means 2-1
This is constance and not swap.
Hello SiB, as I said doing a blind run is not possible as that might kill the currently live LTE and create further issues.
Sorry for the almost necro reply. Went on leave for xmas and totally forgot about this.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1366
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: Getting LTE bus interface via script

Wed Feb 24, 2021 7:29 pm

But you should doit ones to discover what lte usb bus is what specific interface and then you have that knowleadge for future.
MTCNA + MTCRE + MTCINE | ~600 users at ~150 RouterBoards in EMEA | Telegram: @SiB_PL | Buy me a caffe
WinBox Tip: F6 works as ALT+TAB | Gliffy.com - free network schematic | prnt.sc - free ScreenShot software

Who is online

Users browsing this forum: No registered users and 39 guests