Tuesday, August 26, 2014

Arduino IDE error - avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied

If you run Arduino IDE on Ubuntu (Arduino 1.5.7 and Ubuntu 14.04 in my case), most possibly you cannot upload to Arduino board, caused by the error of:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device

To fix it, enter the command:
$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/ttyACM0

Where <username> is your user name in Ubuntu, /dev/ttyACM0 is the detected device of your Arduino board.

Check the video:

74 comments:

  1. Thanks! It works for me, on Ubuntu 14.04.1 and Arduino Uno clone.

    ReplyDelete
  2. Thanks a ton man. Worked perfectly!

    ReplyDelete
  3. Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Uno"

    Sketch uses 5,444 bytes (16%) of program storage space. Maximum is 32,256 bytes.

    Global variables use 407 bytes (19%) of dynamic memory, leaving 1,641 bytes for local variables. Maximum is 2,048 bytes.

    avrdude: ser_open(): can't open device "\\.\COM1": The system cannot find the file specified.




    Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.
    help

    ReplyDelete
  4. Thanks... Worked like a charm :D

    ReplyDelete
  5. Didn't work for me... no /dev/ttyACM0. On my Ubuntu 14xx found out that all I needed to do was to set Tools|Port in the IDE to /dev/ttyUSB0

    ReplyDelete
  6. Thanks a lot. Fixed the issue for me on Xubuntu 15.10 64bit, with Arduino IDE 1.6.5

    ReplyDelete
  7. Thank you ! works well in MINT !

    ReplyDelete
  8. Thanks a lot. Fixed the issue for me on Ubuntu 15.04 64bit, with Arduino IDE 1.6.7

    ReplyDelete
  9. Thanks! It worked for me in Mint ;-)

    ReplyDelete
  10. thank you but do you know how to get this persistent? After every USB Disconnect it seems to loose the required rights on the device.

    ReplyDelete
  11. Thanks!
    It's work for me in Debian Jessie x64

    ReplyDelete
  12. Thanks a lot. It worked for me in Ubuntu 14.04.3 and Arduino UNO clone.

    ReplyDelete
  13. This worked on /dev/TTYUSB0 in Ubuntu Linux Desktop 64-Bit v15.10 when I was trying to access the FTDI USB-to-Serial adapter via the Arduino IDE. Thanks for enlightening us!

    ReplyDelete
  14. Gracias, funcionó muy bien en Ubuntu 14.04.4 64 bit con Arduino 1.6.8

    ReplyDelete
  15. Thanks! It worked for me, on Linux Mint 17.3 64-bit and Arduino 1.6.9

    ReplyDelete
  16. Thanxxxxx worked for me too, so I have created a executable bash script its a solution for them dont want execute this lines every time

    ReplyDelete
  17. thanks a lot,
    It works for me with Mint on:
    CPU~Dual core AMD A4-4000 APU with Radeon HD Graphics (-MCP-) clocked at 1400.000 Mhz Kernel~3.16.0-38-generic x86_64 , USB0, arduino software 1.6.9.

    ReplyDelete
  18. whenever i upload code to my arduino uno board this error will occur
    avrdude: ser_open(): can't open device "\\.\COM20": The requested resource is in use
    please anyone help me
    (OS - windows 8.1)

    ReplyDelete
    Replies
    1. hello sir this is jyothirmai from klu
      did u got the answer for our question plzz share it to me it will be helpful to my project

      Delete
  19. Works fine :) but commands need to be rewrited after disconnecting arduino board. Any solution?

    ReplyDelete
  20. Thanks ! work for me in Ubuntu 16.04 LTS

    ReplyDelete
  21. Thank you so much. It works very well. Problem solved thanks to you. Regards from france. Chris

    ReplyDelete
  22. Thx!!! works in Ubuntu 10.04 LTS and Arduino IDE 1.6.9

    ReplyDelete
  23. Thanks, it works too with Linux Mint and Arduino Yun. (on IDE 1.6.10)

    ReplyDelete
  24. Hi i did this but now i got an other error: Im on linux 14.04


    Le croquis utilise 928 octets (2%) de l'espace de stockage de programmes. Le maximum est de 32 256 octets.
    Les variables globales utilisent 9 octets (0%) de mémoire dynamique, ce qui laisse 2 039 octets pour les variables locales. Le maximum est de 2 048 octets.
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
    Problème de téléversement vers la carte. Voir http://www.arduino.cc/en/Guide/Troubleshooting#upload pour suggestions.

    ReplyDelete
  25. thank you, works for me on arduino mega - kubuntu 16.04.

    ReplyDelete
  26. it worked nicely man thanks a ton. But the problem is that I have to run these commands every time I plug in my arduino. It works only for the time the board is plugged in. Is there any permanent solution.

    ReplyDelete
  27. Thanks worked in Linux Mint, but i used ....
    $ sudo usermod -a -G dialout
    $ sudo chmod a+rw /dev/ttyUSB0

    As it was detecting the Arduino as ttyUSB0

    ReplyDelete
  28. Worked,thanks! but really need permanent solution!

    ReplyDelete
  29. I am very impressed the commands worked fantastic. I am using unbuntu 16.0. I have been fighting this for a long time. Windows is ok but I ain't running M$.
    Thank You
    triad

    ReplyDelete
  30. Thank you!!! I needed it so much

    ReplyDelete
  31. This worked for me fantastically with unbuntu 16.0 also. on acer Aspire 64bit only the first instruction worked, but it cleared the COM proplem anyway. On 32 dbit unbuntu 16.0 both worked great and solved the issue.

    Only combination that worked

    Thank you.

    ReplyDelete
  32. Many thanks! Works on Ubuntu 16.04 Arduino Nano !!

    ReplyDelete
  33. This works for me after typing on a terminal:
    $ sudo -s
    $ chmod 777 /media
    (to activate my ports)

    SO: Ubuntu 16-04 Xenial Xerus.
    Board: Arduino Nano
    Arduino IDE: 1.8.2

    Thank you m3n

    ReplyDelete
  34. You must restart your computer for the changes to be permanent- I was having the same trouble until I restarted

    ReplyDelete
  35. Thank you.. It simply worked for me.

    ReplyDelete
  36. Fodaaaaaaaaaaaa. Muito top. Resolveu aqui no meu Gnome. Vlw.

    ReplyDelete
  37. Thank you it worked for me tooo.....

    ReplyDelete
  38. Yo estoy usando Lubuntu 16.04 LTS IDE 1.8.4. Y un Pro mini y Mega chinos. y funcionó muy bien. Gracias!

    ReplyDelete
  39. Thank you so much. its worked for me

    ReplyDelete
  40. its not work for me i am getting error no such file or directory

    ReplyDelete
  41. i am getting error when i am running the python script... Error: AttributeError: 'module' object has no attribute 'Serial' I already installed the pyserial library

    ReplyDelete
  42. What can i do. I get error of
    Avrdude:ser_open():cant open device"\\.\com3" system cannot find the file specified .
    Help me plz

    ReplyDelete
  43. Someone just pointed me at this blog post, suggesting your chmod command should be included in the official guide. However, I believe the chmod command is harmful:

    - It completely voids all permission checks on the serial device, giving everyone read and write checks. If you do this, there is no need to fiddle with groups at all.
    - This chmod only stays in effect until the device is unplugged, since when it is replugged, the device file is recreated with default permissions. This will confuse people, who will then resort to even worse plans, like running Arduino as root.

    Doing the chmod can be useful in some cases for debugging, to doublecheck that there is indeed a permission problem, but it is never a meaningful solution. Also, modifying group permissions requires you to log out and log in again before they take effect, so perhaps you included the chmod as a stopgap measure until someone logged in again? Better to just state that you need to login again.

    See also:

    https://github.com/arduino/Arduino/issues/7163
    https://www.arduino.cc/en/guide/linux

    ReplyDelete
  44. Thank you very much, without your help I wouldn't have been able to

    ReplyDelete
  45. Thank you very much, without your help I wouldn't have been able to

    ReplyDelete