You are not logged in.

#1 2014-03-15 12:36:15

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

[SOLVED] How to set non-root access to serial ports?

I have this device which is listed as

/dev/ttyUSB0

I need to

sudo chown sms /dev/ttyUSB0

every time I reboot. Normally I would think to add myself to some group but "tty" group is not doing the trick... proof:

[sms@sms-linux ~]$ groups sms
tty wheel sms
[sms@sms-linux ~]$ MinOZW
Starting MinOZW with OpenZWave Version 1.0.758
2014-03-15 06:32:07.921 Cannot find a path to the configuration files at ../../../config/, Using /usr/local/etc/openzwave/ instead...
2014-03-15 06:32:07.928 mgr,     Added driver for controller /dev/ttyUSB0
2014-03-15 06:32:07.929   Opening controller /dev/ttyUSB0
2014-03-15 06:32:07.931 Trying to open serial port /dev/ttyUSB0 (attempt 1)
2014-03-15 06:32:07.933 ERROR: Cannot open serial port /dev/ttyUSB0. Error code 13
2014-03-15 06:32:07.935 ERROR: Failed to open serial port /dev/ttyUSB0
2014-03-15 06:32:07.936 WARNING: Failed to init the controller (attempt 0)
^C
[sms@sms-linux ~]$ sudo MinOZW
[sudo] password for root: 
Starting MinOZW with OpenZWave Version 1.0.758
2014-03-15 06:32:23.776 Cannot find a path to the configuration files at ../../../config/, Using /usr/local/etc/openzwave/ instead...
2014-03-15 06:32:23.782 mgr,     Added driver for controller /dev/ttyUSB0
2014-03-15 06:32:23.784   Opening controller /dev/ttyUSB0
2014-03-15 06:32:23.786 Trying to open serial port /dev/ttyUSB0 (attempt 1)
2014-03-15 06:32:23.794 Serial port /dev/ttyUSB0 opened (attempt 1)

Edit: yes, it was after logout and even reboot. smile

Last edited by smsware (2014-03-15 15:07:15)

Offline

#2 2014-03-15 13:11:08

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: [SOLVED] How to set non-root access to serial ports?

check what permissions does it have

Offline

#3 2014-03-15 13:26:12

longcao
Member
Registered: 2013-10-28
Posts: 15

Re: [SOLVED] How to set non-root access to serial ports?

IIRC, serial ports belong to group uucp in Arch Linux.

Offline

#4 2014-03-15 15:07:01

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

Re: [SOLVED] How to set non-root access to serial ports?

longcao wrote:

IIRC, serial ports belong to group uucp in Arch Linux.

It was it, thank you.

Offline

#5 2014-06-23 19:54:58

manjaro
Member
Registered: 2014-06-23
Posts: 2

Re: [SOLVED] How to set non-root access to serial ports?

Hi,

I also have a similar problem. I added myself to uucp group, but I still cannot access the serial port.

[manjaro@mycomp work]$ sudo gpasswd -a manjaro uucp
[sudo] password for manjaro: 
Adding user manjaro to group uucp

[manjaro@mycomp work]$ groups manjaro
lp wheel uucp network video audio storage users

[manjaro@mycomp work]$ ls -l /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 23.06.2014 21:32 /dev/ttyUSB0

[manjaro@mycomp work]$ lpc21isp firmware.hex /dev/ttyUSB0 19200 11059
lpc21isp version 1.97
File firmware.hex:
    loaded...
Start Address = 0x00004F9C
    converted to binary format...
    image size : 30304
Image size : 30304
Can't open COM-Port /dev/ttyUSB0 ! (Error: 13d (0xD))

But when I try as root, it works:

[manjaro@mycomp work]$ sudo lpc21isp firmware.hex /dev/ttyUSB0 19200 11059
[sudo] password for manjaro: 
lpc21isp version 1.97
File firmware.hex:
    loaded...
Start Address = 0x00004F9C
    converted to binary format...
    image size : 30304
Image size : 30304
Synchronizing (ESC to abort)..... OK
Read bootcode version: 13
[...]
Download Finished... taking 27 seconds
Now launching the brand new code

Do you have any idea what I am doing wrong?

Last edited by manjaro (2014-06-23 19:57:40)

Offline

#6 2014-06-23 22:05:39

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED] How to set non-root access to serial ports?

Manjaro, first, let me ask.  Are you using Manjaro?  If so, please ask on their forums -- they know the idiosyncrasies of their distribution; we do not.
Did you log out and back in?  What is the output of groups  ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2014-06-24 19:43:49

manjaro
Member
Registered: 2014-06-23
Posts: 2

Re: [SOLVED] How to set non-root access to serial ports?

Thank you ewaller for your help. It was only that I did not log out and log back in. Now it works as expected.

Offline

Board footer

Powered by FluxBB