Permission denied to upload, nothing works

Hi,
I am having a really weird issue, the computer running ubuntu 18.04 does not allow to upload sketches to Arduboy.
I have went through all the usual things and tips, such as adding the user int dialout group, fixing permissions, running as root, but I still get the same problem.
I am suspecting this has something to do with Arduino Leonardo, as Unos work ok.
I also reinstalled the whole OS as I was suspecting that processing.app or other would have gobbled all the ports for themselves. (Also tried preventing this)
Still I get this error code, any suggestions???
processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:160)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:713)
at processing.app.SketchController.exportApplet(SketchController.java:686)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2168)
at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Ongelma kokeillessa sarjaporttia ‘/dev/ttyACM0’.
at processing.app.Serial.touchForCDCReset(Serial.java:107)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:144)
… 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
at jssc.SerialPort.openPort(SerialPort.java:170)
at processing.app.Serial.touchForCDCReset(Serial.java:101)
… 6 more

1 Like

Have you disabled the Modem Manager service, if it’s running?

Check:
systemctl list-unit-files | fgrep ModemManager

Disable:
sudo systemctl disable ModemManager.service

Yes, thanks! Have tried that and still get the same result.

This fixed the issue for me: https://askubuntu.com/a/58122/816537

The key bit being sudo usermod -a -G dialout $USER

then log out and back in.

Thanks, have tried that already, does not work…

Really appreciate all the hints! It is really weird, and haven’t found anything that works. The user is in the dialout group, have checked that it is actually the dialout group that Arduino calls (Read somewhere that some linux distros actually use Serial-group.) So If I understood correctly the user should have permissions to use the port…
I have also tried disabling the modem controller, in case it would hog the ports.
I have tried several arduboy’s that work correctly with other computers so it can’t be that either, nor the cables.

worst case scenario, launching the IDE using sudo should work. Don’t really recommend it, but if desperate :slight_smile:

1 Like

So finally figured it out. I deleted Arduino Ide from the computer and installed it fresh through commandline with umake. Do not know why, but now it runs smoothly and no issues.
I had already tried reinstalling through ubuntus appstore and through Arduino’s website.

So in case someone runs into this kind of problems!

2 Likes

I was having the same issue as well in uploading code to the Arduboy using the Arduino IDE with Ubuntu 18.04. In case anyone is having issues with it, I did the following:

  1. I downloaded the latest version of the Arduino IDE from the Arduino website.

  2. I extracted the Arduino IDE and ran the following command to install it:
    $ sudo ./install.sh

  3. After installing, to set the proper permissions, I ran the script that came with the latest version of the Arduino IDE by running the following:

    $ .arduino-linux-setup.sh <enter your user name here>

  4. Once the install is complete, restart your computer. Now you will have permission to upload code to the Arduboy.