3D Printers and USB Bus Overload

Last year I turned my gaming rig into a hackerspace server - and gaming rig. Alongside the gaming VM and test server, I’m also running 2 Octoprint containers for my 3D printers. Since that post, I’ve had 2 issues with my printers that I believe were both caused by the same thing: USB Bus Overload.
Problem 1: Webcam Stability
I never did figure out the exact conditions that made this happen, but after a reboot of the server I was almost never able to get both webcams working at the same time - it was either one or the other. I kept getting no space left on device
errors from whichever container didn’t have the working camera.
Problem 2: Octoprint Throwing M112 Emergency Stop Code
Another issue that happened often, but not every time, was that Octoprint was throwing the M112
code to my Prusa Mini, usually during bed leveling, causing it to scream like a banshee and perform an emergency stop. Octoprint logs showed that it was throwing this error because it lost communication with the printer.

Solution: Split Things Up
I came across this article about putting multiple cameras on an Octoprint instance which mentions that no space left on device
error relating to maxing out the USB bus capacity. Both printers and both webcams were all plugged into a single USB hub, and thus all running through the same USB bus on the host. Running lsusb
verified this:
burritovoid@ARCHER | ~ > lsusb
Bus 008 Device 003: ID 045b:0210 Hitachi, Ltd
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 019: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 007 Device 018: ID 046d:c07d Logitech, Inc. G502 Mouse
Bus 007 Device 017: ID 04d9:0169 Holtek Semiconductor, Inc. USB Keyboard
Bus 007 Device 015: ID 045b:0209 Hitachi, Ltd
Bus 007 Device 005: ID 046d:082c Logitech, Inc. HD Webcam C615
Bus 007 Device 006: ID 2c99:0002 Prusa Original Prusa i3 MK3
Bus 007 Device 003: ID 046d:082c Logitech, Inc. HD Webcam C615
Bus 007 Device 004: ID 2c99:000c Prusa Original Prusa MINI
Bus 007 Device 002: ID 045b:0209 Hitachi, Ltd
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0b05:180a ASUSTek Computer, Inc. Broadcom BCM20702 Single-Chip Bluetooth 4.0 + LE
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I started moving things around and rerunning lsusb
to map out which physical ports belonged to which buses. With that figured out, I grabbed another USB hub and put each printer and matching webcam on it’s own hub, plugged into ports on different USB busses. Running lsusb
again confirmed this:
burritovoid@ARCHER | ~ > lsusb
Bus 008 Device 003: ID 045b:0210 Hitachi, Ltd
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 019: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 007 Device 018: ID 046d:c07d Logitech, Inc. G502 Mouse
Bus 007 Device 017: ID 04d9:0169 Holtek Semiconductor, Inc. USB Keyboard
Bus 007 Device 015: ID 045b:0209 Hitachi, Ltd
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 004: ID 046d:082c Logitech, Inc. HD Webcam C615
Bus 005 Device 003: ID 2c99:0002 Prusa Original Prusa i3 MK3
Bus 005 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 046d:082c Logitech, Inc. HD Webcam C615
Bus 003 Device 004: ID 2c99:000c Prusa Original Prusa MINI
Bus 003 Device 002: ID 045b:0209 Hitachi, Ltd
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0b05:180a ASUSTek Computer, Inc. Broadcom BCM20702 Single-Chip Bluetooth 4.0 + LE
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
This fixed both of my issues immediately. The camera issue doesn’t surprise me once I’ve thought about it, but the printer communication one still does.