<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>By submitting your question to DuckDuckGo, I found
<a class="moz-txt-link-freetext" href="https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them">https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them</a></p>
<p>To quote: <br>
</p>
<pre><code>To see which tty's are currently in use, you can simply look into the file
/proc/tty/drivers:
and get a rather short list of devices.
</code>Does it help?
<code></code></pre>
<div class="moz-cite-prefix">On 7/10/20 10:35 AM, Bo Berglund via
lazarus wrote:<br>
</div>
<blockquote type="cite"
cite="mid:t0opnf11coiuifq92knhqa1n76p95mt7mj@4ax.com">
<pre class="moz-quote-pre" wrap="">Is there a way to list the available (working) serial ports on a Linux
platform like the RaspberryPi?
I would like to offer a dropdown list of working serial ports to the
user to select among, but I am dissuaded from it when I do the
following:
ls -la /dev/tty*
It returns a very long list of serial devices and most of these are
probably not even existing in real life.
On an RPi I get
/dev/tty
/dev/ttyN (where N=0..63
/dev/ttyAMA0 <== This is RPi Serial0 port on the pin header.
/dev/ttyprintk
and:
/dev/ttyUSB0../dev/ttyUSB3 depending on what is plugged into USB
All in all about 70 devices, but not sure which are actually available
for use.
Is this an impossible task or can one check for "live" serial ports
only? If so how?
On Windows I have ported a convoluted function from Delphi, which uses
Registry reads to give me the list.
</pre>
</blockquote>
</body>
</html>