Multiport USB hubs/switches on Raspberry Pi

Bernd Walter ticso at cicely7.cicely.de
Mon Mar 11 05:01:11 UTC 2019


On Sun, Mar 10, 2019 at 10:10:28AM -0700, bob prohaska wrote:
> Does anyone have experience using multiport USB hubs on freebsd-arm,
> specifically in the context of Raspberry Pi 2 or 3?

USB hubs work fine on Raspberries and they better should, since
one is integrated on most of them.
I run a Pi3B+ on my Pick an Place machine to hook up all the IO boards.
Works fine, just recently upgraded from a Pi2.
[51]pnp-gcode.cicely.de# usbconfig
ugen0.1: <DWCOTG OTG Root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x0424 product 0x2514> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (2mA)
ugen0.3: <vendor 0x0424 product 0x2514> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (2mA)
ugen0.4: <vendor 0x0424 product 0x7800> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
ugen0.5: <FTDI FT232R USB UART> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (90mA)
ugen0.6: <FTDI FT232R USB UART> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (90mA)
ugen0.7: <vendor 0x1a40 USB 2.0 Hub MTT> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.8: <vendor 0x1a86 USB2.0-Serial> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (96mA)
ugen0.9: <vendor 0x1a86 USB2.0-Serial> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (96mA)
ugen0.10: <FTDI FT232R USB UART> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (90mA)
ugen0.11: <Atmel Corp. Atmel-ICE CMSIS-DAP> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)
ugen0.12: <BWCT OpenPnP power control> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.13: <SanDisk SDDR-B531 Reader> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.14: <BWCT OpenPnP Feeder> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
[52]pnp-gcode.cicely.de# uname -a
FreeBSD pnp-gcode.cicely.de 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  arm64

> I'm interested in trying to use a hub/switch (not sure there's a
> difference in the case of USB) to construct a terminal server for
> serial console access on a small cluster of Pi's. I'd want about
> seven or eight ports, each holding a USB-serial adapter that would
> then connect to the GPIO UART pins on one Pi in the cluster. I've
> used both USB 3.0 and USB 1.1 hubs, and in both cases odd things 
> seem to happen from time to time. One potential example is 
> 
> 
> https://www.amazon.com/AmazonBasics-Port-USB-2-0-Hub/dp/B00GGYU46O/ref=sxin_2?keywords=powered+usb+hub&pd_rd_i=B00GGYU46O&pd_rd_r=83f1e3f0-a1e6-40aa-bdd8-aa86a7c0b360&pd_rd_w=foNmt&pd_rd_wg=ncKZR&pf_rd_p=0395a9fd-d124-46c0-a48f-d8582ed1a45c&pf_rd_r=2P9WWPAZGMAA29NMVVV2&qid=1552234319&s=gateway

I can't speak for this specific hub, but many hubs are build marginal,
especially when it comes to power delivery.
In this special case I'm a bit sceptical supplying 10 port with that
power supply and tiny connector.
The hub I use on the pick and place machine is a bare PCB with 5V input
from a big supply.
For important stuff, especially if I need them to supply devices, I use
hubs with higher input voltage and internal 5V regulator.
Exsys has some nice ones, but they are not the only vendor.
Exsys also has a big 19" hub, if that matters for your case.

My suggestion is to use USB uarts, which can hold a serial number, such
as uftdi or uslcom based.
This makes it easier to wire them via devd.
E.g. I have something like this in my devd.conf for a CP2102:
attach 0 {
        device-name             "uslcom[0-9]+";
        match "sernum"          "TTL01";
        match "interface"       "0";
        action                  "rm /dev/ttluart1; ln -s /dev/cua$ttyname /dev/ttluart1";
};

And for a FT4232:
attach 0 {
        device-name             "uftdi[0-9]+";
        match "sernum"          "FTXO1CJC";
        match "interface"       "0";
        action                  "rm /dev/manson_psu9; ln -s /dev/cua$ttyname /dev/manson_psu9";
};

attach 0 {
        device-name             "uftdi[0-9]+";
        match "sernum"          "FTXO1CJC";
        match "interface"       "1";
        action                  "rm /dev/manson_psu10; ln -s /dev/cua$ttyname /dev/manson_psu10";
};

attach 0 {
        device-name             "uftdi[0-9]+";
        match "sernum"          "FTXO1CJC";
        match "interface"       "2";
        action                  "rm /dev/x1; ln -s /dev/cua$ttyname /dev/x1";
};

attach 0 {
        device-name             "uftdi[0-9]+";
        match "sernum"          "FTXO1CJC";
        match "interface"       "3";
        action                  "rm /dev/x2; ln -s /dev/cua$ttyname /dev/x2";
};


> If anyone has experience along these lines or a suggestion for/against
> particular USB devices or versions I'd be curious to know.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


More information about the freebsd-arm mailing list