Skip to content


serial ports for linux #42

merged 1 commit into from

3 participants


Detect Serial Ports from Linux.

Alternate way is to execture

dmesg | grep tty

But the output cannot be easily parsed.

So followed the way windows COM ports are done.


Your if statement will exclude devices like `/dev/ttyACM0" on Linux systems.

Also, just tried dmesg | grep tty and dmesg | grep ACM on an OpenWRT box. /dev/ttyACM0 (a connected Arduino Uno) doesn't appear. So regardless of the output being difficult to parse, it doesn't seem to be reliable across Linux distros.

I have a feeling this can be solved simply by making the regex match on the line you removed case insensitive, i.e. /usb|ACM/i instead. Try that.


Thanks @vickash.

Just updated the commit to reflect that.

@austinbv austinbv merged commit ebc076e into austinbv:master

1 check passed

Details default The Travis CI build passed
@nishantmodak nishantmodak deleted the nishantmodak:linux-tty branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 24, 2013
  1. @nishantmodak

    serial ports for linux

    nishantmodak committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/dino/tx_rx/usb_serial.rb
2  lib/dino/tx_rx/usb_serial.rb
@@ -54,7 +54,7 @@ def tty_devices
1.upto(9) { |n| com_ports << "COM#{n}" }
- `ls /dev`.split("\n").grep(/usb|ACM/).map{|d| "/dev/#{d}"}
+ `ls /dev`.split("\n").grep(/usb|ACM/i).map{|d| "/dev/#{d}"}
Something went wrong with that request. Please try again.