View previous topic :: View next topic |
Author |
Message |
dargosch Tux's lil' helper
Joined: 21 Aug 2003 Posts: 101
|
Posted: Fri Feb 02, 2007 12:09 pm Post subject: How do I create serial devices automatically? |
|
|
Hi,
I have a problem with automatically creating serial port devices. I used to have this problem:
Code: |
theodor dev # ls ttyS* -al
lrwxrwxrwx 1 root root 5 26 jan 09.09 ttyS0 -> tts/0
lrwxrwxrwx 1 root root 5 26 jan 09.09 ttyS1 -> tts/1
lrwxrwxrwx 1 root root 5 26 jan 09.09 ttyS2 -> tts/2
lrwxrwxrwx 1 root root 5 26 jan 09.09 ttyS3 -> tts/3
theodor dev # ls tts/* -al
lrwxrwxrwx 1 root root 8 26 jan 09.09 tts/0 -> ../ttyS0
lrwxrwxrwx 1 root root 8 26 jan 09.09 tts/1 -> ../ttyS1
lrwxrwxrwx 1 root root 8 26 jan 09.09 tts/2 -> ../ttyS2
lrwxrwxrwx 1 root root 8 26 jan 09.09 tts/3 -> ../ttyS3
|
which is no good for syncing my old serial palm pilot. Now, I have found that I may correct the situation by doing this:
Code: |
theodor ~ # rm /dev/tts/0
theodor ~ # /bin/mknod /dev/tts/0 c 4 64
theodor ~ # chmod 777 /dev/tts/0
theodor ~ # ls -al /dev/pilot0 /dev/tts/* /dev/ttyS*
lrwxrwxrwx 1 root root 5 2 feb 08.44 /dev/pilot0 -> ttyS0
crwxrwxrwx 1 root root 4, 64 2 feb 11.50 /dev/tts/0
lrwxrwxrwx 1 root root 8 2 feb 08.44 /dev/tts/1 -> ../ttyS1
crwxrwxrwx 1 root root 4, 64 30 jan 11.58 /dev/tts/10
lrwxrwxrwx 1 root root 8 2 feb 08.44 /dev/tts/2 -> ../ttyS2
lrwxrwxrwx 1 root root 8 2 feb 08.44 /dev/tts/3 -> ../ttyS3
lrwxrwxrwx 1 root root 5 2 feb 08.44 /dev/ttyS0 -> tts/0
lrwxrwxrwx 1 root root 5 2 feb 08.44 /dev/ttyS1 -> tts/1
lrwxrwxrwx 1 root root 5 2 feb 08.44 /dev/ttyS2 -> tts/2
lrwxrwxrwx 1 root root 5 2 feb 08.44 /dev/ttyS3 -> tts/3
|
Now everything works, and kpilot happily reports that
Code: |
11:49:50 Trying to open device /dev/pilot0...
11:49:50 Device link ready.
|
and I can sync. Now, the problem is.. how do I do this in UDEV? I'll need to
- Create the device node at /dev/tts/0
- Change the permissions so that it is writable
How do I do this?
/Fredrik _________________ Registered Linux user #163029 http://counter.li.org/
My Gentoo + PVR-350 + IVTV + MythTV blog is on
http://gentoomythtv.blogspot.com/ |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Fri Feb 02, 2007 12:24 pm Post subject: |
|
|
do you have any ttyUSB entries in dev? you might want to try those... but in any case the file you want is /etc/udev/rules.d/50-rules-something-or-other... and you'll want to make it have either users group permission or usb users group, and add yourself to the appropriate group.
cheers _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
dargosch Tux's lil' helper
Joined: 21 Aug 2003 Posts: 101
|
Posted: Fri Feb 02, 2007 12:30 pm Post subject: |
|
|
bunder wrote: | do you have any ttyUSB entries in dev? you might want to try those... but in any case the file you want is /etc/udev/rules.d/50-rules-something-or-other... and you'll want to make it have either users group permission or usb users group, and add yourself to the appropriate group.
cheers |
Thank you for your quikc reply.
However, I fail to see what USB has to do with it? Do you mean to say that the old-school serial ports have been misstaken for USB ports?
/Fredrik _________________ Registered Linux user #163029 http://counter.li.org/
My Gentoo + PVR-350 + IVTV + MythTV blog is on
http://gentoomythtv.blogspot.com/ |
|
Back to top |
|
|
_MacBaum_ n00b
Joined: 15 Oct 2006 Posts: 17
|
Posted: Fri Feb 02, 2007 1:33 pm Post subject: |
|
|
You can somehow (somehow is depending on your udev-version) create nodes automatically with VendorID and ProductID (get ids with lsusb)
or Bus-topology (does the Palm somehow identify himself as a "unique item"?).
I want to write some rules to fix my USB-Devices to constant nodes.
Perhaps this helps:
http://www.reactivated.net/writing_udev_rules.html
Last edited by _MacBaum_ on Fri Feb 02, 2007 1:36 pm; edited 1 time in total |
|
Back to top |
|
|
_MacBaum_ n00b
Joined: 15 Oct 2006 Posts: 17
|
Posted: Fri Feb 02, 2007 1:36 pm Post subject: |
|
|
Note to self: Learn to klick the mouse.
Please delete. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Feb 02, 2007 1:50 pm Post subject: |
|
|
dargosch wrote: | old-school serial ports |
That makes it a bit more interesting. Here's my USB Palm setup.
I expect that udev "wakes up" and creates the devices only during a hotsync, as with USB. So, put udev into debugging mode and check its logs. |
|
Back to top |
|
|
_MacBaum_ n00b
Joined: 15 Oct 2006 Posts: 17
|
Posted: Fri Feb 02, 2007 1:56 pm Post subject: |
|
|
PaulBredbury wrote: |
I expect that udev "wakes up" and creates the devices only during a hotsync, as with USB. So, put udev into debugging mode and check its logs. |
Try udevstart |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Feb 02, 2007 2:07 pm Post subject: |
|
|
_MacBaum_ wrote: | Try udevstart |
Why? Udev is always running as a daemon. The intention is to notice the Palm in udev's logs, so that a udev rule for it can be written. |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Fri Feb 02, 2007 11:59 pm Post subject: |
|
|
dargosch wrote: | bunder wrote: | do you have any ttyUSB entries in dev? you might want to try those... but in any case the file you want is /etc/udev/rules.d/50-rules-something-or-other... and you'll want to make it have either users group permission or usb users group, and add yourself to the appropriate group.
cheers |
Thank you for your quikc reply.
However, I fail to see what USB has to do with it? Do you mean to say that the old-school serial ports have been misstaken for USB ports?
/Fredrik |
i believe they use the same driver. the s in usb does stand for serial. _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
|