2014-10-01

‎Making Connections: add uucp group note

← Older revision

Revision as of 06:06, 1 October 2014

Line 18:

Line 18:

If you configure the serial console in GRUB2 systemd will create a getty listener on the same serial device as GRUB2 by default. So, this is the only configuration needed for Arch running with systemd. To make grub enable the serial console, open {{ic|/etc/default/grub}} in an editor.

If you configure the serial console in GRUB2 systemd will create a getty listener on the same serial device as GRUB2 by default. So, this is the only configuration needed for Arch running with systemd. To make grub enable the serial console, open {{ic|/etc/default/grub}} in an editor.

Change the {{ic|GRUB_CMDLINE_DEFAULT}} line to start the console on {{ic|/dev/ttyS0}}. Note in the example below, we set two consoles up; one on tty0 and one on the serial port.

Change the {{ic|GRUB_CMDLINE_DEFAULT}} line to start the console on {{ic|/dev/ttyS0}}. Note in the example below, we set two consoles up; one on tty0 and one on the serial port.



GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,38400n8"

+

GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,38400n8"

Now we've got to tell grub what command to start in order to enable the serial console:

Now we've got to tell grub what command to start in order to enable the serial console:



# Serial console

+

#
# Serial console



GRUB_TERMINAL=serial

+

GRUB_TERMINAL=serial



GRUB_SERIAL_COMMAND="serial --speed=38400 --unit=0 --word=8 --parity=no --stop=1"

+

GRUB_SERIAL_COMMAND="serial --speed=38400 --unit=0 --word=8 --parity=no --stop=1"



Rebuild the grub.cfg file

+

Rebuild the grub.cfg file
with following command:



# grub-mkconfig -o /boot/grub/grub.cfg

+

# grub-mkconfig -o /boot/grub/grub.cfg

After a reboot, getty will be listening on {{ic|/dev/ttyS0}}, expecting 38400 baud, 8 data bits, no parity and one stop bit. When Arch boots, systemd will automatically start a getty session to listen on the same device with the same settings.

After a reboot, getty will be listening on {{ic|/dev/ttyS0}}, expecting 38400 baud, 8 data bits, no parity and one stop bit. When Arch boots, systemd will automatically start a getty session to listen on the same device with the same settings.

Line 34:

Line 34:

Ignore this entire section if you have configured GRUB2 to listen on the serial interface. If you do not want GRUB2 to listen on the serial device, but only want getty listening after boot then follow these steps.

Ignore this entire section if you have configured GRUB2 to listen on the serial interface. If you do not want GRUB2 to listen on the serial device, but only want getty listening after boot then follow these steps.



To start getty listening on {{ic|/dev/ttyS0}} use systemctl

+

To start getty listening on {{ic|/dev/ttyS0}} use systemctl
:



systemctl start getty@ttyS0.service

+



You can check to see the speed(s) getty is using with
systemctl
, but should be 38400 8N1

+

#
systemctl
start getty@ttyS0.service



systemctl status serial-
getty
@ttyS0.service

+

You can check to see the speed(s)
getty
is using with systemctl, but should be 38400 8N1:



To have
getty
listening on {{ic|/dev/
ttyS0
}} every boot, enable the service for that specific port
.

+

# systemctl status serial-
getty
@
ttyS0.
service



systemctl enable serial-
getty
@
ttyS0
.
service

+

To have
getty
listening on {{ic|/dev/
ttyS0
}} every boot, enable the
service
for that specific port:



Now, after a reboot, getty will be listening on device {{ic|/dev/ttyS0}} expecting 38400 baud, 8 data bits, no parity and one stop bit

+

# systemctl enable serial-getty@ttyS0.service

+

+

Now, after a reboot, getty will be listening on device {{ic|/dev/ttyS0}} expecting 38400 baud, 8 data bits, no parity and one stop bit
-times.

====GRUB v1 and No systemd====

====GRUB v1 and No systemd====

Edit the GRUB config file {{ic|/boot/grub/menu.lst}} and add these lines to the general area of the configuration:

Edit the GRUB config file {{ic|/boot/grub/menu.lst}} and add these lines to the general area of the configuration:



serial --unit=0 --speed=9600

+

serial --unit=0 --speed=9600



terminal --timeout=5 serial console

+

terminal --timeout=5 serial console

Add suitable console parameters (e.g. change the serial device name or baud rate if required) at the end of your current kernel line:

Add suitable console parameters (e.g. change the serial device name or baud rate if required) at the end of your current kernel line:



console=tty0 console=ttyS0,9600

+

console=tty0 console=ttyS0,9600

For example, the kernel line should look something like this after modification:

For example, the kernel line should look something like this after modification:



kernel /vmlinuz-linux root=/dev/md0 ro md=0,/dev/sda3,/dev/sdb3 vga=773 console=tty0 console=ttyS0,9600

+

kernel /vmlinuz-linux root=/dev/md0 ro md=0,/dev/sda3,/dev/sdb3 vga=773 console=tty0 console=ttyS0,9600

{{note|When the {{ic|<nowiki>terminal --timeout=5 serial console</nowiki>}} line is added to your menu.lst grub configuration, your boot sequence will now show a series of "Press any key to continue"  messages.  If no key is pressed, the boot menu will appear on whichever (serial or console) appears first in the 'terminal' configuration line.  The lines will look like this upon boot:}}

{{note|When the {{ic|<nowiki>terminal --timeout=5 serial console</nowiki>}} line is added to your menu.lst grub configuration, your boot sequence will now show a series of "Press any key to continue"  messages.  If no key is pressed, the boot menu will appear on whichever (serial or console) appears first in the 'terminal' configuration line.  The lines will look like this upon boot:}}

Line 74:

Line 75:

Next, we have to edit {{ic|/etc/inittab}} and add a new agetty line below the existing ones:

Next, we have to edit {{ic|/etc/inittab}} and add a new agetty line below the existing ones:



c0:2345:respawn:/sbin/agetty 9600 ttyS0 linux

+

c0:2345:respawn:/sbin/agetty 9600 ttyS0 linux

Edit {{ic|/etc/securetty}} and add an entry for the the serial console, ''below the existing entries'':

Edit {{ic|/etc/securetty}} and add an entry for the the serial console, ''below the existing entries'':



ttyS0

+

ttyS0

Reboot.

Reboot.

Line 87:

Line 88:

===Connect using a terminal emulator program===

===Connect using a terminal emulator program===

+

{{note|Before making a connection, it's recommend to add your user to the {{ic|uucp}} group. Otherwise you'll need root's permission to make a connection:

+

+

# gpasswd -a ''username'' uucp

+

+

See [[Users_and_groups#User_groups|Users and groups#User_groups]] for details.}}

Perform these steps on the machine used to connect the remote console.

Perform these steps on the machine used to connect the remote console.

Line 94:

Line 100:

{{Pkg|minicom}} can be obtained from the official repositories. Start Minicom in setup mode:

{{Pkg|minicom}} can be obtained from the official repositories. Start Minicom in setup mode:



minicom -s

+

$
minicom -s

Using the textual navigation menu, change the serial port settings to the following:

Using the textual navigation menu, change the serial port settings to the following:



Serial Device: /dev/ttyS0

+

Serial Device: /dev/ttyS0



Bps/Par/Bits: 9600 8N1

+

Bps/Par/Bits: 9600 8N1

Press Enter to exit the menus (pressing Esc will not save changes).

Press Enter to exit the menus (pressing Esc will not save changes).



Remove the modem Init and Reset strings, as we're not connecting to a modem. To do this, under the
'
Modem and Dialing
'
menu, delete the Init and Reset strings. Optionally save the configuration by choosing
'
save setup as dfl
'
from the main menu.

+

Remove the modem Init and Reset strings, as we're not connecting to a modem. To do this, under the
{{ic|
Modem and Dialing
}}
menu, delete the Init and Reset strings. Optionally save the configuration by choosing
{{ic|
save setup as dfl
}}
from the main menu.

Restart minicom with the serial cable connected to the target machine.

Restart minicom with the serial cable connected to the target machine.



To end the session, press Ctrl+A followed by Ctrl+X.

+

To end the session, press
{{ic|
Ctrl+A
}}
followed by
{{ic|
Ctrl+X
}}
.

====dterm====

====dterm====



{{aur|dterm}} is a more lightweight alternative to minicom, it's available in AUR. If you invoke it without parameters, it will connect to /dev/ttyS0 at 9600 baud by default. The following example connect to /dev/ttyS0 at 115200 baud, with 8 data bits, no parity bit and 1 stop bit-times:

+

{{aur|dterm}} is a more lightweight alternative to minicom, it's available in AUR. If you invoke it without parameters, it will connect to
{{ic|
/dev/ttyS0
}}
at 9600 baud by default. The following example connect to
{{ic|
/dev/ttyS0
}}
at 115200 baud, with 8 data bits, no parity bit and 1 stop bit-times:



dterm 115200 8 n 1

+

$
dterm 115200 8 n 1

See its homepage[http://www.knossos.net.nz/resources/free-software/dterm/] for more examples.

See its homepage[http://www.knossos.net.nz/resources/free-software/dterm/] for more examples.

Line 118:

Line 124:

{{Pkg|screen}} is able to connect to a serial port. It will connect at 9600 baud by default:

{{Pkg|screen}} is able to connect to a serial port. It will connect at 9600 baud by default:



screen /dev/ttyS0

+

$
screen /dev/ttyS0

A different baud rate (e.g. 115200) may be specified on the commmand line.

A different baud rate (e.g. 115200) may be specified on the commmand line.

Line 127:

Line 133:

Serialclient[https://github.com/flagos/serialclient] is a client for serial connection in command line in your shell. Install it doing:

Serialclient[https://github.com/flagos/serialclient] is a client for serial connection in command line in your shell. Install it doing:



pacman -S ruby

+

#
pacman -S ruby



gem install serialclient

+

#
gem install serialclient

Then, you can use like this:

Then, you can use like this:



serialclient -p /dev/ttyS0

+

$
serialclient -p /dev/ttyS0

====Windows Options====

====Windows Options====

Show more