Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save walidamriou/cfd92d6ba35763920a278314839ae22b to your computer and use it in GitHub Desktop.
Save walidamriou/cfd92d6ba35763920a278314839ae22b to your computer and use it in GitHub Desktop.
Fix PlatformIO [Errno 13] Permission denied: '/dev/ttyUSB0' with Linux

The problem: " Traceback (most recent call last): File "/home/../.platformio/penv/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

"

Open the terminal and write:
sudo chmod a+rw /dev/ttyUSB0

@YiangG
Copy link

YiangG commented May 27, 2022

Worked for me! Thank you!

@gustavors1608
Copy link

muito obrigado, funcionou para mim também

@Lissanro
Copy link

Just running chmod for a specific device is a temporary workaround. The proper and permanent solution is to install PlatformIO udev rules by running the following command:

curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules > /dev/null

@SurgeonsLab20
Copy link

Works great, thanks

@helderjnpinto
Copy link

@AnaMarcacini
Copy link

Works great, thanks

@gorandp
Copy link

gorandp commented Mar 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment