Getting LTE bus interface via script

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.

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 :frowning:

/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.

But you should doit ones to discover what lte usb bus is what specific interface and then you have that knowleadge for future.