1

I am trying to access a serial device, which is attached as: "/dev/ttyUSB0".

crw-rw---- 1 root dialout 188, 0 Nov 29 15:45 ttyUSB0

For that I created a new udev rule:

SUBSYSTEM=="tty", ATTR{idVendor}=="1a86", ATTR{idProduct}=="7523", SYMLINK+="ttyPWM0", MODE="0666"

So I get the following file:

lrwxrwxrwx 1 root root 7 Nov 29 15:45 ttyPWM0 -> ttyUSB0

If I try to access it with echo, I get the following message. The same problem is with sudo:

$echo "hello" >> ttyPWM0
bash: ttyPWM0: Permission denied

My Question is: how can I access this file as normal user? I need to run a program with access granted to it. I don't to add my account to dialout, because I know there is a way without doing this security hole.


I have a device of SalaeLogic. For this device, there is a script:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0925", ATTR{idProduct}=="3881", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1001", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1003", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1004", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1005", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1006", MODE="0666"

With this rule(s), I can start the program and access the device without any other action needed. The same I would like to achieve.... but how?

1 Answer 1

-1

My solution meanwhile:

SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE="0666", SYMLINK+="ttyPWM0"
1
  • 1
    we are expecting answer to be in english, and with some explanation, not just a mere line of code.
    – Archemar
    Nov 29, 2015 at 19:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .