0

Using the terminology of ptys, the slave end connects to the CLI program and the master end connects to the user / keyboard / terminal emulator.

I have an FTDI USB UART connecting my laptop's USB port to an embedded computer's serial port. It appears on my laptop as /dev/ttyUSB0. My laptop is supposed to be the master end, and the embedded computer is supposed to be the slave end. But when I look at how /dev/ttyUSB0 behaves, it clearly thinks I'm the slave end. For instance, when the embedded computer sends a character to the laptop, the laptop send the character back again.

Is there a switch somewhere that tells the kernel driver that the laptop is the master, and not the slave?

1 Answer 1

0

I misunderstood the nature of the master end of a pty. The master end is not a tty. Not really. It looks like one when queried with stty, but the settings that stty returns are the settings for the slave end. They are exposed in the master end so that the master can change these settings. So, the idea of two types of tty, master and slave, is wrong.

To get /dev/ttyUSB0 to process the input and output as if it is coming to and from a user, I used the following, which also sets the line speed:

$ stty -F /dev/ttyUSB0 raw -echo 115200

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .