Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy

I am Linux Mint user.I am dealing with Arduino Yun.I am compiling Arduino program.After that I am uploading to Arduino Yun.Then I get these error.Can you help me?

like image 381
kafkas Avatar asked Dec 03 '16 19:12

kafkas


People also ask

How do I open ttyACM0?

Open a "terminal window" by pressing Ctrl-Alt-T . Left Click to select this window. When prompted, type your login password. This will set things up so that your next (and all subsequent) login will have group access to /dev/ttyACM0 .

How do I change the port on Arduino?

All that needs to be done is: In the Device manager , right click on the specific COM port and select port properties . Click on the settings tab and go to advanced . Change port number to the one you like.


1 Answers

you first need to make sure you have the correct read/write rights, as described here, esentially enter following commands:

$ sudo adduser <username> dialout
$ sudo chmod a+rw /dev/ttyACM0

the '/dev/ttyACM0' is the port your arduino is connected to, it should be listed in the /dev folder of your root.

second: after you have identified which port the arduino is connected to and you have set the correct rights for this port, you need to run following command. I am not sure what it does, I am not sure if it's really needed, but it made the uploads work for me on several occasions

$ sudo udevadm trigger

found this command here: http://starter-kit.nettigo.eu/2015/serial-port-busy-for-avrdude-on-ubuntu-with-arduino-leonardo-eth/

and third, you will find the upload sometimes a challenge of timing and luck. Keep pressing the reset (sometimes twice very consecutively) and meanwhile press the upload button of your arduino sketch. At certain moment, it will work. I had more luck when constantly changing small pieces in the code, so when I pushed 'upload', it had to compile the code first.

https://www.arduino.cc/en/Guide/Troubleshooting#upload

on some computers, you may need to push teh reset button

I have never messed with the bootloader, nor with ICSP pins and such (luckily)

Also have a look on the Arduino forum or on the link provide by yourself

like image 64
hewi Avatar answered Sep 19 '22 11:09

hewi