uhubctl on odroid-c4

Post Reply
matwey
Posts: 1
Joined: Fri Jul 08, 2016 9:11 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

uhubctl on odroid-c4

Post by matwey »

Hi,

I would like to order odroid-c4, but before I want to know if https://github.com/mvp/uhubctl works correctly on the board. Could somebody please test it? This tool allows to turn on/turn off USB power per-port.

From the board schematics I see that there is VIA USB hub chip on the board and all EN lines seems to be routed correctly to the power limit switches, but I have found no evidence of successful work.

mad_ady
Posts: 8820
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 529 times
Contact:

Re: uhubctl on odroid-c4

Post by mad_ady »

I'll try to experiment on monday and let you know, unless somebody tests it sooner

User avatar
rooted
Posts: 8110
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 727 times
Been thanked: 270 times
Contact:

Re: uhubctl on odroid-c4

Post by rooted »

It works, I ran this and my WiFi dongle power went out.

Code: Select all

sudo ./uhubctl -l 2-1 -p 2 -a off
Here is the output with no flags:

Code: Select all

 sudo ./uhubctl
Current status for hub 2-1 [2109:0817 VIA Labs, Inc. USB3.0 Hub, USB 3.10, 4 ports]  Port 1: 02a0 power 5gbps Rx.Detect
  Port 2: 02a0 power 5gbps Rx.Detect
  Port 3: 02a0 power 5gbps Rx.Detect
  Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 2 [1d6b:0003 Linux 4.9.236-51 xhci-hcd xHCI Host Controller xhci-hcd.0.auto, USB 3.00, 1 ports]
  Port 1: 0203 power 5gbps U0 enable connect [2109:0817 VIA Labs, Inc. USB3.0 Hub, USB 3.10, 4 ports]
Current status for hub 1-1 [2109:2817 VIA Labs, Inc. USB2.0 Hub, USB 2.10, 4 ports]  Port 1: 0100 power
  Port 2: 0503 power highspeed enable connect [0bda:a811 Realtek 802.11ac WLAN Adapter 00e04c000001]
  Port 3: 0100 power
  Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 4.9.236-51 xhci-hcd xHCI Host Controller xhci-hcd.0.auto]
  Port 1: 0503 power highspeed enable connect [2109:2817 VIA Labs, Inc. USB2.0 Hub, USB 2.10, 4 ports]
  Port 2: 0100 power 
These users thanked the author rooted for the post:
odroid (Mon Nov 23, 2020 5:42 pm)

mad_ady
Posts: 8820
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 529 times
Contact:

Re: uhubctl on odroid-c4

Post by mad_ady »

Are you sure it stops only one port and not the whole bus?
I'm going to try it on my n2 running Android. If it works I could power myu sb speakers automatically only when playing music (keep them off when hdmi is on)

User avatar
rooted
Posts: 8110
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 727 times
Been thanked: 270 times
Contact:

Re: uhubctl on odroid-c4

Post by rooted »

mad_ady wrote:Are you sure it stops only one port and not the whole bus?
I'm going to try it on my n2 running Android. If it works I could power myu sb speakers automatically only when playing music (keep them off when hdmi is on)
I can stop port one and the whole thing.

It may have been port 2 and the whole bus, the above command was the whole bus.

I believe I used this for the single port.

Code: Select all

 uhubctl -l 1 -p 2 -a 0 

mad_ady
Posts: 8820
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 529 times
Contact:

Re: uhubctl on odroid-c4

Post by mad_ady »

It works for N2 as well (from within linux under android). I was able to toggle power to my USB webcam:

Code: Select all

