Re: USB device random clash problem?

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

 



Resending to Kay and linux-hotplug, as this appears to be a problem in
udev.  For this purpose, the parts concerning the java library and the
lack of a proper serial number can be ignored.

I get the feeling that the udev script could be improved; in particular
there probably should be a delay between loading the driver and
executing the stty command.  But there's likely more going wrong here
than just that.

Alan Stern


On Mon, 26 Jul 2010, Greg KH wrote:

> On Sun, Jul 25, 2010 at 09:01:06PM +0200, Ben Andersen wrote:
> > Hello,
> > 
> > I have 3 USB devices connected which are part of a cash register.
> > 
> > 1. USB Fiscal control unit (symlink: ttyS10)
> > 2. Serial Receipt printer on a USB2Serial converter (symlink: ttyS20)
> > 3. USB Customer display (symlink: ttyS30)
> > 
> > I need to know which ttyUSB* each device gets. I solved this with a udev
> > rules file with symlinks to ttyS* which works fine. I had to make them
> > ttyS* and not something like /dev/receiptprinter to have them working
> > with the java lib rxtx, it seems they have to have a "serial port name".
> 
> Sounds like a java library problem :)
> 
> > The ttyS30 device does not work with the common lucid kernel. So I had
> > to get the latest generic kernel, else it just does not work at all.
> > 
> > My only problem now is that the device that should come up as ttyS30
> > sometimes does not map to any ttyUSB* and hence the ttyS30 symlink
> > points to bus something instead of ttyUSB* and the device is unusable.
> > If I don't connect the ttyS10 device this is not a problem so it seems
> > there is some kind of clash that sometimes prevents the ttyS30 device
> > from working. They're both using the same driver (ftdi_sio) while ttyS20
> > is using pl2303.
> > 
> > My udev rules are as follows:
> > http://paste.ubuntu.com/468897/
> > 
> > When it works it looks like this:
> > http://paste.ubuntu.com/468881/
> > 
> > When it does not work it looks like this:
> > http://paste.ubuntu.com/468882/
> > 
> > Note this line when it's not working..
> > util_run_program: '/sbin/modprobe' (stderr) 'FATAL: Module
> > usb:v0519p0007d0400dc00dsc00dp00icFFiscFFipFF not found.'
> > 
> > I tried changing the rules file to only using idVendor as unique
> > selection and it seemed to work at first but now it's the same again.
> > Sometimes it works, sometimes it does not when starting up the computer.
> > 
> > It does always work it seems if plugging the ttyS10 device after startup
> > of the computer.
> > 
> > One side problem is that this line never works:
> > ATTRS{idVendor}=="0519", ATTRS{idProduct}=="0007", RUN+="/bin/stty -F
> > /dev/ttyS30 19200"
> > It works running the line from cmd-line or the script which starts the
> > POS-software. BUT not when I autstart the script in Ubuntu (startup
> > programs). It seems it's too early for ttyS30 to be completely finished??
> > 
> > Thanks for any help in this matter! It would be fantastic if Ubuntu
> > would work better as a POS system. I'm using Openbravo POS btw.
> 
> As this is a userspace udev issue, there's nothing that the kernel can
> do here really.  I'd recommend using a device with a unique serial
> number, and/or using the /dev/serial/ symlinks to get the proper
> persistant device name for your devices, so no matter what happens with
> the devices being found in any order, it will all "just work".
> 
> Oh, and go fix your java library, it shouldn't only work with old serial
> port names, that's a bad bug on its part.
> 
> good luck,
> 
> greg k-h


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux