Go Down

Topic: "Serial port '/dev/tty.usbmodem411' already in use" Mac OSX (Read 6897 times) previous topic - next topic

hugigu

Hello everyone

I just received my Arduino UNO board in the mail (my first ever, so I'm a complete virgin) and have spent the whole day trying to get it working but with no luck. I'd greatly appreciate your help!

In short, I get this message when I try to upload to the UNO: Serial port '/dev/tty.usbmodem411' already in use

Here is some additional info that may or may not be relevant:

I have a MacBook Pro running OSX 10.5.8

* I have no other programs running, nothing plugged to the board and nothing plugged to other usb ports of the computer.

* I've rebooted several times

* When I plug it into the computer the green "on" light comes on and the L led blinks orange.

* I followed the the installation instructions to the letter (tried 3 times already).

* I did NOT get a pop up regarding a new modem when I plugged it into the computer. In "Networks" a new network was made but is constantly "disconnected" (and can't be connected).

* I've found a few posts describing similar problems but most of them are quite old and none of the info there has been helpful in my case.


Hope you are able to help me out!

Best regards,
Hugi

smeezekitty

I do not know about MacOS X but I would say its likely either the wrong port selected or wrong board selected in the Arduino IDE.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

James C4S

1.  The most common fix is do drop to a terminal and type the following:
Code: [Select]
sudo mkdir /var/lock
sudo chmod 777 /var/lock

You'll be asked to enter your password once.

2.  You can also use this on the terminal to see if anything else is using the Uno:
Code: [Select]
lsof | grep usbmodem 
If nothing is returned, then see #1.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

hugigu

Thanks for the replies! Much appreciated!

Firstly, I had selected the correct board and serial port. Checked and double checked.

I went through the steps suggested by James and here is what I got:

1. The terminal returned this after I typed in the pw: mkdir: /var/lock: File exists

Still the Uno didn't allow me to upload.

2. the "lsof | grep usbmodem" gives me a rather long list.....

avrdude   1928 hugi    3u     CHR      10,0       0t6 132234372 /dev/tty.usbmodem411
avrdude   2151 hugi    3u     CHR      10,0       0t6 132234372 /dev/tty.usbmodem411
avrdude   2317 hugi    3u     CHR      10,0       0t6 132234372 /dev/tty.usbmodem411
avrdude   8537 hugi    3u     CHR      10,6       0t6 206089220 /dev/tty.usbmodem621
avrdude   8805 hugi    3u     CHR      10,6       0t6 206089220 /dev/tty.usbmodem621

I have no idea what this means, but I'm guessing it looks wrong. I tried running this in the terminal both with the UNO plugged and un-plugged and the result is the same. What can this be if I have nothing plugged into the usb ports of the computer?

I'm going to reboot the computer and see if I get a different result in the terminal. I'll post it here if I do.

I would be very greatful if someone out there has any thoughts on this...



hugigu

Hello again

After I rebooted the computer the "lsof | grep usbmodem" in the terminal doesn't return anything, as opposed to 5 lines before.

When I try to upload to the UNO I get:

avrdude: stk500_recv(): programmer is not responding





James C4S

avrdude is the program that actually programs the Arduino.

Have you run the chmod command yet?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

hugigu

Yes, I've run the chmod command. I'm asked for password but the terminal doesn't return with anything. The mkdir command is returned with a "mkdir: /var/lock: File exists"

The grep usbmodem isn't returned with anything either even if the UNO is plugged in and blinking away.

The result is still the same: avrdude: stk500_recv(): programmer is not responding

How should the UNO look in the System Preferences - Network? Is it enough that it is just there and "not connected". I never got the "pop up" that is described in the manual...

James C4S


Yes, I've run the chmod command. I'm asked for password but the terminal doesn't return with anything. The mkdir command is returned with a "mkdir: /var/lock: File exists"

Both makes sense.  mkdir tries to create the directory, chmod sets the permissions.  chmod would only return something if it failed.


The grep usbmodem isn't returned with anything either even if the UNO is plugged in and blinking away.

lsof stands for "list of open files."  grep takes results returned and filters by the keyword.  (just running lsof would list *every* open file--keep in mind everything in an UNIX operating system gets a file handle, even devices.)  When you get the "Serial port in Use" error, the combination of lsof piped to grep lets you see what processes has the specific serial port open.  In your previous case, multiple copies of avrdude were stuck for some reason.  -- Note this might have indicated a problem with the 8u2.  Look at the forum's sticky posts for a how to do a loop-back test.


The result is still the same: avrdude: stk500_recv(): programmer is not responding

This generic error just tells you that avrdude wasn't able to talk to the programmer.  In the case of an arduino, the "programmer" is actually the bootloader on the ATmega328.  One reason could be that you've selected the wrong board type (or serial port) in the appropriate drop down menus of the IDE.


How should the UNO look in the System Preferences - Network? Is it enough that it is just there and "not connected". I never got the "pop up" that is described in the manual...

Doesn't matter.  It really doesn't matter if it is listed there or not.  The Uno emulates an USB Modem, so that no drivers are required.  Since it appears to be a modem to OS X, it places an entry in the Network system preferences.  All that matters to you / Arduino IDE is that the modem gets assigned a virtual serial port (the tty.usbmodemXXXX name).

Another test might be to run this terminal command with the Uno connected and disconnected:
Code: [Select]
ls -l /dev/tty.usb*

This will give you an idea what serial port the Uno is being assigned.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

mellis

If you see /dev/tty.usbserial411 (or similar) in the Serial Port menu in the Arduino IDE, it sounds like the board is correctly being recognized by the computer.  If you get a serial port in use error when you try to upload, it may be that there is actually another program on your computer trying to use the serial port.  Things like USB internet dongles, PDA or cell phone sync applications, bluetooth terminals, etc. sometimes try to open and use any serial port that shows up on the computer.  Do you have anything like that running?

hugigu

Hello and thanks for the help once again!


If you see /dev/tty.usbserial411 (or similar) in the Serial Port menu in the Arduino IDE, it sounds like the board is correctly being recognized by the computer.  If you get a serial port in use error when you try to upload, it may be that there is actually another program on your computer trying to use the serial port.  Things like USB internet dongles, PDA or cell phone sync applications, bluetooth terminals, etc. sometimes try to open and use any serial port that shows up on the computer.  Do you have anything like that running?


There is litterally nothing running on the computer and I have nothing plugged into it when I've been doing these tests. I've even cleaned out traces of some old USB internet dongles I used some months ago and bluetooth is off.

I've done the loop-back test and it does not work. I've tried it 3 times now and restarted the computer inbetween tries. What happens is this:

I type a word and press send (having done all the previous steps in the process, of course) and nothing comes back. I type another word and press send and everything freezes. I can't even force quit the application until I've unplugged the board. This happens every time the exact same way.

Where does this leave me, you reckon?

hugigu




Another test might be to run this terminal command with the Uno connected and disconnected:
Code: [Select]
ls -l /dev/tty.usb*

This will give you an idea what serial port the Uno is being assigned.



I did this test, first with the board disconnected:

hugi-gudmundssons-macbook-pro-2:~ hugi$ ls -l /dev/tty.usb*
ls: /dev/tty.usb*: No such file or directory


And then connected:

hugi-gudmundssons-macbook-pro-2:~ hugi$ ls -l /dev/tty.usb*
crw-rw-rw-  1 root  wheel   10,   8 Dec 15 00:33 /dev/tty.usbmodem411



To my untrained eye this should be ok. i.e. nothing found when disconnected and very familiar "/dev/tty.usbmodem411" (the port I've chosen in the Arduino sofware) when connected...



James C4S

Seeing an USB modem appear only when the Uno is connected is generally a good sign.  At this point you are probably thinking it is time to return your Uno.  It may very well be.

However...

... the freezing serial monitor and lack of Network Device Detect pop-up window is suspicious to me. 

Even more so with this statement:

I've even cleaned out traces of some old USB internet dongles I used some months ago and bluetooth is off.

"Internet USB dongles".  Are those like 3G data card devices?  These typically emulate a USBmodem.  They are notorious for installing software / "drivers" that talk *any* device that looks like a usb-based serial port or usb-based modem. 

Double check there are no traces of THAT software still around.  (e.g. check in Sys Prefs -> Users -> Login Items).
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

hugigu

Hi James

I deleted the software yesterday and removed them from the "network" list. I've double checked and don't find any traces of this software anywhere. Nothing starts on login except for Dropbox (and I've even tried switching it off, along with the airport wifi connection). I'm afraid the result is still the same...

Is the UNO faulty, perhaps? I don't have access to another computer at this time but I guess that is the next thing I'd need to test.

As always, I appreciate your help so far and welcome any new suggestions!




magnethead794

#13
Dec 16, 2011, 06:27 am Last Edit: Dec 16, 2011, 06:29 am by magnethead794 Reason: 1
Hugi,

It's an OSX thing.

When you plug it in, the board will appear in network connections as a dial-up modem i think? (I think that's what snow leopard picked it up as)

Select it, hit the minus button at bottom left of network window. Basically, tell the computer it's not a network device.

This will open the TTY port.

The OSX guide says just to apply it. That didn't work for me. I had to delete it as a network device.
KF5RVR

hugigu

@ magnethead

Thanks for the suggestion!

Unfortunatly this didn't work either... I'll now try rebooting once again after I've made these changes and will report back if it makes any difference.

Go Up