I’m trying to use the Arduino IDE snap (arduino-mhall119) in Ubuntu 18.04 to upload the simple blinking code example to a Seeeduino Lotus v1.1 (to USB port dev/ttyUSB0) or an Arduino Uno (to USB port dev/ttyACM0). This gives me the following error messages respectively.
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Because the permission is denied, my next trouble shooting step would be to run the snap as root. It would be good if this option was available as a GUI option, but since I could not find one for the snap. I tried sudo arduino-mhall119.arduino
and got the following errors:
mkdir: cannot create directory '/run/user/0': Permission denied
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Documents': No such file or directory
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Desktop': No such file or directory
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Downloads': No such file or directory
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Music': No such file or directory
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Pictures': No such file or directory
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Videos': No such file or directory
ln: failed to create symbolic link '/root/snap/arduino-mhall119/5/snap/arduino-mhall119/5/Templates': No such file or directory
No protocol specified
Picked up JAVA_TOOL_OPTIONS:
No protocol specified
java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
at java.awt.SystemColor.updateSystemColors(SystemColor.java:473)
at java.awt.SystemColor.<clinit>(SystemColor.java:465)
at processing.app.Theme.init(Theme.java:84)
at processing.app.Base.<init>(Base.java:219)
at processing.app.Base.main(Base.java:144)
I seem not to be able to run the snap as root. Does anyone have a solution to do this via the GUI and have it permanently start up in root?
Thanks a lot
UPDATE: I found out that in the Ubuntu Software centre (where I installed the snap) there is a permission option to “Access serial port hardware” (see picture below). That could fix the permission issue! However, after clicking that and being prompted for my root password, I can only change it to the setting ‘(disconnected)’ and nothing else. This seems very odd to me. Can anyone explain why this is and perhaps fix this serial permission non-availability?