You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

How do I free a busy tty device?

Question:

Using the 'screen' command in terminal, I get the error "cannot open line '/dev/tty.usbserial' for R/W: resource busy". How do I release or free this resource?


Background:

I am connecting to a Raspberry Pi UART via a MAX3232 serial to TTL converter module. The RS232 serial port on my iMac is provided via a Prolific USB to Serial adaptor. Using a terminal window, I entered "screen /dev/tty.usbserial 115200". The first time I did this,and booted the raspberry pi, i got many beeps and scrolling blank spaces (eg there was some sort of connection, good). I then didn't know how to exit screen, so I command Q'd the session. Now when i re-open the session, and use 'screen' again, I get the error as stated above. I realise turning it off and on again will probably do it, but am after a commnad.


Cheers,


Les.

iMac, OS X Mavericks (10.9.2)

Posted on Apr 10, 2014 6:38 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 14, 2014 1:38 PM

From terminal, run:


lsof | grep usbserial


If the port is in use, you will get a response like this (otherwise it will return nothing):


screen 27127 Sefi 5u CHR 18,0 0t0 605 /dev/tty.usbserial


Note the session number. In my case, it's 27127. Then run:


screen -x 27127 (obviously use your session number from the grep)


It will return you to your previous screen session. Then use ctr-A ctr-\ to close it properly (will ask you to confirm).

2 replies
Question marked as Top-ranking reply

Jun 14, 2014 1:38 PM in response to Les 76

From terminal, run:


lsof | grep usbserial


If the port is in use, you will get a response like this (otherwise it will return nothing):


screen 27127 Sefi 5u CHR 18,0 0t0 605 /dev/tty.usbserial


Note the session number. In my case, it's 27127. Then run:


screen -x 27127 (obviously use your session number from the grep)


It will return you to your previous screen session. Then use ctr-A ctr-\ to close it properly (will ask you to confirm).

Oct 30, 2017 12:50 PM in response to Les 76

I realize that this is several years old now, but I just ran into this today. To fix the resource busy message, you should be able to go to activity monitor and terminate the "screen" processes. This will release the screen process for you to be able to connect again.


I ran into the same problem with the blank screen as well. I was usually able to hit the enter key enough times and it would eventually show me a login prompt. I think a bad cable or interface is typically the issue with the serial connection but I can't be sure about that one.

How do I free a busy tty device?

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