6 ms·
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.
by seba_dos1 3y ago
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.
- rickdeckard 3y agoNo need to guess. First sentence on the page: "Have you ever wanted to control USB devices using an Arduino, ESP32, or Raspberry Pi? with the i2C USB Hub, you can!"
- seba_dos1 3y agoBut you can control USB devices using an Arduino, ESP32 or Raspberry Pi via USB just fine :P
- gsich 3y agoNot all.
- seba_dos1 3y agoAll. The available features vary though.
- gsich 3y agoNot all. I have several that can't be controlled.
- seba_dos1 3y agoAll. 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.
- gsich 3y ago>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. 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.
- seba_dos1 3y agoYou're replying to my comment about an interface used to control such hubs, so it's what you are saying that's irrelevant in this context. 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.
- gsich 3y ago>You're replying to my comment about an interface used to control such hubs, so it's what you are saying that's irrelevant in this context. 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.
- boffinAudio 3y agoThis is very, very handy for development purposes - those of us building firmware and drivers for USB devices are very familiar with the need to reset (unplug/replug) devices during development, and being able to do this with I2C and automatable software procedures is a GODSEND .. I've already started the process of getting a couple PCB's made from this project, and have subscribed for futher updates as the devs get their revision made... this project is very valuable for us in the embedded industry, and I for one would like to see software-controllable USB ports become a very standard thing, personally. 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 ...
- Goz3rr 3y agoSoftware controllable USB ports already are a thing, Per-port power switching can be found in the USB 2.0 spec and there's a bunch of hubs out there that implement it, controllable via USB instead of I2C. Since USB 3.2 any device that has downstream type C ports is required to implement PPPS. A DIY hub that uses a chip with PPPS support can be found here for example: https://oshwlab.com/iamseer/ch335-hub https://oshwlab.com/iamseer/ch335-hub
- boffinAudio 3y agoCool, got any suggestions for products that already implement this, particularly those with existing software shims that could be easily integrated into a test suite? I'd be a happy customer if there were such a thing, easily orderable, but I confess I don't quite know what keywords to use to find it ..
- seba_dos1 3y ago"already"? It's something available since USB 1.0 has been created (see section 11.10). For example, it can be automatically used by the Linux kernel (after setting pm_qos_no_power_off to 0), and recently a node to disable a port explicitly has been added as well. 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 ;)
- crote 3y agoIt is extremely rare for USB hubs to support remote power switching of individual USB ports. As someone who develops USB devices, this kind of i2c-controllable hub would save me a lot of cable unplugging.
- ilyt 3y agoGet USB hub with buttons ? I-tec makes one, there is even 16 port version
- alufers 3y agoI've tried a few Amazon Basics ones, and on all of them power switching per-port worked. Uhubctl's compatibility list. seems to confirm my experience. The only problem is that the 7 port ones are in fact two 4-port hubs in a trenchcoat, which makes port numbering a bit weird. Nothing a couple of stickers can't fix, though. https://github.com/mvp/uhubctl https://github.com/mvp/uhubctl