Skip to content

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

Open

Description

@tompreston

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.

Activity

  1. mahesh-sankaraiah commented on May 29, 2018

    @mahesh-sankaraiah

    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

  2. Alisa1989 commented on Aug 22, 2018

    @Alisa1989

    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.
  3. mpendwavivi commented on Feb 18, 2019

    @mpendwavivi

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions