Go Down

Topic: Mac OSX "port in use" error (Read 733 times) previous topic - next topic

Hoeken

I have an Arduino Diecimilia, and I cant use it with my pretty Macbook.  I know the board works, because I've programmed it multiple times with my windows box.  Here is the error I get when I try to program it:

processing.app.SerialException: Serial port '/dev/tty.usbserial-A4001nDf' already in use.  Try quiting any programs that may be using it.
     at processing.app.Serial.<init>(Serial.java:140)
     at processing.app.Serial.<init>(Serial.java:72)
     at processing.app.Uploader.flushSerialBuffer(Uploader.java:66)
     at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:55)
     at processing.app.Sketch.upload(Sketch.java:1632)
     at processing.app.Sketch.exportApplet(Sketch.java:1701)
     at processing.app.Editor$41.run(Editor.java:2004)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

I tried doing a lsof | grep usbserial, but it doesn't return any results (from what i understand, lsof tells you who is using the port.)

please help!  its a pain in the butt to have to use windows, and i cant play with my arduino on the go :-/

Hoeken

update:  i ran the macosx_setup command from arduino 0005 and it fixed my problems.  yay!

mellis

Strange.  Which version of the Arduino software are you using?

Hoeken

this was on both 0009 and 0010.  i ran into it with 0009 but my board worked on windows so i forgot about it.  when 0010 came out i decided i needed to be able to use my macbook with it, and finally sat down and fixed it.

perhaps it would be a good idea to re-include that script just in case?  or even better, make it part of the arduino code that handles that error?

mellis

The strange thing is that you shouldn't need to run the script at all.  What it does is set up permission on a directory used for locking, but the version of RXTX included with Arduino shouldn't use locks at all (since they're in a non-standard location for the Mac, they don't really help anyway, since most other programs don't know about them).  Do you have any versions of librxtxSerial.jnilib or comm.jar or jcl.jar in any of your Java directories?  

Hoeken

ah yes, that could be it... i installed them as part of the RepRap host library code.

mellis

That would probably explain it.  The default versions of RXTX use the lock files.

Go Up