As long as you are only using one serial device at a time and aren't plugging it in and out quickly it will always be ttyUSB0. lsusb is a utility for displaying information about USB buses in the. However, this is a bit tricky (and the subject of a different question), so unless this really becomes a problem for you, don't worry about it. The output tells us that we are on a system with an ARM processor with a BogoMIPS of 697.95. There are ways to make sure a device always has the same dev node name when you plug it in, a name you assign to it. Sometimes a USB interface dev node may end up remaining in existence for a bit after you remove the device, so, e.g, if you unplug the device and then plug it in right away again, it may end up as ttyUSB1 even though you never had two devices plugged in at the same time. But if you removed the original one after plugging the second one in, ttyUSB0 would disappear, but ttyUSB1 would still exist (i.e., they don't get re-assigned as long as they remain plugged in). However, if you unplugged the original one first, that dev node interface would be removed, and the new one would probably end up as ttyUSB0. So, if you plugged another serial device into another USB port with the first one still plugged in, that would be ttyUSB1. It's based on the order in which the interface is created by the kernel (notice, no serial devices plugged in, no ttyUSB entries in /dev).
The device node name is not based on a static numbering of the USB ports, such that if you plugged it into the port next over you would get ttyUSB2 instead. lsusb is a utility for displaying information about USB buses in the system and the devices connected to them.
In this case it looks to be ttyUSB0.īy the way, how do I know which port (out of the 4) has a serial port? by trial and error?Īll the physical USB ports on the pi are equivalent none of them has any special properties relative to another. Under my sudoer user (non-root), I can see my device with lsusb. Serial device attached to USB ports will generally end up with that in their name. I have a question regarding the ports in Linux.
When you're done, rm dev*.txt to delete the two files. Plug it in, do it again, check what's changed: ls -1 /dev > dev2.txt Is there a way to relate these two results (or an alternative) to figure out what I need For. A refinement to oh.dae.su's method: dmesg | grep "tty"Īnother trick would be to save the state of /dev before plugging it in: ls -1 /dev > dev.txt lsusb To get more information about the USB buses and connected devices.