OSError: [Errno 13] Permission denied: '/dev/ttyACM0' - using pyserial from Python to Arduino

前端 未结 2 1973
被撕碎了的回忆
被撕碎了的回忆 2021-02-06 03:53

Environment

  • Linux Mint 17.1
  • Python 2.7
  • pyserial 2.7
  • Arduino UNO rv3

Desired Behaviour

2条回答
  •  执笔经年
    2021-02-06 04:38

    The permissions on the file make no difference to the user that the program runs as

    When you are logged in interactively you do have permission to use the /dev/ttyACM0

    When your script is running (presumably as the apache user) it does not have permission

    You need to alter the permissions on the /dev/ttyACM0

    See the 2nd answer here How can I programmatically set permissions on my char device for an example of altering udev permissions so the file has the correct permissions

提交回复
热议问题