What Is the Difference Between /Dev/Tty* and /Dev/Bus/Usb/001/002?

When I plug in a device that uses the LUFA USB framework (or any USB<->serial peripheral), Ubuntu creates a /dev/ttyACM* device file. It also creates a /dev/bus/usb/001/002 file and a /sys/bus/usb/devices/usb1/1-1/1-1.3/1-1.3.1/ tree.

What are the differences between these? I ask because I am using pyudev, which provides device nodes such as the /dev/bus/... example, but I don't know if this is different to the tty. Is it?

1 Answer

The /sys/bus/usb/devices/* tree describes the full physical USB topology, and contains metadata about each device.

The /dev/bus/usb/<bus number>/<device number> devices address each device in a simplified way (so you don't have to care about whether a device is connected directly or via one or more USB hubs, just pick the right bus) and allows passing raw USB packets to/from the device. With a USB serial converter, you might send a request packet and get back a response describing the current state of the serial port's handshaking lines.

The /dev/ttyACM* device, on the other hand, hides the complexity of the USB bus and allows you to control the serial port of the USB<->serial peripheral pretty much like a directly-connected serial port, with all the features of a Unix-style tty driver. Because of the latencies caused by the USB bus, some things may not work as well as with a "real" serial port: in particular, attempts to bit-bang the control lines with precise timing might not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest