How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?












5














I have Ubuntu 18.04 LTS installed.



I installed Arduino IDE v1.8.5 as a snap with



snap install arduino-mhall119


I have added my user to dial-out group and rebooted:



sudo usermod -a -G dialout $USER

$ groups
username adm dialout cdrom sudo dip plugdev lpadmin sambashare


I connected my Arduino Nano to the laptop, it is detected on port /dev/ttyUSB0 (ch341-uart).



$ ls /dev/ttyUSB0 -al
crw-rw---- 1 root dialout 188, 0 авг 13 11:59 /dev/ttyUSB0


I tried to upload the simpliest Blink sketch and get the following errors in the terminal:



$ arduino-mhall119.arduino 


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.**


Also I have installed arduino 1.8.5 with umake - it can access serial port in usual way.



Note: we already have similar question here, but the solution was to use package from umake, not fix for the Snap.



So my question is: How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?



Update: connecting serial-port to the snap fails with the following message



$ snap connect arduino-mhall119:serial-port 
error: snap "core" has no "serial-port" interface slots


Current interfaces are:



$ snap interfaces | grep arduino
:home arduino-mhall119,gedit,organize-my-files,vlc
:network arduino-mhall119,gedit,organize-my-files,pulsemixer,vlc
:unity7 arduino-mhall119,gedit,organize-my-files,vlc
:x11 arduino-mhall119,organize-my-files,pulsemixer,vlc
- arduino-mhall119:serial-port


Changing permissions of serial port to 777 with sudo chmod 777 /dev/ttyUSB0 does not help.



The following do not work too (because of syntax errors):



$ sudo snap connect arduino-mhall119:arduino
error: snap "arduino-mhall119" has no plug named "arduino"

$ snap connect arduino-mhall119:/dev/ttyUSB0
error: snap "arduino-mhall119" has no plug named "/dev/ttyUSB0"

$ snap connect arduino-mhall119
error: cannot resolve connection, plug snap name is empty


Information about YAML-manifest:



$ ls -l /snap/arduino-mhall119/current/meta/snap.yaml
-rw-r--r-- 1 root root 353 июл 28 00:20 /snap/arduino-mhall119/current/meta/snap.yaml

$ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 12 slots

$ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 5 plug
plugs:
- x11
- unity7
- home
- network
- serial-port









