So many issues with USB during development can be resolved if you can just get the device reset during the dev process. Being able to hard-reset a device during compile/debug phases is going to save me huge amounts of time and effort ...
A DIY hub that uses a chip with PPPS support can be found here for example: https://oshwlab.com/iamseer/ch335-hub
The support for commands themselves (SET/CLEAR_FEATURE) is mandated by the spec, so all hubs support it. However, some hubs don't feature port power control at all (are physically unable to selectively turn off power - you can only turn them all off or not at all), but for those it doesn't matter how you control them ;)
The available features vary though.
You can't have a USB hub that can't be controlled over USB, it wouldn't be able to work at all. The spec requires hubs to be active devices that show up on the bus and that can handle requests from the host, such as selective suspend or port power control.
Whether your hub actually offers a physical ability to turn off power of individual ports is another matter. The spec allows port power to be ganged (all ports being disabled at once after all of them have been requested to be disabled) and for all ports to be always powered - you can find out which mode the hub implements by reading wHubCharacteristics field in the hub descriptor.
Irrelevant in this context.
>Whether your hub actually offers a physical ability to turn off power of individual ports is another matter.
And the only matter that counts when it comes to "controllable" USB hubs. If I can't "control" the USB hub with uhubctl (or any other tool) it's not controllable.
All hubs have means to control them via USB in-band (there are other things to control there than power too), and hubs that do support power switching can be controlled this way, so there's no need to use external interfaces like I2C unless you want to control such hub externally (not from the USB host), which is what this thread was about.
Yes. An interface. Because not all hubs can be controlled in-band. Maybe you have a different definition of "control".
>All hubs have means to control them via USB in-band (there are other things to control there than power too), and hubs that do support power switching can be controlled this way, so there's no need to use external interfaces like I2C unless you want to control such hub externally (not from the USB host), which is what this thread was about.
This is wrong though. I can't control my hub. Doesn't matter that there are some other stuff I could theoretically control. (or the OS does without my intervention)
Yes. The Github link is about how to control a USB hub via I2C. From the description:
>Have you ever wanted to control USB devices using an Arduino, ESP32, or Raspberry Pi? with the i2C USB Hub, you can! Turn on or off ports of the USB hub using i2c, as well as control indicator lights and set current limits per-port.
So you saying, that you could do that in-band is wrong, because not all hubs can be controlled in-band.
Or the easy definition: no port control == not controllable.
Nothing's wrong there and you're just playing with semantics to not admit your misunderstanding. All hubs have an in-band control interface available that can be used by them to implement port power control, period.
> The Github link is about how to control a USB hub via I2C.
No, it points to a hardware design for a very specific hub that implemented its port power control via I2C. Usually hubs don't have any I2C interface at all as they don't need one, regardless of whether they do port control or not.
You want to make it about semantics because you think that "control" means something different then what it means. There are hubs that can't be controlled that way. Period.
./uhubctl
No compatible devices detected!
Run with -h to get usage info.
Feel free to tell me how I can get those uncontrollable hubs compatible.>USB hubs are controllable via USB, so I guess this is for cases where your hub is connected to a device you don't control.
This is not a generally true. I gave an example of an uncontrollable hub you deemed irrelevant.
What is control if it's not controlling the USB hub? It's not "the kernel does something which requires no user input".
Every USB hub has a control channel over USB and it's true regardless of how you may want to redefine the word "control". My post attempted to answer a question that popped into my mind when looking at this submission: "why would I want a USB hub that implements power control via I2C instead of USB?" (another answer could be "because it's easier to retrofit such functionality on top of a hub chip that doesn't do power control", although that one is only relevant for the designer and not for the user of such device).
Meanwhile, I just sent a command to a USB hub in my mobile phone in order to suspend a modem connected to it - something every USB hub is capable of doing and what can be controlled by the user (yes, it's a function of the hub, not of the device). But you do you, enjoy your world.
uhubctl doesn't concern itself with all those features, but technically there's nothing preventing it from implementing them alongside power control.
I have spent more time reading USB specs and debugging USB connection troubles than I wish I had to.