I'm developing on an embedded linux SBC (Mini2451) How do I enable the serial console? I've set it in the boot options: Linux-CommandLine = root=/dev/mtdblock2 rootfstype=yaffs2 init=/linuxrc console=ttySAC0,115200 vt.globalcursordefault=0 And also added it to the kernel configuration in boot options. But still no output. Could you assist please. The Linux console is a system console internal to the Linux kernel (a system console is the device which receives all kernel messages and warnings and which allows logins in single user mode). The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user.
Show Table of Contents This section describes how to configure
GRUB 2
for serial communications on machines with no display or keyboard. To access the
GRUB 2
terminal over a serial connection, an additional option must be added to a kernel definition to make that particular kernel monitor a serial connection. Where
console=ttyS0
is the serial terminal to be used, 9600
is the baud rate, n
is for no parity, and 8
is the word length in bits. A much higher baud rate, for example 115200
, is preferable for tasks such as following log files. For more information on serial console settings, see the section called “Installable and External Documentation”
To set the system to use a serial terminal only during a single boot process, when the GRUB 2 boot menu appears, move the cursor to the kernel you want to start, and press the e key to edit the kernel parameters. Remove the
rhgb
and quiet
parameters and add console parameters at the end of the linux16
line as follows: These settings are not persistent and apply only for a single boot.
26.9.2. Configuring GRUB 2 for a persistent change
To make persistent changes to a menu entry on a system, use the
grubby
tool. For example, to update the entry for the default kernel, enter a command as follows: The --update-kernel
parameter also accepts the keyword ALL
or a comma separated list of kernel index numbers. See the section called “Adding and Removing Arguments from a GRUB 2 Menu Entry” for more information on using grubby
. If required to build a new GRUB 2 configuration file, add the following two lines in the
/etc/default/grub
file: The first line disables the graphical terminal. Note that specifying the
GRUB_TERMINAL
key overrides values of GRUB_TERMINAL_INPUT
and GRUB_TERMINAL_OUTPUT
. On the second line, adjust the baud rate, parity, and other values to fit your environment and hardware. A much higher baud rate, for example 115200
, is preferable for tasks such as following log files. Once you have completed the changes in the /etc/default/grub
file, it is necessary to update the GRUB 2 configuration file. Rebuild the
grub.cfg
file by running the grub2-mkconfig -o
command as follows: - On BIOS-based machines, issue the following command as
root
: - On UEFI-based machines, issue the following command as
root
:
26.9.4. Using screen to Connect to the Serial Console
The screen tool serves as a capable serial terminal. To install it, run as
root
: To connect to your machine using the serial console, use a command in the follow format:
By default, if no option is specified, screen uses the standard 9600 baud rate. To set a higher baud rate, enter: Where console_port is
ttyS0
, or ttyUSB0
, and so on. To end the session in screen, press Ctrl+a, type
:quit
and press Enter. See the
screen(1)
manual page for additional options and detailed information. Active4 months ago
I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303.
I'm a beginner at minicom. Is this the correct command to execute? Or do I need to configure something?
Peter Mortensen14.5k1919 gold badges8989 silver badges118118 bronze badges
codingJoecodingJoe1,65199 gold badges3737 silver badges5656 bronze badges
10 Answers
First check with
dmesg | grep tty
if system recognize your adapter.Then try to run minicom with sudo minicom -s
, go to 'Serial port setup' and change the first line to /dev/ttyUSB0
. Don't forget to save config as default with 'Save setup as dfl'. It works for me on Ubuntu 11.04 on VirtualBox.
MatejMatej1,16111 gold badge1111 silver badges2424 bronze badges
You will need to set the permissions every time you plug the converter in.I use PuTTY to connect. In order to do so, I have created a little Bash script to sort out the permissions and launch PuTTY:
Linux Serial Console Character
P.S. I would never recommend that permissions are set to 777.
Peter Mortensen14.5k1919 gold badges8989 silver badges118118 bronze badges
McPartyMcParty
The serial port communication programs
moserial
or gtkterm
provide an easy way to check connectivity and modify /dev/ttyUSB0
(or /dev/ttyUSB1
!) settings. Even though there maybe only a single USB to RS232 adapter, the n
designation /dev/ttyUSBn
can and does change periodically! Both moserial
and gtkterm
will show what port designation is relevant in their respective pull down menus when selecting an appropriate port
to use.Check out help.ubuntu.com/community/Minicom for details on
minicom
.EkimEkim
I had fix this with
adduser *username* dialout
. I never had this error again, even though previously the only way to get it to work was to reboot the PC or unplug and replug the usb to serial adapter.RomanRoman
Long time reader, first time helper ;)
I'm going through the same
hellish
experience here with a Prolific USB <> Serial adapter and so far Linux is the easiest to get it to work.On CentOS, I didn't need to install any drivers etc. That said,
dmesg | grep -i tty
ordmesg | grep -i usb
showed me /dev/ttyUSB0.screen ttyUSB0 9600
didn't do the trick for me like it did in OSX- minicom is new to me but it was complaining about lack of /dev/modem
However, this helped: https://www.centos.org/forums/viewtopic.php?t=21271
So install minicom (
yum install minicom
) then enter its settings (minicom -s
). Then select
Serial Port Setup
and change the Serial Device (Option A) to /dev/ttyUSB0, or whatever your device file is as it slightly differs per distro. Then change the Bps (Option E) to 9600 and the rest should be default (8N1 Y N)
Save as default, then simply
minicom
and Bob's your uncle.HTH.
Sam GreadlySam Greadly
![Linux Serial Console Linux Serial Console](/uploads/1/2/5/0/125073023/875364394.jpg)
I get get the same minicom error, 'cannot open /dev/ttyUSB0: No such file or directory'
Three notes:
- I get the error when the device attached to the serial port end of my Prolific Technology PL2303 USB/Serial adapter is turned off. After turning on the device (an embedded controller running Linux) minicom connected fine.
- I have to run as super user (i.e. Asus vga graphics driver download.
sudo minicom
) - Sometimes I have to unplug and plug back in the USB-to-serial adapter to get minicom to connect to it.
I am running Ubuntu 10.04 LTS (Lucid Lynx) under VMware (running on Windows 7). In this situation, make sure the device is attached to VM operating system by right clicking on the USB/Serial USB icon in the lower right of the VMware window and select Connect (Disconnect from Host).
Remember to press Ctrl + A to get minicom's prompt, and type X to exit the program. Just exiting the terminal session running minicom will leave the process running.
Peter Mortensen14.5k1919 gold badges8989 silver badges118118 bronze badges
user1271729
I had the exact same problem, and it was fixed by doing a
Peter Mortensenchmod 777 /dev/ttyUSB0
. I never had this error again, even though previously the only way to get it to work was to reboot the VM or unplug and replug the USB-to-serial adapter. I am running Ubuntu 10.04 (Lucid Lynx) VM on OS X.14.5k1919 gold badges8989 silver badges118118 bronze badges
Joshua EtienneJoshua Etienne
I suggest that newbies connect a PL2303 to Ubuntu, chmod 777 /dev/ttyUSB0 (file-permissions) and connect to a CuteCom serial terminal. The CuteCom UI is simple intuitive. If the PL2303 is continuously broadcasting data, then Cutecom will display data in hex format
![Linux serial console usb Linux serial console usb](/uploads/1/2/5/0/125073023/209065835.png)
23911 gold badge44 silver badges2424 bronze badges
I just got my GUC232A cable with a molded-in PL2302 converter chip.
In addition to adding myself and br to group
dialout
, I found this helpful tip in the README.Debian file in /usr/share/doc/bottlerocket
:This package uses debconf to configure the /dev/firecracker symlink, should you need to change the symlink in the future run this command:
dpkg-reconfigure -pmedium bottlerocket
That will then prompt you for your new serial port and modify the symlink. This is required for proper use of bottlerocket.
I did that and voila! bottlerocket is able to communicate with my X-10devices.
Peter Mortensen14.5k1919 gold badges8989 silver badges118118 bronze badges
DexterIsMyHeroDexterIsMyHero
Putty on ubuntuThere is no need to install the driver for PL2303So only type the command to enable the puttySudo chmod 666 /dev/ttyUSB0DoneOpen the putty.
Nikhil ParasharNikhil Parashar