[PLUG] Actions after a USB device is plugged in

Rich Shepard rshepard at appl-ecosys.com
Wed Oct 15 15:52:03 UTC 2008


On Wed, 15 Oct 2008, Roderick A. Anderson wrote:

> We were able to soft link and get the software to see and use it but it
> appears Ubuntu cleans out the /dev directory entries either during
> shutdown, startup, or when the USB-to-serial device is removed. The link
> didn't last between reboots. So for now he opens a terminal, sudo to root,
> and creates the link each time he boots.

Rod,

   It ain't unique to Ubuntu. It took me a while to grok the differences when
I switched from my Kyocera smartphone and its serial charging/data
connection to the Treo with its USB data connection.

   The USB connection is created when the device is attached and the button
on the cable is pressed, and destroyed when the device is removed.
Unfortunately, softlinks fail because they point to a specific /dev/ttUSB.
Here's a session from /var/log/messages:

Oct 15 08:47:42 salmo kernel: usb 1-1: new full speed USB device using
ohci_hcd and address 65
Oct 15 08:47:42 salmo kernel: usb 1-1: configuration #1 chosen from 1 choice
Oct 15 08:47:42 salmo kernel: visor 1-1:1.0: Handspring Visor / Palm OS
converter detected
Oct 15 08:47:42 salmo kernel: usb 1-1: Handspring Visor / Palm OS converter
now attached to ttyUSB0
Oct 15 08:47:42 salmo kernel: usb 1-1: Handspring Visor / Palm OS converter
now attached to ttyUSB1
Oct 15 08:47:43 salmo kernel: usb 1-1: USB disconnect, address 65
Oct 15 08:47:43 salmo kernel: visor ttyUSB0: Handspring Visor / Palm OS
converter now disconnected from ttyUSB0
Oct 15 08:47:43 salmo kernel: visor ttyUSB1: Handspring Visor / Palm OS
converter now disconnected from ttyUSB1
Oct 15 08:47:43 salmo kernel: visor 1-1:1.0: device disconnected

   Why it always generates two devices I don't know. Perhaps each one is
monodirectional.

> Is there a way to automagically run a script or command (ln -sf
> /dev/ttyUSB0 /dev/ttyS3) after the USB-to-serial device is plugged in?

   The answer to this is above my pay grade; I don't know. I do specify
/dev/tts/USB1 in the jpilot port setting and it seems to Just Work.

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863



More information about the PLUG mailing list