Activate RS232 for serial terminal

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

Activate RS232 for serial terminal

Postby mackowiakp » Jul 19th, '13, 19:35

In Mandriva /etc/inittab was active. So I can put in to the file line as shown below, to be able connect serial line terminal emulator like minicom.

Code: Select all
0:respawn:/sbin/agetty -L ttyS0 -H 19200 vt100


Can anybody what and where to have similar facility?

And next question - is any GUI for minicom? Or any other good serial line terminal emulator (VT100) with graphic interface?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Activate RS232 for serial terminal

Postby doktor5000 » Jul 19th, '13, 19:41

Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Activate RS232 for serial terminal

Postby mackowiakp » Jul 19th, '13, 21:35

According to Your links i try to enable login prompt at serial line, but system errors are reported. But the hardware seeams to be OK:

Code: Select all
[root@media Pobrane]# systemctl enable serial-getty@ttyS0.service
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
[root@media Pobrane]# setserial /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
[root@media Pobrane]# ps -t /dev/ttyS0
  PID TTY          TIME CMD
[root@media Pobrane]# ls -la /dev/ttyS0
crw------- 1 media tty 4, 64 lip 19 17:42 /dev/ttyS0
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Activate RS232 for serial terminal

Postby doktor5000 » Jul 19th, '13, 22:23

And what does your serial-getty@ttyS0.service contain currently?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Activate RS232 for serial terminal

Postby mackowiakp » Jul 19th, '13, 22:48

Yep. Right, Theres no such service in /etc/systemd/system/*.
I linked:

Code: Select all
ln -s /lib/systemd/system/serial-getty@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service


And in this moment I have:

Code: Select all
[root@media ~]# ps -t ttyS0
  PID TTY          TIME CMD
  652 ttyS0    00:00:00 agetty


Looks good
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Activate RS232 for serial terminal

Postby mackowiakp » Jul 19th, '13, 23:48

The content of serial-getty\@ttyS0.service file is:

Code: Select all
[root@media getty.target.wants]# cat serial-getty\@ttyS0.service
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service

# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes

[Service]
ExecStart=-/sbin/agetty -s -8 %I 19200 vt102
#ExecStart=-/sbin/agetty -s %I 115200,38400,19200,9600 vt100
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no

# Some login implementations ignore SIGTERM, so we send SIGHUP
# instead, to ensure that login terminates cleanly.
KillSignal=SIGHUP


And status shows:

Code: Select all
[root@media getty.target.wants]# systemctl status serial-getty@ttyS0.service
serial-getty@ttyS0.service - Serial Getty on ttyS0
          Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled)
          Active: active (running) since Fri, 2013-07-19 23:38:12 CEST; 6min ago
            Docs: man:agetty(8)
                  man:systemd-getty-generator(8)
        Main PID: 634 (agetty)
          CGroup: name=systemd:/system/serial-getty@.service/ttyS0
                  └ 634 /sbin/agetty -s -8 ttyS0 19200 vt102


My minicom is set to VT102 emulation, 19200 8N1

And minicon displays random characters. It I ryn agetty manually, minicom works OK.
Probably there is en error in serial-getty\@ttyS0.service file. Any idea?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Activate RS232 for serial terminal

Postby mackowiakp » Jul 20th, '13, 12:14

Finally it works. But
- only 9600 8N1 terminal communication settings works (minor problem)
- my national letters are not display properly, even in login prompt. For example word "passwaord" in translation to my language contains Polish letter

So that is serial port status:

Code: Select all
[root@media ~]# systemctl status serial-getty@ttyS0.service
serial-getty@ttyS0.service - Serial Getty on ttyS0
          Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled)
          Active: active (running) since Sat, 2013-07-20 11:47:40 CEST; 3s ago
            Docs: man:agetty(8)
                  man:systemd-getty-generator(8)
        Main PID: 3420 (agetty)
          CGroup: name=systemd:/system/serial-getty@.service/ttyS0
                  └ 3420 /sbin/agetty -s -8 -L ttyS0 115200 38400 9600 vt10.


After login from serial console. the LANG env looks correctly:

Code: Select all
[root@media ~]# echo $LANG
pl_PL.UTF-8


But Polish letter are no display properly. What is and error?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 0 guests