I am trying to use
screen /dev/ttyUSB0
to connect to a old computer(s) through a USB-serial interface.
I have not figured out to put the correct options in my command line to get a non-gibberish feedback from my computer (the text received is all screwed up).
My operating system is CentOS, with GNOME 2.16.0.
I see that there is a program called KPPP which has a "Terminal...", but I haven't figured that one out either. So I am trying to use CLI with 'screen', but I am having trouble setting the correct parameters (obviously, I do not understand how to put these parameters to use with stty). It is not an option installing applications or doing anything with this computer, so I have to use what's already there. 'screen' seems to do the job, but the text received is gibberish as mentioned earlier ("$$@%idj ldj", etc.)
I need these parameters for computer one:
Baud: 9600 Databit: 8 Parity: No Stopbit: 2 Flow control: Hardware.
For computer two I need:
Baud: 9600 Databit: 7 Parity: Even Stopbit: 1 Flow control: Hardware
The baud rate is easy;
screen /dev/ttyUSB0 9600
But what to do with the rest, I do not know. I have found the option for stop bits:
cstopb (use two stop bits)
-cstopb (use one stop bits)
But how do I use it correctly?
screen /dev/ttyUSB0 9600 -cstopb
or
screen /dev/ttyUSB0 9600,-cstopb
How can I connect to the other computer through serial interface with all of the listed parameters?
I have found this manual for stty.
Is databit the same as this option?
cs5 cs6 cs7 cs8
Select character size (see termio(M)).
Parity:
parodd (-parodd)
Select odd (even) parity.
Stopbit:
cstopb (-cstopb)
Use two (one) stop bits per character.
But what about hardware control?
Anyway; this is still not working;
screen /dev/ttyUSB0 9600 cs8 oddp cstop
or
screen /dev/ttyUSB0 9600 cs7 evenp -cstop
I don't think Screen has support for all these different serial port settings. Only the most basic parameters are supported. You're already in the correct direction by looking at the stty manual, but you have to use stty as a separate tool from Screen: First you configure your serial port, and then you connect to it using Screen.
To configure your serial port for computer 1:
After you've configured your port, you can start using it trough screen:
The same applies for your second computer:
Then you can launch Screen at 9600 baud:
This should do the trick. You can find much more configuration options in the help of stty: