Learn how to determine the enumeration speed of devices connected to USBHUB3+ and whether they're operating at high or super speeds.
Each port on USBHub3+ can operate in High Speed or Super Speed modes. There are three ways to view the speed of a connected port
-
Front panel LED
-
HubTool virtual LED
-
Brainstem API
Connecting a USB 2.0 device to port 0, you should see a yellow LED on the hub front panel, and a corresponding yellow box in HubTool indicating a high-speed connection.
Port speed on a USBHUB3+ can also be queried using Python. We'll be working in an interactive Python console to be able to work line-by-line.
If you haven’t already, install the Brainstem package (See the Quickstart Guide for more detail)
>>> import brainstem
Create an instance of the USBHub3p called "hub"
>>> hub = brainstem.stem.USBHub3p()
Discover and connect to the hub
>>> hub.discoverAndConnect(brainstem.link.Spec.USB) 0
A return value of 0 means no error.
>>> hub.usb.getDownstreamDataSpeed(0).value
1
High Speed connection:
Value | Hub Downstream Speed Descriptions |
---|---|
0 | No device enumerated |
1 | High-Speed device enumerated |
2 | SuperSpeed device enumerated |
The speed description refers to which data lines are active. An iPhone connected via lightning at up to 480 Mb/s and a USB mouse at up to 1.5 Mb/s would both appear as High-Speed devices on the hub and HubTool LEDs and return a "1" because they are using the USB 2.0 High-Speed data lines.
What else could you do with USBHub3+?
- Independently control VBus and data for each port
- Turn on and off VBus
- Enable and disable data connections:
- Power Measurements
- Measure current and voltage on each port
- Monitor input power and system power
- Switch ports between Charging Downstream Port (CDP) and Standard Downstream Port (SDP) (up to 500 mA)
- View the enumeration speed of a connected device
- Switch upstream hosts
- Automatically
- Programatically
- Add more ports by daisy chaining hubs
- Other uses of the USBHub3+
Add new comment