On Tue, Feb 17, 2009 at 9:14 PM, Bryan Smith <[email protected]> wrote:
> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > The rules were create to make a symlink that would be unique and totally > distinguishable by the user. YOUR rules actually make a symlink that > looks almost identical to the original device. If you plug a device into > port 3-1, 1 device and 1 symlink will be made, ttyACM0 and ttyACM2. You > have both which look identical and is highly undesirable, hence me > telling you to use ttyNOKIA0-2. When you plug in port 3-2(which is > defined in rules to be ttyACM0), things get confusing because > ttyACM0 is already made(its your fault). Don't grep dmesg, because it > won't report anything about the symlink udev made. Just ls /dev/tty* > That's the part I overlooked. I continued to use the same symlink.. LOL. I get it now. > > Don't use the ACM device, it's merely a reference point now. Things are > working as they should because you disregarded my advice on the ttyNOKIA > symlink, LOL. Change the symlinks in Kannel to ttyNOKIA0-2 and change your > rules. > I checked the output from 'lsusb -v ' and sure enough, there's no iSerial for the phones. Those iSerials were default. > Those serials look more like poorly reported(blame the hardware) serials > to me, in which the first method wouldn't work. The whole point of using > the iSerials is to disregard which serial belongs to which device, as > long as they are all the same model. How about a pastebin of the lspci > - -v and > udevinfo -a -p $(udevinfo -q path -n /dev/ttyACM0) > Will work on it again. > > Plug in 1 device at a time then repeat the udevinfo command above. > > Revert to this > > # /dev/ttyACM0, > SUBSYSTEMS=="usb", ID=="3-2:1.1", KERNEL=="ttyACM[0123]", > SYMLINK+="ttyNOKIA0" > > That means check usb at port 3-2 and if the kernel finds a ttyACM device > that ends in range 0-3, make a symlink to that device as ttyNOKIA0. This > makes a link, to the ttyACM0-3 device, which you ignore and use your > distinct ttyNOKIA link. You shouldn't have to do a special dance or plug > them in with any specific order for this to work. Dance when its all > done and working. > > Bryan > > hard wyrd wrote: > | I have tested Bryan's suggestions (err tutorial) and here are my > | observations. > | > | Indeed, I get iSerials from my phone devices connected to my Ubuntu box: > | > | r...@smsc:/etc/udev/rules.d# lsusb -v | grep iSerial > | iSerial 1 0000:00:13.1 > | iSerial 0 > | iSerial 1 0000:00:13.0 > | iSerial 1 0000:00:13.2 > | > | > | However, I'm not sure which iSerial belongs to which phone (yeah yeah, > | an instantiation of noobish regression). So I proceeded to the next > | option of using the ID instead of ATTR parameter. > | > | # /dev/ttyACM0, > | SUBSYSTEMS=="usb", ID=="3-2:1.1", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyACM0" > | > | # /dev/ttyACM1, > | SUBSYSTEMS=="usb", ID=="2-2:1.1", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyACM1" > | > | # /dev/ttyACM2, > | SUBSYSTEMS=="usb", ID=="3-1:1.1", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyACM2" > | > | > | Stopped my Kannel (just in case), unplugged the devices, then restarted > | UDEV. > | > | I then proceeded in checking if indeed the devices get assigned the > | correct symlink. > | > | PLUGGED "ttyACM1" device without other devices plugged in : > | > | r...@smsc:/etc/udev/rules.d# dmesg | grep ttyACM > | [355247.366823] cdc_acm 2-2:1.1: ttyACM0: USB ACM device > | > | Removed "ttyACM1" device, and plugged "ttyACM2" device: > | > | r...@smsc:/etc/udev/rules.d# dmesg | grep ttyACM > | [355247.366823] cdc_acm 2-2:1.1: ttyACM0: USB ACM device > | [355317.549674] cdc_acm 3-1:1.1: ttyACM0: USB ACM device > | > | Removed "ttyACM2" device, and plugged "ttyACM0" device: > | > | r...@smsc:/etc/udev/rules.d# dmesg | grep ttyACM > | [355247.366823] cdc_acm 2-2:1.1: ttyACM0: USB ACM device > | [355317.549674] cdc_acm 3-1:1.1: ttyACM0: USB ACM device > | [355348.800105] cdc_acm 3-2:1.1: ttyACM0: USB ACM device > | > | > | However, I noticed that if there are no other devices connected, the > | device will be given ttyACM0 - regardless. But then again, Bryan is also > | right, that the device will be able to receive the correct symlink > | regardless of which USB port it is connected in. But I had to make sure > | that I connect the devices in the _proper_ order! > | > | I tested this out again by connecting the "ttyACM0" device to a > | randomly-selected USB port, and yes, it got the correct symlink -- > | "ttyACM0". I proceeded in plugging the other devices in exact order but > | not necessary which USB port they're connected in. > | > | r...@smsc:/etc/udev/rules.d# dmesg | grep ttyACM > | [355348.800105] cdc_acm 3-2:1.1: ttyACM0: USB ACM device > | [355247.366823] cdc_acm 2-2:1.1: ttyACM1: USB ACM device > | [355317.549674] cdc_acm 3-1:1.1: ttyACM2: USB ACM device > | > | So far it works, but with just a little twist than what I originally > | intended. Connecting the devices in exact order is just a minor > | nuisance. Hope this will be useful to somebody. > | > | (NOTE TO BRYAN: Is it OK to publish your steps (unedited) into my blog > | as a supplement to my test results? ) > | > | Best regards! > | > | > | > | ---------- Forwarded message ---------- > | From: *Bryan Smith* <[email protected] > <mailto:[email protected]>> > | Date: Thu, Feb 12, 2009 at 8:10 PM > | Subject: [lug:14112] Re: Permanently associate a device file to a USB > port > | To: [email protected] > | <mailto:[email protected]> > | > | > | > | -----BEGIN PGP SIGNED MESSAGE----- > | Hash: SHA1 > | > | udev rules need to be made, but there are more than 3 ways to tackle > | this. udev can create rules from certain device strings so there could > | be rules made for the manufacturer of the device, but they are all the > | same. The next choice is to make a rule the devices themselves ignoring > | the ports, which would allow you to plug the little boogers in anywhere > | and get the correct symlink. This is by a serial number that the device > | reports, but not all devices report serials. > | > | Next is your idea of choosing to assign links to ports, which is not a > | bad idea, but what if you plug a device other than your phone into a > | port that is setup just for your phones...things won't work as they > | should. I think its best to get a serial from each phone. > | > | With all 3 devices plugged in do this: > | lsusb -v | grep iSerial > | > | It might show something like this: > | iSerial 1 ABCDEFG123 > | iSerial 1 BCDEFG1234 > | iSerial 1 CDEFG12345 > | > | If so then put the lines below in a file named > | /etc/udev/rules.d/10-local.rules > | > | # /dev/ttyACM0, > | SUBSYSTEMS=="usb", ATTRS{serial}=="ABCDEFG123", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyNOKIA0" > | > | # /dev/ttyACM1, > | SUBSYSTEMS=="usb", ATTRS{serial}=="BCDEFG1234", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyNOKIA1" > | > | # /dev/ttyACM2 > | SUBSYSTEMS=="usb", ATTRS{serial}=="CDEFG12345", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyNOKIA2" > | > | > | The examples above match 3 conditions, though you could easily get away > | with just this : > | > | SUBSYSTEMS=="usb", ATTRS{serial}=="ABCDEFG123", SYMLINK+="ttyNOKIA0" > | > | Next: > | /etc/init.d/udev restart > | > | YOU MUST UNPLUG THE DEVICES THEN REINSERT THEM FOR THIS TO WORK > | > | Now go into your program and set it for ttyNOKIA0-2 and you should never > | have to worry about this again. Use the custom symlink because it is > | bound to the phones serial, whereas udev will still create the > | incremented ttyACM* device. You can plug the device in the front, back, > | side,usb hub or what ever. There will never be an issue with just those > | 3 phones. > | > | If you get no iSerials: > | > | Unplug the phones > | Run udevmonitor IF it's still available on your Ubuntu system...it > | disappeared on Debian so if you don't have it run udevadm --monitor > | Now plug them in...one at a time noting the dev file path fore each port. > | > | My laptop port 1 and 2 on Debian look like this: > | /devices/pci0000:00/0000:00:1f.2/usb1/1-1/1-1:1.0 > | /devices/pci0000:00/0000:00:1f.2/usb1/1-2/1-2:1.0 > | > | You want the last bit, such as 1-1:1.0 > | Here are the rules to use if the iSerials don't show: > | > | # /dev/ttyACM0, > | SUBSYSTEMS=="usb", ID=="1-1:1.0" KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyNOKIA0" > | > | # /dev/ttyACM1, > | SUBSYSTEMS=="usb", ID=="1-2:1.0", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyNOKIA1" > | > | # /dev/ttyACM2 > | SUBSYSTEMS=="usb", ID=="1-3:1.0", KERNEL=="ttyACM[0123]", > | SYMLINK+="ttyNOKIA2" > | > | Replace those ID's with the correct ones on your server, restart udev, > | reinsert your devices and you're cooking with grease. > | > | > | Additional reading: > | http://www.reactivated.net/writing_udev_rules.html > | > | man udev...its actually not a bad man page > | > | > | Bryan > | > | > | > | > | > | -- > | Part-time SysAd, full-time Dad, part-time netNinja > | CNS, ACFE, FOSS Advocate and Consultant > | Registered Linux User #400165 > | http://baudizm.blogsome.com > | http://linuxblazon.wordpress.com > | http://3x-comic.blogspot.com (NEW!) > | > | | > > - -- > A healthy diet includes Linux, Linux and more Linux. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkmauCYACgkQh+MLjl5SKYRJMACeN2VZuc/fIZUjionJ3tZ5VNLt > XTAAnjo8EDTb6u/TcMvgD7t8j4wyIVmZ > =6JDn > -----END PGP SIGNATURE----- > > > > -- Part-time SysAd, full-time Dad, part-time netNinja CNS, ACFE, FOSS Advocate and Consultant Registered Linux User #400165 http://baudizm.blogsome.com http://linuxblazon.wordpress.com http://3x-comic.blogspot.com (NEW!) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
