I've got a powered USB hub with an ethernet port connected to my Pi. When the Pi boots with it plugged, the boot process hangs until I unplug it. This seemingly includes the clock, as /var/log/syslog
doesn't show any indication of the hang, as there is no gap between the different events.
To demonstrate this, I've registered a systemd service after network.target
which simply knocks on an FTP server that I'm running on a different machine. When the hub is not plugged in, the FTP server receives a connection ~30 seconds after a reboot. Whereas when it is plugged in, the connection doesn't happen until ~30 seconds after I unplug the hub.
You can observe this in these two short clips:
- No USB hub: https://streamable.com/kajjvg
- With USB hub: https://streamable.com/zrrpwg
In the latter, I unplug the hub at exactly 02:00, and click "Split" once I return to my computer around 10 seconds later.
Aug 8 18:13:13 blueberry kernel: [ 0.767670] usb 1-1: new high-speed USB device number 2 using xhci_hcd
Aug 8 18:13:13 blueberry kernel: [ 0.950324] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
Aug 8 18:13:13 blueberry kernel: [ 0.950365] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
Aug 8 18:13:13 blueberry kernel: [ 0.950393] usb 1-1: Product: USB2.0 Hub
Aug 8 18:13:13 blueberry kernel: [ 0.952444] hub 1-1:1.0: USB hub found
Aug 8 18:13:13 blueberry kernel: [ 0.952780] hub 1-1:1.0: 4 ports detected
Aug 8 18:13:13 blueberry kernel: [ 1.141534] NET: Registered protocol family 10
Aug 8 18:13:13 blueberry kernel: [ 1.142765] Segment Routing with IPv6
--- snip ---
Aug 8 18:13:24 blueberry dhcpcd[358]: eth0: adding route to 192.168.1.0/24
Aug 8 18:13:24 blueberry dhcpcd[358]: eth0: adding default route via 192.168.1.1
Aug 8 18:13:24 blueberry dhcpcd[358]: forked to background, child pid 549
Aug 8 18:13:24 blueberry systemd[1]: Started dhcpcd on all interfaces.
Aug 8 18:13:24 blueberry systemd[1]: Reached target Network.
Aug 8 18:13:24 blueberry systemd[1]: Starting Permit User Sessions...
Aug 8 18:13:24 blueberry systemd[1]: Started Interfaces.
Aug 8 18:13:24 blueberry systemd[1]: Starting /etc/rc.local Compatibility...
Aug 8 18:13:24 blueberry systemd[1]: Starting OpenBSD Secure Shell server...
Aug 8 18:13:24 blueberry systemd[1]: Condition check resulted in fast remote file copy program daemon being skipped.
Aug 8 18:13:24 blueberry log.sh[551]: Knocking on FTP...
Aug 8 18:13:24 blueberry systemd[1]: Started Permit User Sessions.
As you can see, there is barely any difference in time between when the hub is found and when the FTP connection is made. Yet in real time, the time spent is a few minutes.
I should add that the Pi does NOT hang if it is plugged in after it has already fully booted. This is the exact USB hub I'm using: https://www.amazon.com/UGREEN-Ethernet-Adapter-Converter-Chromebook/dp/B07TWGHM99/
I initally thought it was the ethernet interface on the hub conflicting with the on-board one, as I'm running it headlessly and I could not connect to the SSH service. As such I opened this other question, which pointed me towards adding the following bit to /etc/dhcpcd.conf
, that disables said interface: denyinterfaces enx2c16dba05ff7
/boot/config.txt
.blueberry
is just the hostname, it is used in the system logs.