adrianp@bellatrix-n2:~/uhubctl$ sudo uhubctl 
Current status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 1: 02a0 power 5gbps Rx.Detect
  Port 2: 02a0 power 5gbps Rx.Detect
  Port 3: 02a0 power 5gbps Rx.Detect
  Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 2 [1d6b:0003 Linux 4.9.113 xhci-hcd xHCI Host Controller xhci-hcd.0.auto, USB 3.00, 1 ports]
  Port 1: 0203 power 5gbps U0 enable connect [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
Current status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 1: 0100 power
  Port 2: 0503 power highspeed enable connect [0c45:6340 Sonix Technology Co., Ltd. USB 2.0 Camera]
  Port 3: 0100 power
  Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 4.9.113 xhci-hcd xHCI Host Controller xhci-hcd.0.auto]
  Port 1: 0503 power highspeed enable connect [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0100 power
adrianp@bellatrix-n2:~/uhubctl$ sudo uhubctl -l 1-1 -p 2 -a off
Current status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 2: 02a0 power 5gbps Rx.Detect
Sent power off request
New status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 2: 00a0 off
Current status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0503 power highspeed enable connect [0c45:6340 Sonix Technology Co., Ltd. USB 2.0 Camera]
Sent power off request
New status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0000 off
adrianp@bellatrix-n2:~/uhubctl$ sudo uhubctl 
Current status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 1: 02a0 power 5gbps Rx.Detect
  Port 2: 00a0 off
  Port 3: 02a0 power 5gbps Rx.Detect
  Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 2 [1d6b:0003 Linux 4.9.113 xhci-hcd xHCI Host Controller xhci-hcd.0.auto, USB 3.00, 1 ports]
  Port 1: 0203 power 5gbps U0 enable connect [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
Current status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 1: 0100 power
  Port 2: 0000 off
  Port 3: 0100 power
  Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 4.9.113 xhci-hcd xHCI Host Controller xhci-hcd.0.auto]
  Port 1: 0503 power highspeed enable connect [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0100 power
adrianp@bellatrix-n2:~/uhubctl$ sudo uhubctl -l 1-1 -p 2 -a on 
Current status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 2: 00a0 off
Sent power on request
New status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 2: 02a0 power 5gbps Rx.Detect
Current status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0000 off
Sent power on request
New status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0101 power connect [0c45:6340]
adrianp@bellatrix-n2:~/uhubctl$ sudo uhubctl 
Current status for hub 2-1 [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
  Port 1: 02a0 power 5gbps Rx.Detect
  Port 2: 02a0 power 5gbps Rx.Detect
  Port 3: 02a0 power 5gbps Rx.Detect
  Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 2 [1d6b:0003 Linux 4.9.113 xhci-hcd xHCI Host Controller xhci-hcd.0.auto, USB 3.00, 1 ports]
  Port 1: 0203 power 5gbps U0 enable connect [05e3:0620 GenesysLogic USB3.1 Hub, USB 3.10, 4 ports]
Current status for hub 1-1 [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 1: 0100 power
  Port 2: 0503 power highspeed enable connect [0c45:6340 Sonix Technology Co., Ltd. USB 2.0 Camera]
  Port 3: 0100 power
  Port 4: 0100 power
Current status for hub 1 [1d6b:0002 Linux 4.9.113 xhci-hcd xHCI Host Controller xhci-hcd.0.auto]
  Port 1: 0503 power highspeed enable connect [05e3:0610 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports]
  Port 2: 0100 power


mad_ady
Posts: 8820
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 529 times
Contact:

Re: uhubctl on odroid-c4

Post by mad_ady »

Ok, had time for a few more tests. I have a USB powered speaker connected to an N2 (running Android with Linux Deploy). I've tried powering off the usb 3 ports one by one, but the speaker power remained on even if the ports were off. I moved the speaker to the OTG port and turned that off as well - the same thing happens - the speakers remain powered (:sad:).
So, it may stop the port logically, but it doesn't seem to cut power physically to the port.

User avatar
rooted
Posts: 8110
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 727 times
Been thanked: 270 times
Contact:

Re: uhubctl on odroid-c4

Post by rooted »

It does on the C4, I have a camera attached just using power from the USB and when I cut power to the entire hub the camera powers down.

Individually I'm not sure but it seems only one port can be powered down individually.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest