Accessing serial-usb ports

phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org
Sat Aug 12 03:31:13 UTC 2006


USB ports are complex to access in software so people have developed
hardware and software to access USB ports as serial ports. These serial
port devices have names like /dev/ttyUSB0 and conveniently the drivers are
built into the kernel since 2.4. We used this extensively in our Tcl
software that drives our scope and signal generator. The software simply
treats these ports as serial ports, which Tcl can access. (At the other
end of the cable there is a hardware integrated circuit that reconverts
the USB protocol into asynchronous serial data. So the whole USB protocol
can be ignored.)

A Linux serial-usb port is created when you plug in a USB device, and
disappears when you unplug the device. Unfortunately, the port is created
as owned by root and the read and wite permissions are disabled for
ordinary users. Consequently, if you operate in user mode you have to
become root and change these permissions every time a device is plugged
and unplugged, or when you reboot.

This gets old fast, so we need a better solution than manual intervention.
In my Suse Linux, a long-listing shows that the 'uucp' group has access to
the device. I'm therefore proposing that users of this software simply add
themselves as members of the uucp group. This seems to work fine, but I
wonder if there are other unpleasant side-effects that might result.

I would welcome some comments on this approach - does it create security
holes, for example? And pointers to alternative approaches would be
welcome.

Peter


-- 
Peter Hiscocks
Syscomp Electronic Design Limited, Toronto
http://www.syscompdesign.com
USB Oscilloscope and Waveform Generator
647-839-0325

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list