Skip to content
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

Permission Denied When Uploading Program on Pop!_OS (Arduino IDE 2.3.2) #2494

Closed
3 tasks done
Arthur-Barreto opened this issue Aug 21, 2024 · 1 comment
Closed
3 tasks done
Assignees
Labels
conclusion: off topic Off topic for this repository type: imperfection Perceived defect in any part of project

Comments

@Arthur-Barreto
Copy link

Arthur-Barreto commented Aug 21, 2024

Describe the problem

After installing the latest version of the Arduino IDE (2.3.2) on Pop!_OS, I encountered a "Permission Denied" error while trying to upload the Blink example code to the built-in LED on my Arduino device. The error message is as follows:

Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
Failed uploading: uploading error: exit status 1

To reproduce

  1. Download and install Arduino IDE version 2.3.2 on a system running Pop!_OS.
  2. Open the Blink example code from the IDE.
  3. Attempt to upload the code to an Arduino UNO board

Expected behavior

The upload should fail with a "Permission Denied" error, as shown in the error message above.

Arduino IDE version

2.3.2

Operating system

Linux

Operating system version

22.04

Additional context

The issue can be resolved by adding the current user to the dialout group, which grants the necessary permissions to access the serial port. Run the following command in the terminal:

sudo usermod -aG dialout $USER

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@Arthur-Barreto Arthur-Barreto added the type: imperfection Perceived defect in any part of project label Aug 21, 2024
@per1234 per1234 self-assigned this Aug 21, 2024
@per1234
Copy link
Contributor

per1234 commented Aug 21, 2024

Hi @Arthur-Barreto. As you already discovered, this was caused by your Linux user account not having write permission for the device.

Arduino IDE is a general purpose tool that is designed to be used with any of the ever growing thousands of boards and microcontrollers in the Arduino ecosystem. For this reason, we intentionally do not implement anything specific to a particular board in this code base and thus the configuration of permissions necessary for communication between the arbitrary upload tool and an arbitrary board is completely out of scope for the Arduino IDE project.

The place to do such things is in the Arduino boards platform that adds support for a given board. The boards platform framework does provide support for running a script when the platform is installed via the Arduino IDE Boards Manager:

https://arduino.github.io/arduino-cli/1.0/platform-specification/#post-install-script

This script can't be used to configure the Linux permissions since this requires superuser privileges which Arduino IDE does not and should not have. However, it is possible to use the script to communicate to the user the possible need to configure the permissions, and how to do that. We have recently done this in several of the official Arduino boards platforms:

I would definitely encourage the developers of other platforms for boards that might require the configuration of Linux permissions (or other other external configuration) to do something similar as I think this does have potential to significantly improve the user experience.

Arduino also provides documentation for configuring permissions:

https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-uploading-a-sketch/#please-read-only-linux-users

https://docs.arduino.cc/software/ide-v1/tutorials/Linux/#please-read

https://support.arduino.cc/hc/en-us/articles/360016495679-Fix-port-access-on-Linux

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
@per1234 per1234 added the conclusion: off topic Off topic for this repository label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: off topic Off topic for this repository type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants