Skip to content

SerialException: Could not open port /dev/ttyS0 [Errno 13] Permission denied: '/dev/ttyS0' #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tompreston opened this issue Jun 6, 2016 · 3 comments

Comments

@tompreston
Copy link
Contributor

tompreston commented Jun 6, 2016

Picture of the issue: https://twitter.com/sezzyann72/status/739477225637052416

It looks like permissions on /dev/ttyS0 are not set up correctly. When you type:

ls -l /dev/ttyS0

You should get the following readout:

crw-rw---- 1 root dialout 4, 64 Jun  6 10:56 /dev/ttyS0

Also,

groups

should return:

pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi

The important group to have is dialout.

This error can usually be fixed with:

sudo apt-get update
sudo apt-get upgrade

I'm opening this issue for discussion.

@mahesh-sankaraiah
Copy link

I have updated and upgraded still it is showing
Traceback (most recent call last):
File "serial_read.py", line 11, in
timeout=1
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in init
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyS0: [Errno 2] No such file or directory: ' /dev/ttyS0'
this error what i need to do

@Alisa1989
Copy link

I had the same problem, make sure that serial port communication is enabled :)

sudo raspi-config
then

  • 5 Interfacing Options
  • P6 Serial.
    Select NO to Would you like a login console...
    Select YES to Would you like the serial port hardware ...
    It will then show
    The serial login shell is disabled
    The serial interface is enabled
  • Ok
  • Finish
  • Reboot - Yes.

@mpendwavivi
Copy link

thank you alisa, it has worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants