Serial port busy for avrdude on Ubuntu with Arduino Leonardo Eth
Doing test with new Arduino Leonardo ETH on Ubuntu (14.04) we had problem with programming this board:
avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy avrdude: ser_send(): write error: Bad file descriptor Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
On Ubuntu (or other distro with ModemManager) ModemManager tries to connect to each new serial port. MM tries if this serial port is GSM modem. This is very convenient for most users, but it keeps serial port open, and Arduino IDE can not communicate with Arduino Leonardo. There is a list of ignored devices by ModemManager, but for now most Arduinos from Arduino.org are not included.
What to do? Just add own rule telling ModemManger to ignore all USB devices from Arduino.org. Open new terminal (Ctrl+Alt+T) and issue command:
sudo echo 'ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"' > /etc/udev/rules.d/77-arduino.rules
echo ‘ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"‘ | sudo tee /etc/udev/rules.d/77-arduino.rules
As noted in comments, there should be other form used, first one won’t work – will not write rule into file, will return Permission denided
, thus this update
next You have to reload rules:
sudo udevadm trigger
That’s all.
Been struggling with wondering what could use the port when coming up! Thanks a bunch for this one.
The suggested command will not work because the shell redirect will not be run with sudo, only echo (which is pointless). Use thise instead:
echo ‘ATTRS{idVendor}==”2a03″, ENV{ID_MM_DEVICE_IGNORE}=”1″‘ | sudo tee /etc/udev/rules.d/77-arduino.rules
@Florian, You are completely right. I’m not sure how this old form was written…
Be careful about using a cut-and-paste. You want to use the old-fashioned double quote (0x22) and not the right double quote (0x201D). Maybe this:
echo ‘ATTRS{idVendor}==”2a03″, ENV{ID_MM_DEVICE_IGNORE}=”1″‘ | sudo tee /etc/udev/rules.d/77-arduino.rules
Durn it… I think WordPress is missing with my double (and single) quotes…. Trying again.
echo ‘ATTRS{idVendor}==”2a03″, ENV{ID_MM_DEVICE_IGNORE}=”1″‘ | sudo tee /etc/udev/rules.d/77-arduino.rules