Page 1 of 1

/dev/ttyUSB0,1,2 force a device

Posted: Fri Dec 07, 2007 5:22 pm
by Kroonen
I have some trouble with the ttyUSB ports. If I do a reboot or sometimes I poweroff, the ttyUSB ports are different, the ttyusb for rfxcom, heyu, and 1-wire are than different. Can you force it like for example in a modprobe.conf???

/dev/ttyUSB0,1,2 force a device

Posted: Fri Dec 07, 2007 5:41 pm
by Snelvuur
Good question, although i never had this issue. Do you have an usb in between? or just all on a different port?

// Erik (binkey.nl)

/dev/ttyUSB0,1,2 force a device

Posted: Fri Dec 07, 2007 8:56 pm
by Kroonen
Have three use on lapotp, 2 on docking and one not. But als busy with more ports, so with usbhub, and that#347; also terribl, so it should be nice to define them so it works always ok.

/dev/ttyUSB0,1,2 force a device

Posted: Fri Dec 07, 2007 11:06 pm
by Snelvuur
Did you take a look at "hotplug" ? Also, i know you can for instance for a usb device to come up always the same if its storage like:

UUID=ca982c63-6358-4a57-a6ae-2686768997f1 / ext3 defaults,errors=

So there is bound a way to do it, but dont know how to search it on google.. "usb/reboot/device" etc gives too much hits hehe.



// Erik (binkey.nl)

/dev/ttyUSB0,1,2 force a device

Posted: Sun Dec 09, 2007 10:37 am
by Kroonen
it should be done with udev, in /etc/udev dir. it is not easy, but i searching for it

/dev/ttyUSB0,1,2 force a device

Posted: Sun Feb 10, 2008 10:27 am
by beanz
I created a file /etc/udev/rules.d/50-ttyUSB.rules which contains lines like these two:

BUS=="usb",SYSFS{idProduct}=="6001",SYSFS{idVendor}=="0403",SYSFS{serial}=="A4001XXX",SYMLINK="rfxcom-rx"
BUS=="usb",SYSFS{idProduct}=="6001",SYSFS{idVendor}=="0403",SYSFS{serial}=="A5001YYY",SYMLINK="rfxcom-tx"

where the SYSFS{*} values are taken from the output of commands like:

udevinfo -a -p `udevinfo -q path -n /dev/ttyUSB0`

This causes udev to create symlinks in /dev for rfxcom-rx and rfxcom-tx pointing to the dynamically assigned devices.

Re: /dev/ttyUSB0,1,2 force a device

Posted: Sun Jul 01, 2012 11:52 am
by vossie
A little bit late but maybe helpfull for somone else.
here is my /etc/udev/rules.d/62-usbserial.rules (i am using fedora 16)

Code: Select all

SUBSYSTEM=="tty" ATTRS{idVendor}=="0403" ATTRS{idProduct}=="c850" ATTRS{serial}=="DEORA98A" OWNER="nico" GROUP="users" SYMLINK+="dmxcontr" MODE="0777"
SUBSYSTEM=="tty" ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ATTRS{serial}=="A4004nGU" OWNER="nico" GROUP="users" SYMLINK+="rfxcom"
SUBSYSTEM=="tty" ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ATTRS{serial}=="A2003F6l" OWNER="nico" GROUP="users" SYMLINK+="plugwise"
SUBSYSTEM=="tty" ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ATTRS{serial}=="FTVJWQQZ" OWNER="nico" GROUP="users" SYMLINK+="smeter"
SUBSYSTEM=="tty" ATTRS{idVendor}=="067b" ATTRS{idProduct}=="2303" OWNER="nico" GROUP="ysers" SYMLINK+="gsmmodem"

Re: /dev/ttyUSB0,1,2 force a device

Posted: Wed Apr 23, 2014 4:13 pm
by Borgso
Sorry for necro topic, but some extra info around this problem:

On boot its first come, first served what USBTTY number device get.
And its not fixed what devices get detected first by the usb controller.

Atleast on Ubuntu you can find the full path if you type "ls -ld /dev/serial/by-id/*" in shell
This will give you something like this:

Code: Select all

$ ls -ld /dev/serial/by-id/*
lrwxrwxrwx 1 root root 13 Apr  9 22:28 /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AH01xxxx-if00-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root 13 Apr  9 22:28 /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Xxxxxx-if00-port0 -> ../../ttyUSB0
This path does not change on reboot,unplug etc. It also contains serialnumber on the USB device.
If you reconnect device after booted, you may need to disable/enable device in domotiga.