Sorry, if I do
machine1> screen /dev/ttyS0
machine2> mgetty /dev/ttyUSB0
... then I just get some weird ascii characters on machine1.
That does not work at all. Besides this I would like to run any program
over the serial line, not just a login shell which may be too powerful
and/or a security risk.
On the other hand I have retried running bash redirected with fd
0,1,2 to /dev/ttyUSB0 and screen /dev/ttyS0 on the other machine;
I can do
crtl^a + :exec stty -a
crtl^a + :exec stty onlcr
crtl^a + :exec stty -a
and the second time stty -a will show me its output correctly.
Unfortunately that does not apply to characters echoed from the serial
line. Setting onlcr on /dev/ttyUSB0 was without effect and inlcr on
/dev/ttyS0 would not do the same as inlcr is not symmetric towards onlcr.
There must be two tty-s involved with screen. One the process
executed by screen sees and the other that screen uses itself for its
output. How to apply stty on the right one of these pseudoterminals?
Last but not least I have a related question.
Where is it documented what > screen /dev/ttyS0 does?
I can´t see anything in the manual page. It only gives command lines to
reattach and to run a program other than bash. What program is run at
all if I enter > screen /dev/ttyS0? Why can I not make screen execute a
program like bash or top and send its output over /dev/ttyUSB0 at the
same time?
Elmar
Am 25.05.22 um 13:26 schrieb Elmar Stellnberger:
I have now installed mingetty and mgetty but I have no clue on how to
use these programs. If I run mingetty from an X11-console it lets me
enter characters but nothing else, no matter what I specify for
--loginprog. If I do a mingetty /dev/tty7 I can enter a few characters
on that terminal before mingetty terminates.
???
Am 25.05.22 um 07:27 schrieb david kerns:
Typically, you run getty on one computer (the host), then screen (or
some other terminal emulator) on the second.
getty will prompt you for a login/password and then spawn a shell.
I suppose you could just spawn a shell directly (from systemctl), but
that is, obviously, insecure.
Ultimately, what you're seeing is an issue with canonical processing.
The "host" of the connection usually "echos" back each character sent
to it.
On Tue, May 24, 2022 at 5:57 PM Elmar Stellnberger via screen-devel
<screen-devel@gnu.org <mailto:screen-devel@gnu.org>> wrote:
Dear maintainers of screen
Today I wanted to connect two machines using screen:
machine1> screen /dev/ttyS0
machine2> screen /dev/ttyUSB0
The problem about it is that \n does not go to the beginning of
a new
line but merely one line below without carriage return. I have
tried to
set onlcr with stty but that does not help. Also I have played with
TERM=putty and screen.putty but could not resolve the issue.
I have discovered the same issue with
machine1> screen /dev/ttyS0
machine2> echo hugo >/dev/ttyUSB0
The goal would of course be to run bash on one computer and
screen on
the other:
machine1> screen /dev/ttyS0
machine2> TERM=screen.putty bash </dev/ttyUSB0 >/dev/ttyUSB0
2>/dev/ttyUSB0 & echo $!
Same problem here: '\n' does not do an additional carriage
return as
required.
Anyone here who can help me?
Elmar Stellnberger