How to reset the serial ports on a Mac ?

Hello,

Sometimes after a bad transmission between the Arduino IDE (v 1.0.5/Mac) and the board the serial port seem to be blocked.

Then I have two issues:

  1. The list of serial ports is not refreshed upon board connection.
  2. The IDE won't open the serial monitor and get stuck.

I have to force quit the application and most of the time I do also have to restart my user session in MacOS.
Isn't there an easier way to reset the serial ports ?

Thank you in advance.

What do you mean by "bad transmission"?

I mean that the upload of the program to the Arduino was unsuccessful. But whatever the cause I'd like to find a way to free the serial ports if they are blocked. Usually I have to shut down and restart the computer.

Usually just unplugging the cable works for me...
You can check if the port is available in terminal.

  1. Open terminal (Applications/utilities)
  2. Type ls -las | grep usb
  3. You should see your ports listed. If you remove the cable, the port will no longer be listed.
  4. Reinsert and you should have a new connection.

I have this issue when using three or more arduinos at the same time... Also always make use you use the correct serial port when you upload.

Hope this helps.

If you're getting "serial port in use" when this occurs, it is probably because avrdude is still holding the port open.

Here's a couple of things to check if that's the error you are getting:

Thanks James C4S and Kevin77.

Is it normal that the "ls -las | grep usb" command returns absolutely nothing, even with at least one busy serial port ?

amundsen:
Is it normal that the "ls -las | grep usb" command returns absolutely nothing, even with at least one busy serial port ?

I'm not sure what the intent of that command was.

I'd recommend what I explained in my post:
"lsof | grep usb"
which will list all open serial ports (devices are given file handles, which is why the list of open files command works)

or

"ls -l /dev/ | grep usb"

Which will tell you if an active serial port is available.