OSX Upload Issue: Error opening serial port: port busy

I used to have great success on mac (about a year ago on an older version of OSX and arduino IDE), but recently I can't seem to upload to Arduino consistently. Nine out of ten times I get the errors below and one out of ten I get a successful upload.

I'm running
OSX 10.10.4 on a mac book air
Arduino 1.6.5

Trying to upload to: Uno R3, Mega2560, bare conductive board. I have multiple of each and have reproduced the problem on all of them. Also, I'm able to upload successfully from another Ubuntu machine that I have, so I think the hardware is ok.

It's unclear what is the culprit. I've read that the mac ftdi drivers have changed, but the new Arduino boards have ditched the FTDI chip for an onboard usb-serial-converter. I also noticed that the /dev/tty.usbmodem* has disappeared from the port options under tools, so I have to use /dev/cu.usbmodem*. Oddly, if I ls /dev from the command line both cu.usbmodem and tty.usbmodem exist.

I frequently get one of the errors below and the boards fail to program, occasionally I get no error and the board fails to program silently. Restarting the Arduino IDE will normally allow me to upload the first time and then will give me errors on subsequent uploads, ~10% successful. I get similar errors trying to open the serial port and need to try about 6-10 times before connecting.

Is anyone else seeing this? Any suggestions on troubleshooting this issue?

Errors:

  1. Error opening serial port '/dev/cu.usbmodem1421'. (Port busy)

  2. avrdude: ser_open(): can't open device "/dev/cu.usbmodem1421": 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.

  3. processing.app.debug.RunnerException
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:131)
    at processing.app.debug.Compiler.upload(Compiler.java:165)
    at processing.app.Sketch.upload(Sketch.java:1167)
    at processing.app.Sketch.exportApplet(Sketch.java:1141)
    at processing.app.Sketch.exportApplet(Sketch.java:1113)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: processing.app.SerialException: Error touching serial port '/dev/cu.usbmodem1421'.
    at processing.app.Serial.touchForCDCReset(Serial.java:92)
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:120)
    ... 6 more
    Caused by: jssc.SerialPortException: Port name - /dev/cu.usbmodem1421; Method name - openPort(); Exception type - Port busy.
    at jssc.SerialPort.openPort(SerialPort.java:164)
    at processing.app.Serial.touchForCDCReset(Serial.java:86)
    ... 7 more

I have the same issue. Can anybody help? Thanks

Here are some tricks for debugging a serial port not available problem:

Use the terminal command: lsof | grep "/dev/cu"
That will show you if a process has the serial port open.

Check your network preferences and remove all the arduino serial ports from the list. at least for me it fixed the problem on El Capitan beta.

My case:
The same error.
Solution:

iMac:~ dmitry$ ls /dev/cu*
/dev/cu.Bluetooth-Incoming-Port		/dev/cu.usbmodem14911
iMac:~ dmitry$ lsof | grep "/dev/cu.usbmodem14911"
iMac:~ dmitry$

Nothing!

iMac:~ dmitry$ lsof | grep "/dev/tty.usbmodem14911"
Moveslink 896 dmitry   14u     CHR              18,14      0t38    1259 /dev/tty.usbmodem14911
iMac:~ dmitry$

In my case problem is Moveslink app.

I have basically the same setup and have had the exact same problem for quite a long time now. Problems i have encountered are as follows:

  1. Uploading a sketch works 1/5 times

after upload

  1. Serial monitor will open 1/5 times
  2. My programs act weirdly when USB cable is connected.

SOLUTION (specific for Dimaru)

Kill the Moveslink process by typing in the terminal: kill 896
You will notice that it worked when the moveslink icon disappears. The 896 is the process id specific to the program using that serial port which is unavailable. I guess the moveslink software is sniffing the usb port for the suunto wrist watch and therefore uploading a sketch works only every now and then. I will now make sure that moveslink won't start during startup and cause the same problem.

Thanks to johnwasser.

DimarU:

iMac:~ dmitry$ lsof | grep "/dev/tty.usbmodem14911"

Moveslink 896 dmitry  14u    CHR              18,14      0t38    1259 /dev/tty.usbmodem14911
iMac:~ dmitry$



In my case problem is Moveslink app.

Yep same for me! Was struggling with that for ages! Cheers.

I had the same issue, tried some terminal commands to no avail, and then figured out that I had connected the Arduino to a different USB port on my MacBook than I had when I initially used it. Switched to the other USB port, problem solved!

1 Like

I have the same problem, but none of the above solutions helped on my mac. How to fix this?

slingshotdancu:
I had the same issue, tried some terminal commands to no avail, and then figured out that I had connected the Arduino to a different USB port on my MacBook than I had when I initially used it. Switched to the other USB port, problem solved!

I feel so stupid, after 6 hours of banging my head against the wall. This solved my issue. Thank you

DimarU:
In my case problem is Moveslink app.

THANK YOU !!

Thanks everyone - Moveslink problem here too!

Guys,... in my case it was the Genuine apple usb-c to usb dongle that was upside down. apparently that makes a difference???

just wanted to share, and this is helpfull for somebody else

Thanks soreyn - that worked for me.

Really was the usb cable - tried a short high quality one that didn't work, tried a dozen other solutions, and then found an old thing covered in gaffer tape that worked fine. Moral of the story is; try ten usb cables before you try any hardcore troubleshooting :confused:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.