9

I insert the serial-USB convertor into my Mac.

and under the /dev I find the tty.wchusbserial1410.

but when I use screen to connect it:

screen /dev/tty.wchusbserial1410 9600

there get error:

Sorry, could not find a PTY.

aircraft
  • 820
  • 1
  • 8
  • 24

3 Answers3

17

Finally, I find the solution, there are a screen process not close normality.

So, in the Activity Monitor I closed it, then re-start the screen, it works.

aircraft
  • 820
  • 1
  • 8
  • 24
  • 3
    To kill from terminal you can. First re-attach from terminal run `screen -ls`. Then reconnect to session with `screen -r 49627` (where the number is the ID found with `screen -ls`). Then kill it properly with `cmd + a` and then press `k` for kill and `y` for yes. – TimNode Feb 19 '21 at 21:09
  • 1
    Or after `screen -ls` run `screen -XS 49627 quit` (where the number is the ID found with screen -ls). – TimNode Feb 19 '21 at 21:11
  • 1
    @TimNode thanks a lot, it worked like a charm. – Tien Do Sep 03 '22 at 09:37
2

In my case simply unplugging the device from the computer (i.e., USB to serial adapter) then plugging back in again cleared the issue.

Synexis
  • 121
  • 2
1

I had a similar problem and I attempted a number of different solutions. Just wanted to share what made it work for me.

Problem

Tried to use the screen program to connect my lab PC to a Raspberry PI via the USB ports and an RS232 cable.

Ran the command screen /dev/ttyUSB0

Got the following error messages in quick succession.

"Cannot access line '/dev/ttyUSB0 for r/w: permission denied"

"Couldn't find a PTY"

Attempted solutions

  1. I tried to look in the activity monitor to see if there are any processes running, and there was none. So this was not the problem.

  2. Tried to change the /dev/ptmx file permissions

Ran the command ls -l /dev/ptmx

Output crw-rw-rw- 1 root root 5, 2 "datetime" /dev/ptmx

So it looked like the permission were already set. So this was not the problem either.

  1. Tried to mount /dev/pts by running

sudo mount devpts /dev/pts -t devpts -o mode=620

I got the message that the mounting was already done. Move on.

  1. Finally found this idea of adding to the dialout group looking at this post.

https://askubuntu.com/questions/58119/changing-permissions-on-serial-port

Ran the command - sudo usermod -a -G dialout $USER

Restarted the computer and voila, it worked. Was able to use screen program to make the connection.

Spend a few hours to figure this out. Hope this helps someone out. Peace.