[Wolves] Serial terminal
Adam Sweet
drinky76 at yahoo.com
Wed Jul 20 21:37:38 BST 2005
--- James Turner <james at turnersoft.co.uk> wrote:
> > http://www.tldp.org/HOWTO/Text-Terminal-HOWTO.html
>
> The most relevant sections to setting up a basic
> terminal are 11.3 (physical
> connection) and 14 (software connection).
>
> Fundamental to the operation is running the getty
> command (or one of its
> varients like agetty, mgetty, mingetty, etc) on the
> serial port corresponding
> to the terminal (e.g. /dev/ttyS0). Some variants of
> getty are more suited to
> use with a serial terminal than others - see the
> HOWTO for various recommendations.
I went with agetty as per the recommendation in man
mgetty or mingetty (one of them, I forget now).
> To start off with, you may well be able to test
> things by running getty from the command line.
And that I did, I went through 3 gettys before I
settled on agetty, I guess I could have used others.
Worked a treat though I did have to add it to
/etc/inittab before I could log in without being
logged out on the local console, thereby cutting out
the agetty on the serial console.
> You may also need to use setserial and/or stty
> commands to configure the serial port.
Thankfully I didn't need to do this, I would have got
lost I think.
> Once things are working OK, you could transfer the
> settings into /etc/inittab
> so that the serial console is run on boot, and getty
> is re-run to display
> another login prompt when someone logs off, etc.
I added:
S1:2345:respawn:/sbin/agetty -h 57600 ttyS1 ansi
to inittab, to get it to use the various parameters
(and colours in midnight commander).
The following (until the last part) is left in for the
benefit of someone reading the thread in the future:
> More background info
> --------------------
>
> Traditionally, the getty program will send the
> contents of the /etc/issue file
> to the terminal (typically announcing the operating
> system type, etc)
> followed by the login prompt, for example:
>
> Fedora Core release 4 (Stentz)
> Kernel 2.6.11-1.1369_FC4smp on an i686
>
> login:
>
> After the user enters their user name, control is
> passed to /sbin/login to log
> the user on (which generally includes prompting for
> and checking the
> password). If all is well, login sets ownership on
> the TTY device
> (under /dev) and runs the user's choice of shell
> (e.g. /bin/bash) as
> specified in /etc/passwd, with the standard input,
> output and error streams
> directed to the TTY device. This behaviour is (or
> should be) very similar to
> the text-based console login, except that the input
> and output go to a serial
> port rather than the Linux console driver.
>
> Different types of terminal have different
> capabilities, as defined in
> the /etc/termcap file. Capabilities typically
> involve things like character
> sets, ability to move the cursor around at will
> (rather than just scrolling
> upwards all the time), changing text/background
> colour, etc. The terminal
> type connected to the serial port might be typically
> specified on the command
> line to run getty. Console-based programs can then
> use the TERM environment
> variable and look up the corresponding information
> in /etc/termcap to figure
> out how to display their user interface. (In
> practice this part would often
> be taken care of by the ncurses library or similar).
>
> I suggest starting out with terminal type "dumb" or
> "vt100" unless you know
> the correct setting for your terminal, then
> experimenting. Software
> applications which emulate a terminal such as
> minicom or Hyperterminal (under
> Windows) usually have settings for changing the
> emulated terminal type. Just
> make sure both ends are configured the same and
> ideally the "best" (most
> capable) type supported.
</left in for archive>
> > Can anyone tell me what parameters I need to know
> > (apart from the outgoing serial port on the server
> -
> > ttyS1)
>
> Depends on the getty program being used, typically
> the serial port, terminal
> type at the other end and serial communication
> settings - speed, data format
> (7 or 8 data bits) and parity.
After my afternoon of faffing prior the original email
and then my work today, it became obvious that most of
these parameters are default. It is of course
important to remember to specify the correct serial
port... Then make sure the line speed is set the same
at each end.
> > , what files I need to edit
>
> Start off entering commands from the console prompt,
> then transfer
> to /etc/inittab (and maybe /etc/ttytype, if
> required). If you need any extra
> commands such as setserial, these could go in
> /etc/rc.d/rc.local once you've
> got them worked out.
>
> > and recommednations for a terminal emulator
> > (minicom/telix/hyperterminal/seyon etc.
>
> Hyperterminal is a bit slow and clunky, with limited
> terminal capabilities.
Hyperterminal was shit, it was ok when in the BIOS,
but lost the plot when doing anything complicated to
do with unix terminals, like using midnight commander
where colours and things come in to play.
> Minicom seems a bit more capable. Not used the
> others but any of them are probably fine.
I didn't want to use minicom today because it looked
too damn complicated. It's a bugger to get used to,
but then after playing with hyperterminal and a few
others, I ended up taking another look. I also used
gtkterm which was nice but flaky and crashed
completely when trying to use the BIOS.
I ended up returning to minicom with a bit more
knowledge and managed to work out how to change the
settings and also understand that when it starts
talking about a modem it doesn't necessarily mean it
;)
I take all accusations of laziness on the chin, sorry,
I just took one look at 17 chapters on something that
theoretically should take 2 minutes to set up and
realised I wouldn't be able to work out what I needed
to know.
> Hope this helps,
James you're a star, that was great (hence why I left
most of it in for the benefit of the archive) and must
have taken you ages to write. Thanks a lot and to Dave
and Woo too, thanks guys.
I'll have to bother you with my sendmail problem next
;)
Ad
--
http://www.drinky.org.uk
http://blog.drinky.org.uk
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
More information about the Wolves
mailing list