share|improve this question





























    5














    I have Ubuntu 18.04 LTS installed.



    I installed Arduino IDE v1.8.5 as a snap with



    snap install arduino-mhall119


    I have added my user to dial-out group and rebooted:



    sudo usermod -a -G dialout $USER

    $ groups
    username adm dialout cdrom sudo dip plugdev lpadmin sambashare


    I connected my Arduino Nano to the laptop, it is detected on port /dev/ttyUSB0 (ch341-uart).



    $ ls /dev/ttyUSB0 -al
    crw-rw---- 1 root dialout 188, 0 авг 13 11:59 /dev/ttyUSB0


    I tried to upload the simpliest Blink sketch and get the following errors in the terminal:



    $ arduino-mhall119.arduino 


    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.**


    Also I have installed arduino 1.8.5 with umake - it can access serial port in usual way.



    Note: we already have similar question here, but the solution was to use package from umake, not fix for the Snap.



    So my question is: How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?



    Update: connecting serial-port to the snap fails with the following message



    $ snap connect arduino-mhall119:serial-port 
    error: snap "core" has no "serial-port" interface slots


    Current interfaces are:



    $ snap interfaces | grep arduino
    :home arduino-mhall119,gedit,organize-my-files,vlc
    :network arduino-mhall119,gedit,organize-my-files,pulsemixer,vlc
    :unity7 arduino-mhall119,gedit,organize-my-files,vlc
    :x11 arduino-mhall119,organize-my-files,pulsemixer,vlc
    - arduino-mhall119:serial-port


    Changing permissions of serial port to 777 with sudo chmod 777 /dev/ttyUSB0 does not help.



    The following do not work too (because of syntax errors):



    $ sudo snap connect arduino-mhall119:arduino
    error: snap "arduino-mhall119" has no plug named "arduino"

    $ snap connect arduino-mhall119:/dev/ttyUSB0
    error: snap "arduino-mhall119" has no plug named "/dev/ttyUSB0"

    $ snap connect arduino-mhall119
    error: cannot resolve connection, plug snap name is empty


    Information about YAML-manifest:



    $ ls -l /snap/arduino-mhall119/current/meta/snap.yaml
    -rw-r--r-- 1 root root 353 июл 28 00:20 /snap/arduino-mhall119/current/meta/snap.yaml

    $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 12 slots

    $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 5 plug
    plugs:
    - x11
    - unity7
    - home
    - network
    - serial-port









    share|improve this question



























      5












      5








      5


      4





      I have Ubuntu 18.04 LTS installed.



      I installed Arduino IDE v1.8.5 as a snap with



      snap install arduino-mhall119


      I have added my user to dial-out group and rebooted:



      sudo usermod -a -G dialout $USER

      $ groups
      username adm dialout cdrom sudo dip plugdev lpadmin sambashare


      I connected my Arduino Nano to the laptop, it is detected on port /dev/ttyUSB0 (ch341-uart).



      $ ls /dev/ttyUSB0 -al
      crw-rw---- 1 root dialout 188, 0 авг 13 11:59 /dev/ttyUSB0


      I tried to upload the simpliest Blink sketch and get the following errors in the terminal:



      $ arduino-mhall119.arduino 


      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.**


      Also I have installed arduino 1.8.5 with umake - it can access serial port in usual way.



      Note: we already have similar question here, but the solution was to use package from umake, not fix for the Snap.



      So my question is: How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?



      Update: connecting serial-port to the snap fails with the following message



      $ snap connect arduino-mhall119:serial-port 
      error: snap "core" has no "serial-port" interface slots


      Current interfaces are:



      $ snap interfaces | grep arduino
      :home arduino-mhall119,gedit,organize-my-files,vlc
      :network arduino-mhall119,gedit,organize-my-files,pulsemixer,vlc
      :unity7 arduino-mhall119,gedit,organize-my-files,vlc
      :x11 arduino-mhall119,organize-my-files,pulsemixer,vlc
      - arduino-mhall119:serial-port


      Changing permissions of serial port to 777 with sudo chmod 777 /dev/ttyUSB0 does not help.



      The following do not work too (because of syntax errors):



      $ sudo snap connect arduino-mhall119:arduino
      error: snap "arduino-mhall119" has no plug named "arduino"

      $ snap connect arduino-mhall119:/dev/ttyUSB0
      error: snap "arduino-mhall119" has no plug named "/dev/ttyUSB0"

      $ snap connect arduino-mhall119
      error: cannot resolve connection, plug snap name is empty


      Information about YAML-manifest:



      $ ls -l /snap/arduino-mhall119/current/meta/snap.yaml
      -rw-r--r-- 1 root root 353 июл 28 00:20 /snap/arduino-mhall119/current/meta/snap.yaml

      $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 12 slots

      $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 5 plug
      plugs:
      - x11
      - unity7
      - home
      - network
      - serial-port









      share|improve this question















      I have Ubuntu 18.04 LTS installed.



      I installed Arduino IDE v1.8.5 as a snap with



      snap install arduino-mhall119


      I have added my user to dial-out group and rebooted:



      sudo usermod -a -G dialout $USER

      $ groups
      username adm dialout cdrom sudo dip plugdev lpadmin sambashare


      I connected my Arduino Nano to the laptop, it is detected on port /dev/ttyUSB0 (ch341-uart).



      $ ls /dev/ttyUSB0 -al
      crw-rw---- 1 root dialout 188, 0 авг 13 11:59 /dev/ttyUSB0


      I tried to upload the simpliest Blink sketch and get the following errors in the terminal:



      $ arduino-mhall119.arduino 


      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.**


      Also I have installed arduino 1.8.5 with umake - it can access serial port in usual way.



      Note: we already have similar question here, but the solution was to use package from umake, not fix for the Snap.



      So my question is: How to make Arduino (Snap) access serial port /dev/ttyUSB0 (or /dev/ttyACM0)?



      Update: connecting serial-port to the snap fails with the following message



      $ snap connect arduino-mhall119:serial-port 
      error: snap "core" has no "serial-port" interface slots


      Current interfaces are:



      $ snap interfaces | grep arduino
      :home arduino-mhall119,gedit,organize-my-files,vlc
      :network arduino-mhall119,gedit,organize-my-files,pulsemixer,vlc
      :unity7 arduino-mhall119,gedit,organize-my-files,vlc
      :x11 arduino-mhall119,organize-my-files,pulsemixer,vlc
      - arduino-mhall119:serial-port


      Changing permissions of serial port to 777 with sudo chmod 777 /dev/ttyUSB0 does not help.



      The following do not work too (because of syntax errors):



      $ sudo snap connect arduino-mhall119:arduino
      error: snap "arduino-mhall119" has no plug named "arduino"

      $ snap connect arduino-mhall119:/dev/ttyUSB0
      error: snap "arduino-mhall119" has no plug named "/dev/ttyUSB0"

      $ snap connect arduino-mhall119
      error: cannot resolve connection, plug snap name is empty


      Information about YAML-manifest:



      $ ls -l /snap/arduino-mhall119/current/meta/snap.yaml
      -rw-r--r-- 1 root root 353 июл 28 00:20 /snap/arduino-mhall119/current/meta/snap.yaml

      $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 12 slots

      $ cat /snap/arduino-mhall119/current/meta/snap.yaml |grep -A 5 plug
      plugs:
      - x11
      - unity7
      - home
      - network
      - serial-port






      permissions 18.04 snap serial-port arduino






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 13 at 9:14

























      asked May 9 at 12:38









      N0rbert

      20.8k54497




      20.8k54497






















          1 Answer
          1






          active

          oldest

          votes


















          9














          Install the snap in classic mode to allow access to ports



          $ snap install arduino-mhall119 --classic


          It's that simple. You should now have access to your serial ports! Happy Hacking!



          Note: info below are needed for old Arduino 1.6.10.







          Some interesting links that helped find the answer



          Auto connected serial port interface




          Lundamar says:
          Until the serial-port gadget/interface is improved to give access to all system serial devices you can get your snap working by simply installing it non-confined like so:




          $ snap install tio --classic



          It’s better than nothing but it surely would be best to run it confined with allowed access to serial tty devices.




          Interfaces - serial-port



          Interfaces reference:




          serial-port

          Can access serial ports. This is restricted because it provides privileged access to configure serial port hardware. Note that the slot is meant to be implemented by a gadget snap (this is not provided by the core snap).




          Gadget providing serial-port slot






          share|improve this answer























          • Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
            – N0rbert
            May 9 at 16:37










          • Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
            – CodingCaio
            Aug 30 at 12:48










          • Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
            – CodingCaio
            Aug 30 at 13:00










          • Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
            – CodingCaio
            Aug 30 at 13:17










          protected by N0rbert Sep 30 at 15:00



          Thank you for your interest in this question.
          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



          Would you like to answer one of these unanswered questions instead?














          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          9














          Install the snap in classic mode to allow access to ports



          $ snap install arduino-mhall119 --classic


          It's that simple. You should now have access to your serial ports! Happy Hacking!



          Note: info below are needed for old Arduino 1.6.10.







          Some interesting links that helped find the answer



          Auto connected serial port interface




          Lundamar says:
          Until the serial-port gadget/interface is improved to give access to all system serial devices you can get your snap working by simply installing it non-confined like so:




          $ snap install tio --classic



          It’s better than nothing but it surely would be best to run it confined with allowed access to serial tty devices.




          Interfaces - serial-port



          Interfaces reference:




          serial-port

          Can access serial ports. This is restricted because it provides privileged access to configure serial port hardware. Note that the slot is meant to be implemented by a gadget snap (this is not provided by the core snap).




          Gadget providing serial-port slot






          share|improve this answer























          • Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
            – N0rbert
            May 9 at 16:37










          • Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
            – CodingCaio
            Aug 30 at 12:48










          • Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
            – CodingCaio
            Aug 30 at 13:00










          • Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
            – CodingCaio
            Aug 30 at 13:17
















          9














          Install the snap in classic mode to allow access to ports



          $ snap install arduino-mhall119 --classic


          It's that simple. You should now have access to your serial ports! Happy Hacking!



          Note: info below are needed for old Arduino 1.6.10.







          Some interesting links that helped find the answer



          Auto connected serial port interface




          Lundamar says:
          Until the serial-port gadget/interface is improved to give access to all system serial devices you can get your snap working by simply installing it non-confined like so:




          $ snap install tio --classic



          It’s better than nothing but it surely would be best to run it confined with allowed access to serial tty devices.




          Interfaces - serial-port



          Interfaces reference:




          serial-port

          Can access serial ports. This is restricted because it provides privileged access to configure serial port hardware. Note that the slot is meant to be implemented by a gadget snap (this is not provided by the core snap).




          Gadget providing serial-port slot






          share|improve this answer























          • Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
            – N0rbert
            May 9 at 16:37










          • Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
            – CodingCaio
            Aug 30 at 12:48










          • Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
            – CodingCaio
            Aug 30 at 13:00










          • Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
            – CodingCaio
            Aug 30 at 13:17














          9












          9








          9






          Install the snap in classic mode to allow access to ports



          $ snap install arduino-mhall119 --classic


          It's that simple. You should now have access to your serial ports! Happy Hacking!



          Note: info below are needed for old Arduino 1.6.10.







          Some interesting links that helped find the answer



          Auto connected serial port interface




          Lundamar says:
          Until the serial-port gadget/interface is improved to give access to all system serial devices you can get your snap working by simply installing it non-confined like so:




          $ snap install tio --classic



          It’s better than nothing but it surely would be best to run it confined with allowed access to serial tty devices.




          Interfaces - serial-port



          Interfaces reference:




          serial-port

          Can access serial ports. This is restricted because it provides privileged access to configure serial port hardware. Note that the slot is meant to be implemented by a gadget snap (this is not provided by the core snap).




          Gadget providing serial-port slot






          share|improve this answer














          Install the snap in classic mode to allow access to ports



          $ snap install arduino-mhall119 --classic


          It's that simple. You should now have access to your serial ports! Happy Hacking!



          Note: info below are needed for old Arduino 1.6.10.







          Some interesting links that helped find the answer



          Auto connected serial port interface




          Lundamar says:
          Until the serial-port gadget/interface is improved to give access to all system serial devices you can get your snap working by simply installing it non-confined like so:




          $ snap install tio --classic



          It’s better than nothing but it surely would be best to run it confined with allowed access to serial tty devices.




          Interfaces - serial-port



          Interfaces reference:




          serial-port

          Can access serial ports. This is restricted because it provides privileged access to configure serial port hardware. Note that the slot is meant to be implemented by a gadget snap (this is not provided by the core snap).




          Gadget providing serial-port slot







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 13 at 9:04









          N0rbert

          20.8k54497




          20.8k54497










          answered May 9 at 16:26









          Joshua Besneatte

          2,0271924




          2,0271924












          • Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
            – N0rbert
            May 9 at 16:37










          • Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
            – CodingCaio
            Aug 30 at 12:48










          • Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
            – CodingCaio
            Aug 30 at 13:00










          • Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
            – CodingCaio
            Aug 30 at 13:17


















          • Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
            – N0rbert
            May 9 at 16:37










          • Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
            – CodingCaio
            Aug 30 at 12:48










          • Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
            – CodingCaio
            Aug 30 at 13:00










          • Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
            – CodingCaio
            Aug 30 at 13:17
















          Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
          – N0rbert
          May 9 at 16:37




          Made your answer more comprehensive, so you can remove all comments below the question. Thank you for all you help!
          – N0rbert
          May 9 at 16:37












          Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
          – CodingCaio
          Aug 30 at 12:48




          Thank you. I was having the same problem and your solution worked for me. I don't understand though. A few months back my Arduino IDE was working fine, I didn't change anything, and now I just wasted 3 hours, added permissions to the ttyUSB0 (which were there to begin with), I already belonged to the group dialout, rebooted multiple times and prayed over and over. And a simple '--classic' solved it. Seriously man, wtf! I read your answer multiple times, it is gibberish to me. I'd think installing the IDE from Ubuntu Software manager should have worked right out of the box (like it did before).
          – CodingCaio
          Aug 30 at 12:48












          Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
          – CodingCaio
          Aug 30 at 13:00




          Well, now there isn't the esp32 in the Board Manager. It feels like it's 1996 all over again.
          – CodingCaio
          Aug 30 at 13:00












          Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
          – CodingCaio
          Aug 30 at 13:17




          Never mind, I'm kinda brain dead already and forgot to add the esp32 URL to the Board Manager in Preferences... thanks again for your solution.
          – CodingCaio
          Aug 30 at 13:17





          protected by N0rbert Sep 30 at 15:00



          Thank you for your interest in this question.
          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



          Would you like to answer one of these unanswered questions instead?



          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents