Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do you free a "busy serial port"

When I try to use a terminal program to access a serial port, i get the message that the serial port is busy. There is nothing currently using the port, how to i tell the os that the port is not busy?

MacBook Air, OS X Mountain Lion (10.8)

Posted on Aug 23, 2012 5:18 PM

Reply
Question marked as Best reply

Posted on Nov 19, 2012 3:46 AM

Unless you've got experience with the actual issue at hand, trying to explain to someone why they are wrong in asking a question is most unhelpful. Let me describe a scenario so you can offer specific knowledge if you have any.


If you have a device connected to the USB port of any Mac and there is appropriate driver support for the device to do so, it is mapped to a dynamically created serial device in the /dev directory. Generally, if you unplug the device, the associated /dev entry is removed. However, if the device is in use when unplugged, or if an app terminates and fails to close/release the device, it is very often the case that the the /dev entry continues to be recognized as in use by OS X.


This is a common annoyance that seems to only be fixable with a reboot. lsof doesn't indicate any processes using the /dev file (let's use /dev/tty.usbmodem1d21 as an example, since that's the device that becomes active with an Arduino Uno plugged directly into an on-board USB port). Once the /dev/tty.usbmodem1d21 device becomes busy due to some software/O/S failure, it stays that way.


I believe the question being asked is "Is there a way to reset the busy status of what appears to be an open /dev device or file descriptor that doesn't require a reboot?"


It doesn't matter if the device is plugged in or not. Added, removed, whatever. The device stays busy at the O/S level. It's not a difficult question convey. I understood this to be what the original poster was asking, but it seems like the responses so far want to answer some other unspecified question or find fault with the questioner.


Do you know the answer to THIS question?

6 replies
Question marked as Best reply

Nov 19, 2012 3:46 AM in response to LousyFool

Unless you've got experience with the actual issue at hand, trying to explain to someone why they are wrong in asking a question is most unhelpful. Let me describe a scenario so you can offer specific knowledge if you have any.


If you have a device connected to the USB port of any Mac and there is appropriate driver support for the device to do so, it is mapped to a dynamically created serial device in the /dev directory. Generally, if you unplug the device, the associated /dev entry is removed. However, if the device is in use when unplugged, or if an app terminates and fails to close/release the device, it is very often the case that the the /dev entry continues to be recognized as in use by OS X.


This is a common annoyance that seems to only be fixable with a reboot. lsof doesn't indicate any processes using the /dev file (let's use /dev/tty.usbmodem1d21 as an example, since that's the device that becomes active with an Arduino Uno plugged directly into an on-board USB port). Once the /dev/tty.usbmodem1d21 device becomes busy due to some software/O/S failure, it stays that way.


I believe the question being asked is "Is there a way to reset the busy status of what appears to be an open /dev device or file descriptor that doesn't require a reboot?"


It doesn't matter if the device is plugged in or not. Added, removed, whatever. The device stays busy at the O/S level. It's not a difficult question convey. I understood this to be what the original poster was asking, but it seems like the responses so far want to answer some other unspecified question or find fault with the questioner.


Do you know the answer to THIS question?

Nov 18, 2012 3:31 PM in response to Retired Engineer

A MacBook Air has USB ports (guess what the "S" stands for?) I am guessing the question is "how do I release a serial device marked as busy in /dev?" There are plenty of devices that can be connected via USB that show up as virtual serial devices in /dev, so this is a completely valid question. Unfortunately, I don't know the answer either, and am looking for it myself.

Nov 19, 2012 3:27 AM in response to cshotton

...however, since the OP is stating that "there is nothing currently using the port", I assume he has nothing connected to whatever physical serial port he is referring to.


Making it an oxymoron, IMHO:

Why would the OP want or need to access a serial port without anything being connected? Maybe the port is busy looking for a device?

If something is connected, why should the port not be busy? If it's a process, it can be killed.


Or am I overlooking something?


Anyway, I second "Retired Engineer", more specific info on what the OP is up to would be good to have, if not necessary. Meanwhile the answer is, "it depends..."

How do you free a "busy serial port"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.