You are not logged in.

#1 2012-07-13 16:01:45

0x000000
Member
Registered: 2011-11-23
Posts: 57

Picocom permission denied when opening serial port

Kernel 3.4.4-2, Picocom 1.7-1

# picocom -b 57600 /dev/ttyUSB0
picocom v1.7

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 57600
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,


FATAL: cannot lock /dev/ttyUSB0: Permission denied
# ll /run/lock
total 4
drwxrwxr-x 2 root lock 40 Jul 13 11:15 lockdev
drwxr-xr-x 2 root root 40 Jul 13 11:15 lvm
-rw-r--r-- 1 root root  4 Jul 13 11:15 slim.lock
drwxr-xr-x 2 root root 40 Jul 13 11:15 subsys

I'm in the lock group. I'd previously tried to change /run/lock/lockdev to group lock and group writable, which seemed to work once. What's going on? I'd prefer not to use the --nolock option. I suppose it's worth noting that /var/lock is a symlink to /run/lock.

Offline

#2 2012-07-13 23:49:26

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,461

Re: Picocom permission denied when opening serial port

I think you may need to check to see if you are in the permission group for /dev/ttyUSB0


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2012-07-14 15:32:01

0x000000
Member
Registered: 2011-11-23
Posts: 57

Re: Picocom permission denied when opening serial port

I'm 99% sure it's picocom. I can open the serial port using `cu` or from a Python script without a problem. Additionally, this seems to have started in the past month or so.

Offline

#4 2012-07-25 17:24:09

0x000000
Member
Registered: 2011-11-23
Posts: 57

Re: Picocom permission denied when opening serial port

picocom tries to put a lock file in /run/lock:

# ll /run
...
drwxr-xr-x 5 root   root    120 Jul 25 10:21 lock
...

If I set the group of /run/lock to lock and set it group writable, it works, but doesn't persist after reboot.

So is it picocom's fault or whatever sets the perms of /run/lock on boot?

Offline

#5 2012-07-25 21:41:51

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,487

Re: Picocom permission denied when opening serial port

drwxr-xr-x 5 root root  100 Jul 23 09:15 lock

kind of like this:

[ewaller@matrix latex]$ picocom /dev/ttyS0
picocom v1.7

port is        : /dev/ttyS0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,


FATAL: cannot lock /dev/ttyS0: Permission denied
[ewaller@matrix latex]$ 

I think you should file a bug report.  There are no bugs pending against picocom at this time


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#6 2012-07-25 21:44:57

0x000000
Member
Registered: 2011-11-23
Posts: 57

Re: Picocom permission denied when opening serial port

I would almost feel bad filing a bug report.

Offline

#7 2012-07-25 22:09:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,487

Re: Picocom permission denied when opening serial port

0x000000 wrote:

I would almost feel bad filing a bug report.

It is a great way to get involved and help. smile


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#8 2025-09-03 09:01:21

Wiktorro
Member
Registered: 2025-09-03
Posts: 1

Re: Picocom permission denied when opening serial port

0x000000 wrote:

picocom tries to put a lock file in /run/lock:

# ll /run
...
drwxr-xr-x 5 root   root    120 Jul 25 10:21 lock
...

If I set the group of /run/lock to lock and set it group writable, it works, but doesn't persist after reboot.

So is it picocom's fault or whatever sets the perms of /run/lock on boot?

I know it's a late response but had same problem and found fix, you need to add your user to group dialout,
makes effect on whole picocom app, for all ports

sudo usermod -a -G dialout <user>

confirm it with `id <user>` (should have like 20(dialout) ) and enjoy time connecting to device smile

Last edited by Wiktorro (2025-09-03 09:10:04)

Offline

#9 2025-09-03 10:10:49

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,424
Website

Re: Picocom permission denied when opening serial port

Mod note: Please refrain from necro-posting. Closing this ancient thread.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

Board footer

Powered by FluxBB