[CentOS] USB Serial ports (ttyACMn) CentOS 6.7 (64-bit) vs. CentOS 6.7 (64-bit)

Sat Feb 13 18:10:55 UTC 2016
Alexei Altuhov <alexx187 at gmail.com>

On Sat, Feb 13, 2016 at 5:14 PM, Robert Heller <heller at deepsoft.com> wrote:
> I sent this out about a week or so ago, but I have heard nothing. I am
> *thinking* it is a SELINUX problem, but I cannot figure out what. The SELINUX
> settings for both machines are *exactly* the same (the stock defaults for a
> standard CentOS 6 install).  The *only* difference is that the desktop
> (sauron) has a few VMs setup (under KVM) and the laptop (gollum) does not. The
> desktop has an AMD processor and a nVidia video chipset and the laptop has an
> Intel processor and an Intel graphic controller.  Although I can't see how
> either the processor or video chipset would have anything to to with the USB
> or USB serial port-type devices.  The desktop also has a PCI quad serial port
> card and includes the 8250.nr_uarts=8 kernel option and is set up to use an
> analog dialup modem to make PPP connections (again, I don't see that as having
> anything to do with anything).
>
> Both machines are running the same kernel: 2.6.32-573.12.1.el6.x86_64
>
>
>
>
> At Thu, 4 Feb 2016 16:13:33 -0500 Robert Heller <heller at deepsoft.com> wrote:
>
>>
>> I have two computers: both running CentOS 6.7, 64-bit, with
>> kernel 2.6.32-573.12.1.el6.x86_64.  One is a laptop with an 2 core Intel
>> processor and the other is a desktop machine with a 4 core AMD processor. Both
>> with selinux enabled.
>>
>> I have a USB serial port device (a RR-CirKits LCC-Buffer USB).  On the desktop
>> I am getting this error:
>>
>> sauron.deepsoft.com% sudo minicom
>> Device /dev/ttyACM0 access failed: No such file or directory.
>> sauron.deepsoft.com% dir -lZ /dev/ttyACM0
>> crw-rw----. root dialout system_u:object_r:tty_device_t:s0 /dev/ttyACM0
>>
>> But it is working on the laptop!
>>
>> gollum.deepsoft.com% dir -lZ /dev/ttyACM1
>> crw-rw----. root dialout system_u:object_r:tty_device_t:s0 /dev/ttyACM1
>>
>> Same kernel, same device (except it is showing up as ttyACM1 on the laptop).
>>
>> What is going on here?
>>

Hi,

Since  you haven't mentioned it, have you checked /var/log/dmesg to
make sure the device number is correct?  (for ex.: cdc_acm 2-1:1.4:
ttyACM0: USB ACM device)
I understand you've come a long way trying to figure this out, but I'd
had my share of hickups when the USB port had been faulty - the device
showed up and the number of the device kept changing.

Also check if there any errors in dmesg when you have just plugged in
the device.

My perms and SELinux context of the USB serial modem are the same, by the way:
ls -laZ /dev/ttyACM1
crw-rw----. root dialout system_u:object_r:tty_device_t:s0

Also, just to make sure sudo settings do not interfere:
sudo -u root -g dialout minicom
Same Error?

One more thing that I would check is to run to make sure I run the
minicom as root:
sudo minicom -s
Minicom's man page says
-s
Setup. Root edits the system-wide defaults in /etc/minirc.dfl with
this option. When it is used, minicom does not initialize, but puts
you directly into the configuration menu. This is very handy if
minicom refuses to start up because your system has changed, or for
the first time you run minicom. For most systems, reasonable defaults
are already compiled in.

Googling revealed another advice - check for the drivers in place:
cat /proc/bus/usb/devices
Found your device there?
It has to have lines with Driver other than "Driver=" and "Driver =(none)"

This is what I have
...
I:* If#= 2 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=fe Prot=00 Driver=cdc_phonet
I:* If#= 3 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_phonet
I:  If#= 3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_phonet
I:* If#= 4 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm
I:* If#= 5 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
...

Oh, and you have mentioned kernel option 8250.nr_uarts=8 - does it
mean you have 8 serial ports on the suaron?
Maybe the device  /dev/ttyACM0 does NOT belong to the device you are
trying to talk to? ( RR-CirKits LCC-Buffer USB ?)

If it is (and I am NOT an expert in serial devices debugging) than
maybe displaying the settings of that port will make you a hint?
stty --file /dev/ttyACM0 --all

Whew, an old technology sure does make you dive deep...