Hello Guys!
I have a TL-WR902ACv4 router with OpenWRT 23.05.4 installed
I need to reconnect programmatically usb modem. I found a solution using udisks (udisks --deattach), but usdisks is not presented in OpenWRT. Is there some another solution to do it?
Thanks! But there is another problem.
It says that my device status is power off, i cant connect to its panel, but LED on modem still working and when I turn it on again my ip dont change.
Have you any ideas?
root@OpenWrt:~# uhubctl
Current status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
Current status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0503 power highspeed enable connect [1376:4e61 Marvell Mobile Composite Device Bus Mobile Composite Device Bus]
root@OpenWrt:~# uhubctl -a 0 -l 1
Current status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0503 power highspeed enable connect [1376:4e61 Marvell Mobile Composite Device Bus Mobile Composite Device Bus]
Sent power off request
New status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0000 off
root@OpenWrt:~# uhubctl
Current status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
Current status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0000 off
root@OpenWrt:~# lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller
Bus 001 Device 013: ID 1376:4e61 Marvell Mobile Composite Device Bus
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller
root@OpenWrt:~# uhubctl -a 1 -l 1
Current status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0000 off
Sent power on request
New status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0503 power highspeed enable connect [1376:4e61]
root@OpenWrt:~# uhubctl
Current status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
Current status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0503 power highspeed enable connect [1376:4e61 Marvell Mobile Composite Device Bus Mobile Composite Device Bus]
root@OpenWrt:~# lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller
Bus 001 Device 014: ID 1376:4e61 Marvell Mobile Composite Device Bus
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller
I have a single physical usb2 port that i need to flip, hub2 is usb1.1
Anyway when I run uhubctl -a 0 -l 2 i get:
root@OpenWrt:~# uhubctl -a 0 -l 2
Current status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
Sent power off request
New status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
And my modem's control panel still working. So -l 1 is correct
I can get all off only one by one. And hub2 is still powered according uhubctl output:
root@OpenWrt:~# uhubctl -a 0 -l 1
Current status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0503 power highspeed enable connect [1376:4e61 Marvell Mobile Composite Device Bus Mobile Composite Device Bus]
Sent power off request
New status for hub 1 [1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller 101c0000.ehci, USB 2.00, 1 ports, ppps]
Port 1: 0000 off
root@OpenWrt:~# uhubctl -a 0 -l 2
Current status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
Sent power off request
New status for hub 2 [1d6b:0001 Linux 5.15.162 ohci_hcd Generic Platform OHCI controller 101c1000.ohci, USB 1.10, 1 ports, ppps]
Port 1: 0100 power
After that if I physically unplug and plug my modem, LED on it turns on again