[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev alzheimers



Gene Heskett wrote: 
> greetings all;
> 
> Since updating to stretch, udev has been randomly swapping ttyUSB0 and 
> ttyUSB1 and sometimes ttyUSB2 around, confusing the hell out of heyu, a 
> trs-80-coco3, and occasionally even nut.  Nut (apc ups) is not on a 
> usb-serial adapter, it just a usb cable but the other 2 are on 
> individually unique FTDI adaptors. 
> 
> What udev persistent file, and where is it, do I edit and chattr +i to 
> effect a permanent cure for this apparently random device renaming?
> 
> And whats the command to restart udev from a clean slate without 
> rebooting?
> 
> These are the ttyUSB ports that need persistent names:
> 
> root@coyote:rules.d$ usb-devices|grep -C4 SERIAL
> T:  Bus=01 Lev=01 Prnt=01 Port=09 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
> D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=0403 ProdID=6001 Rev=04.00
> S:  Manufacturer=FTDI
> S:  Product=USB HS SERIAL CONVERTER
> S:  SerialNumber=FTDHG45D
> C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=44mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio
> 
> --
> T:  Bus=01 Lev=02 Prnt=04 Port=02 Cnt=02 Dev#=  7 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=0403 ProdID=6001 Rev=06.00
> S:  Manufacturer=FTDI
> S:  Product=USB FAST SERIAL ADAPTER
> S:  SerialNumber=FTOOS09N
> C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio

udevinfo -a -p $(udevinfo -q path -n /dev/ttyUSB0)   # will get
you the list of attributes you can match on

Then in /etc/udev/rules.d/  you want a file that says things
like:

SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", ATTR{idSerialNumber="FTDHG45D" SYMLINK+="ttyUSB0", GROUP="serial"
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", ATTR{idSerialNumber="FTTOOS09N", SYMLINK+="ttyUSB1", GROUP="serial"

ATTR{idSerialNumber} will be crucial, but it might not be
labeled that way - check with the udevinfo statement above.

Change GROUP as desired.

-dsr-


Reply to: