Menu
A lot of those don't have a traditional console, like a monitor and keyboard. Instead, the console is often routed to the serial port. In order to take advantage of this, some post-install configuration is necessary. This howto can also be used to setup a serial console on an existing headless server as a backup for administering the machine. Linux Serial Console¶ To use a serial port as console you need to compile the support into your kernel - by default it is not compiled in. For PC style serial ports it's the config option next to menu option: Character devices ‣ Serial drivers ‣ 8250/16550 and compatible serial support ‣ Console on 8250/16550 and compatible serial port. One caveat is that the grub serial console portion does not function since this is a USB port and the driver is not loaded until the kernel boots. For my installation, I am running the following: CentOS Linux 7.1.1503 (Core) x8664 Minimal install efi partition Setup tty0 console and ttyUSB0 serial console: Since this is a CentOS efi.
An Arch Linux machine can be configured for connections via the serial console port, which enables administration of a machine even if it has no keyboard, mouse, monitor, or network attached to it.
For rpm based distro such as RHEL / Fedora / CentOS Linux, enter: # yum install minicom Run minicom as follows to create a configuration file: # minicom -s -c on Press down key and select Serial port setup: Fig.01: Setting up minicom serial port. Press A to setup serial device name such as /dev/ttyS0; Press E to setup Bps/Par/Bits (baud rate). The serial console is helpful for CUI environment. An embedded system which has no monitor display like router can be operated by serial console with RS232C. A virtual machine like KVM + libvirt can be operated by serial console with CUI tools like virsh.
Installation of Arch Linux is possible via the serial console as well.
A basic environment for this scenario is two machines connected using a serial cable (9-pin connector cable).The administering machine can be any Unix/Linux or Windows machine with a terminal emulator program (PuTTY or Minicom, for example).
The configuration instructions below will enable boot loader menu selection, boot messages, and terminal forwarding to the serial console.
Configure console access on the target machineBoot loaderLinux Screen SerialGRUB
When using GRUB with a generated
grub.cfg , edit /etc/defaults/grub and enable serial input and output support:
Next add the
GRUB_SERIAL_COMMAND variable and set the options for the serial connection. For COM1 (/dev/ttyS0 ) with baud rate of 115200 bit/s:
Read GRUB's manual on Using GRUB via a serial line and the serial command for detailed explanation of the available options.
GRUB Legacy
Edit the GRUB Legacy configuration file
/boot/grub/menu.lst and add these lines to the general area of the configuration:
Note: When the
terminal --timeout=5 serial console line is added to your menu.lst , 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.
rEFInd
rEFInd supports serial console only in text mode. Edit
refind.conf and uncomment textonly .
Syslinux
To enable serial console in Syslinux, edit
syslinux.cfg and add SERIAL as the first directive in the configuration file.
For COM1 (
/dev/ttyS0 ) with baud rate of 115200 bit/s:
The serial parameters are hardcoded to 8 bits, no parity and 1 stop bit.[1]. Read Syslinux Wiki:Config#SERIAL for the directive's options.
Kernel
Kernel's output can be sent to serial console by setting the
console= kernel parameter. The last specified console= will be set as /dev/console .
Homebuilt autogyro plans free pdf. See https://www.kernel.org/doc/Documentation/admin-guide/serial-console.rst.
getty
At boot, systemd-getty-generator(8) will start a getty instance for each console specified in the kernel command line.
If you have not configured
console= in kernel command line startserial-getty@device.service . For /dev/ttyS0 (COM1) that would be [email protected] . Enable the service to start it at boot.
Unless specified otherwise in the kernel command line, getty will be expecting 38400 bit/s baud rate, 8 data bits, no parity and one stop bit-times.
Making ConnectionsConnect using a terminal emulator program
Note: Before making a connection, it is recommended to add your user to the
uucp group. Otherwise you will need root's permission to make a connection:See Users and groups#User groups for details.
Perform these steps on the machine used to connect the remote console.
Command linedterm
dtermAUR is a tiny serial communication program. 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:
See its homepage[2] for more examples.
Minicom![]()
minicom can be obtained from the official repositories. Start Minicom in setup mode:
Using the textual navigation menu, change the serial port settings to the following:
Paint tool sai free all brushes. Press Enter to exit the menus (pressing Esc will not save changes).Remove the modem Init and Reset strings, as we are 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.Restart minicom with the serial cable connected to the target machine.To end the session, press Ctrl+A followed by Ctrl+X .
picocomLinux Serial Connection
picocom is a tiny dumb-terminal emulation program that is very like minicom, but instead of mini, it is pico. The following example connect to
ttyS0 at 9600 bps:
Note: if the backspace key won't work properly try out this option: '--omap delbs'
See its manual for detailed usage.
Screen
GNU Screen is able to connect to a serial port. It will connect at 9600 baud by default:
A different baud rate (e.g. 115200) may be specified on the command line.
To end the session, press
Ctrl+a followed by K . Alternatively, press Ctrl+a , type :quit and confirm it by pressing Enter .
Serialclient
Serialclient[3] is a CLI client for serial connection written in ruby. Install it with the following:
Then, you can use like this:
And, for Windows
On Windows machines, connect to the serial port using programs like PuTTY[4] or Terminalbpp[5].
Graphical front-ends
cutecomAUR is another gui enabled serial monitor.
World of subways 3 free. putty is also available for Linux.
moserial is a gtk-based serial terminal, primarily intended for technical users and hardware hackers who need to communicate with embedded systems, test equipment, and serial consoles.
Installing Arch Linux using the serial console
Note: The Arch Linux monthly release(i.e. the installation CD)'s boot loader has been configured[6] to listen on 0 port(
ttyS0 /COM1) at 38400 bps, with 8 data bits, no parity bit and 1 stop bit-times.
Note: After setup is complete, the console settings will not be saved on the target machine; in order to avoid having to connect a keyboard and monitor, configure console access on the target machine before rebooting.
Note: While a port speed of 9600 is used in most of the examples in this document, working with higher values is recommended (List of available speeds is displayed in Minicom by pressing 'Ctrl-A' and then 'P')
TroubleshootingCtrl-C and Minicom
If you are having trouble sending a Control-C command through minicom you need to switch off hardware flow control in the device settings (minicom -s), which then enables the break.
Resizing a terminal
Unlike ssh, serial connections do not have a mechanism to transfer something like
SIGWINCH when a terminal is resized. This can cause weird problems with some full-screen programs (e.g. less ) when you resize your terminal emulator's window.
Resizing the terminal via
stty is a workaround:
However, this requires you to manually input the proper geometry. The following methods should be simpler.
1. There is a lesser-known utility called
resize , shipped with xterm, that can solve this problem. Invoke it without parameters after you resize the terminal emulator's window:
2. If you don't want to install xterm, it is possible to do the same work via a shell function. Put the following function into your zshrc and invoke it without parameters after resizing the terminal emulator's window:
Retrieved from 'https://wiki.archlinux.org/index.php?title=Working_with_the_serial_console&oldid=579022'
How to use the APF's serial ports on Linux.
Generalities
On Linux, all serial ports are driven the same way. Only their device nodes are changing to reflect the port type:
Console port
Changing serial ports configuration
Sending/Receiving dataIn Linux console
With terminal (miniterm.py)
By default, a simple terminal named «miniterm.py» is installed in the BSP. To use it on OPOS6UL, launch it with /dev port name and speed :
On OPOS6UL_DEV if Rx/Tx are not in loop, nothing will be prompted on key input. To see something prompted the Rx/Tx must be plugged together with a jumper on RaspberryPi connector (pin 8 and 10).
Statistics
Links
Retrieved from 'http://www.armadeus.org/wiki/index.php?title=Serial_ports_usage_on_Linux&oldid=14638'
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |