You are on page 1of 18

Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

About
Contact us
Forums
Home
Linux How-to & Tutorials
Shell Scripts
RSS/Feed

nixCraft

Linux / UNIX minicom Serial Communication


Program
by nixCraft on February 5, 2008 · 39 comments· LAST UPDATED February 5, 2008

in Hardware, Howto, Linux

Linux comes with many serial text and gui based serial communication programs. My
favorite is minicom - friendly menu driven serial communication program.

If you are addicted to DOS / Windows TELIX (a telecommunications program originally


written for DOS and was released in 1986), minicom is for you under Linux / UNIX.

minicom Common features / usage


=> Setting up a remote serial console
=> Access a computer / server if the LAN is down
=> Connect to embedded Linux / BSD device via null modem cable
=> Connect to Cisco routers for configuration
=> Connect to dump device i.e. device w/o keyboard and mouse
=> Dialing directory with auto-redial
=> Support for UUCP-style lock files on serial devices
=> Separate script language interpreter
=> Capture to file
=> Multiple users with individual configurations

Let us see how to configure minicom for my Soekris net4801 Single Board Computer / embedded Linux device.

Install minicom
Use apt-get under Debian / Ubuntu Linux, enter:
$ sudo apt-get install minicom
If you are using Red hat Linux (RHEL) / CentOS / Fedora Linux, enter:
# yum install minicom

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 1 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

How do I use minicom?


First, make sure Linux has detected serial ports. Use setserial command to set and/or report the configuration
information associated with a serial port.

Setup minicom
The -s option use to setup minicom. Type the following command at shell prompt:
$ minicom -s

(Fig. 01: minicom in configuration mode)


Some terminals such as the Linux console support color with the standard ANSI escape sequences. Type the
following command start minicom with colours:
$ minicom -s -c on

(Fig: 02: minicom in configuration mode with color console)


When minicom starts, it first searches the MINICOM environment variable for command-line arguments, which
can be over-ridden on the command line. Thus, if you have done:
$ export MINICOM="-m -c on"
Start minicom
$ minicom
minicom will assume that your terminal has a Meta or key and that color is supported. You can add MINICOM
variable to your shell startup script such as ~/.bash_profile.

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 2 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

minicom keyboard short cut keys

Use the following keys:

1. UP arrow-up or k
2. DOWN arrow-down or j
3. LEFT arrow-left or h
4. RIGHT arrow-right or l
5. CHOOSE (select menu) Enter
6. CANCEL ESCape

Configure serial port

You need to configure serial port. Use up and down arrows to select menus. Press down and select Serial port
setup:

(Fig. 03: Configure serial port with minicom)

Press A to setup serial device name such as /dev/ttyS1


Press E to setup Bps/Par/Bits
Press [ESC] to exit
Save setup as DFL
Exit

More on shortcut keys

To activate help menu press [CTRL+A] followed by [Z] for help on special keys:

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 3 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

(Fig: 04: minicom command help summary)

minicom in action
You need to connect your serial device such as router or modem using modem cable. Once connected power on
device and type minicom command without -s option:
$ minicom -c on

(Fig: 05: minicom connected to one of my embedded Linux device via null modem cable [ click to enlarge
image])
The soekris embedded Linux / BSD board with AMD 266 Mhz CPU + 256M RAM. This device connected to
my computer using DB9 null modem cable. During the development you need to use minicom to install Linux
kernel, format filesystem and configure device.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!


Featured Articles:

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 4 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

30 Cool Open Source Software I Discovered in 2013


30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
Top 30 Nmap Command Examples For Sys/Network Admins
25 PHP Security Best Practices For Sys Admins
20 Linux System Monitoring Tools Every SysAdmin Should Know
20 Linux Server Hardening Security Tips
Linux: 20 Iptables Examples For New SysAdmins
Top 20 OpenSSH Server Best Security Practices
Top 20 Nginx WebServer Best Security Practices
20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
15 Greatest Open Source Terminal Applications Of 2012
My 10 UNIX Command Line Mistakes
Top 10 Open Source Web-Based Project Management Software
Top 5 Email Client For Linux, Mac OS X, and Windows Users
The Novice Guide To Buying A Linux Laptop

{ 39 comments… read them below or add one }

1 Marco February 5, 2008 at 9:27 am

Hi,
I use minicom to connect to Solaris host, recently I got some problems because minicom send somenthing
on the wire that the host fell like a break signal going down to the obp(fortunatly didn’t happen on a
production system). I already removed all the intitializtion strings…Any ideas?
Thanks
Cheers
M

Reply

2 gmo February 12, 2008 at 10:12 am

Marco,
If you do “man minicom”, you’ll find lots of options. I would suggest starting minicom with -o.

As a side note, I recommend kermit over minicom, it’s way better, as long as you create your own .kermrc
containing the options you usually use.

Reply

3 Doudou August 3, 2010 at 5:39 pm

hi,

I want to ask you the relationship between comgt and minicom. When i execute the command
comgt, why I can find the information in the minicom window ?

Thanks.

Reply

4 Dave Uhring February 12, 2008 at 12:35 pm

Marco needs to edit /etc/default/kbd on his Solaris system to prevent such accidental breaks. Uncomment
the line:

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 5 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

KEYBOARD_ABORT=alternate

Reply

5 Net savant March 14, 2008 at 2:14 pm

I am using a health checkup machine, connected to my redhat linux 4 system with minicom 2.0.0,which
sends data to serial port in a hexadecimal format only when it receives a command of 0×68 from the PC. i
had tried using stty -F /dev/ttyS0 9600 -parenb cs8 -cstopb but while using cat not getting anything from
the port. tried using echo “0×68! > /dev/ttyS0 but in vain. I had tried minicom by configuring it to
/dev/ttyS1 and also to /dev/ttyS0 but minicom is showing offline. i am unable to decide the serial port
because i have only one serial port which is being used for mouse. to the same port i had connected the
machine by unplugging the mouse. Please help me out.
Thanks in advance

Reply

6 panna May 6, 2008 at 7:09 am

hi,
i want to use minicom for connection to my GSM modem so that it can send message to particular
mobile..
can u tell me how shud i proceed for this…i only have idea for this.. i dnt know the details for that..

Reply

7 rahul singh May 12, 2008 at 9:48 am

hello

Thank you for give the step how to configure serial communicatin on internet . my suggestion please
make one website there we can find all the linux/unix help topic with theory and graphically which is not
available in books.

Thank-you
rahul singh ( iiht meeerut ) faculty=N+,REDHAT LINUX

Reply

8 Diego July 4, 2008 at 1:30 pm

Hello,

I am trying to log on to my Cisco 836, bought second-hand as training material for the CCNA, and I am
having a few difficulties with it.
I was hoping more experienced folks could help me in troubleshooting the problem.

I installed minicom 2.2 on Vector Linux and configured it following the how=to above. When I run
minicom =c on, it shows Initializing modem, then goes back to the main menu and asks to “Press CTRL-
A Z for help on special keys”.

When I do press CTRL-A, it shows me as OFFLINE in the lower right corner. The same happens with
both ttyS0 and ttyS1.

Now a bit background information: Vector Linux kindly starts the serial ports on startup, and a dmesg

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 6 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

|grep ttyS reveals that both ttyS0 and ttyS1 are active.
The router itself is linked to the db25 port via a rolled cable and a RJ45 to DB25 adapter (all self made; I
do not exclude that the problem is due to my poor wiring skills).

I have no way of telling whether the router itself is working correctly or not, but if I connect it to my Lan,
I am able to see its IP address.

Any suggestion as to where the problem might lie would be very welcome.

Cheers,

Diego

Reply

9 arsene August 7, 2008 at 8:17 pm

I am interested in learning kernel.

Currently I have successfully setup virtualbox using serial port (/dev/ttyS0) and minicom (`minicom -s
/dev/ttyS0`) looks connect to /dev/ttyS0 as it shows

OPTIONS: I18n
Compiled on Jun 6 2008, 22:41:04.
Port /dev/ttyS0

Would you please to give me some advice or suggestion on how can I capture message sent to minicom
(from virtualbox)? Or how can I send command / debug from minicom?

Thank you very much,

Reply

10 anon August 15, 2008 at 11:17 pm

You are awesome, thank you for this information.

Reply

11 ganesh November 11, 2008 at 8:21 am

I have a serial port(15 pin type) and i wanted to find the serial port (S0 or S1), so i tried the following
dmesg | grep ttyS but no warning or nothing comes up in the console, but i am taken to new prompt
$dmesg | grep ttyS
$
What should be done?

Reply

12 Danesh November 14, 2008 at 1:22 am

I use it to connect to my storage devices.


Thanks

Reply

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 7 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

13 luis December 11, 2008 at 5:29 pm

ttyS1: LSR safety check engaged!


ttyS1: LSR safety check engaged!
ttyS1: LSR safety check engaged!
ttyS1: LSR safety check engaged!
ttyS1: LSR safety check engaged!
ttyS1: LSR safety check engaged!

thats what i can see


minicom sucks
is there any other way ?

Reply

14 Hitesh Bumtariya April 1, 2009 at 11:01 am

hi,
i want to use minicom for connection to my GSM modem so that it can send message to particular
mobile..
can u tell me how shud i proceed for thisâ?¦i only have idea for this.. i dnt know the details for that..

Reply

15 arunprasad April 2, 2009 at 9:49 am

hai,
i want send sms using gsm mobile using linux box.i need a C program to send the AT commands to gsm
mobile.pls send me the details regrading

Reply

16 harshada May 19, 2009 at 7:53 am

I want to configure port no 12 to minicom, but under dev folder I didn’t found ttyS12. But I found ttysc.
So I configured port to /dev/ttysc. But after exiting setup, an error is thrown like “cannot open /dev/ttysc:
Input/output error”. How to overcome this error.
Thanks in advance.

Reply

17 kuapao July 16, 2009 at 11:29 pm

>Dave Uhring 02.12.08 at 12:35 pm


>
> Marco needs to edit /etc/default/kbd on his Solaris system to prevent such >accidental breaks.
Uncomment the line:
>
> KEYBOARD_ABORT=alternate

This was most helpful, especially since I’m rusty in Solaris! Another file to check is /etc/system for the
following line:
set abort_enable = 0

You want it set to 1 (default), if you want to be able to initiate a break or Stop-A.

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 8 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Reply

18 karuna August 8, 2009 at 12:10 pm

I am trying to connect router through linux but it is unsuccessful.


please suggest me what to do . I am using redhat linux 5.1

Reply

19 allen August 12, 2009 at 1:44 am

I want to use minicom to connect with my embedded systerm,


‘dmesg |grep ttyS’ ,display ‘Xen virtual console successfully installed as ttyS0"
‘minicom -s /dev/ttyS0",display ‘minicom: there is no global configuration file /etc/minirc._dev_ttyS0"
did u have the same problem?
thanks for help me out!

Reply

20 Dave September 26, 2009 at 11:37 pm

Hi,

I use minicom on ubunto to connect via USB 2 serial device. When I type minicom -s and reach the Serial
port setup I don’t find baud rate of 57600 to select from. Please advise.

Thanks,
David

Reply

21 Martin Paulus September 29, 2009 at 6:23 pm

In a response to above questions: please realize that minicom does not set up your serial ports, this is the
job of your operating system. Also picking a random tty-name is not the best way to get a connection up
and running. I would suggest looking up a serial connection howto on tldp.org (if you’re running Linux),
or find some other appropriate documentation.

p.s. if `dmesg|grep tty` ‘presents you’ with a new prompt this means that there were no results. check
greps behaviour by creating a text file and then use `fgrep WORD FILE` or `cat FILE|grep WORD` to
check for words you know appear and some you know do not appear in this text file. when in doubt,
consult the manual, please

Reply

22 tobias November 3, 2009 at 1:35 pm

pls read some manuals and willingly learn.. “i have trouble please help me very much” is NOT the correct
way of asking people to spend their spare time helping you.

Reply

23 Saad Usmani January 29, 2010 at 12:19 pm

Working perfectly fine. JAY Hoo…

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 9 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Reply

24 szmarcek March 28, 2010 at 1:01 am

My router is linked to the db25 port via a rolled cable and a RJ45 to DB25 adapter and minicom did not
work with /dev/ttyS0 or S1 and dmesg with grep ttyS* did not show anything but I noticed /dev/ttyUSB0
entry under /dev/ and when I set minicom to point to /dev/ttyUSB0 everyhting worked fine!

Reply

25 PAgore May 19, 2010 at 7:20 pm

Kewl!
Now i can use my grasshopper (ICnova AP7000 Base) in a colorful terminal! :D
$ minicom -c on

Thank You! :)

Reply

26 gtr November 15, 2010 at 9:25 am

Thank you for sharing this information.


I like to know if we can use minicom to run in different config to different serial ports in one linux box? I
have no problem in using minicom to /dev/ttyS0 (build-in). I add 2 more serial (PCI) and detected it as
/dev/ttyS1 and /dev/ttyS2. Problem is when I use this 2 serial ports it says “offline”. cables are ok and
devices connected to are all active. check it using /dev/ttyS0. Can anyone help me? TIA

Reply

27 mr.thinh March 14, 2011 at 6:37 pm

dear . . .

I have ttyS0 , ttyS1, ttyS2 . I can see one of them only . How can i connect and use 3 of them at the
same time ?

Thank you .

Reply

28 dustin March 1, 2011 at 9:02 pm

Thanks – the quick tutorial helped a lot

Reply

29 robert April 17, 2011 at 4:48 pm

I have done of the minicom set up, but when it comes to saving the file it states that i dont have the
permissions to save the file as dft. Im not sure if i have to be in root to save the file. Currently using
Kubuntu 10.10 at the moment. Trying to set up a Cisco Router.

Reply

30 robert April 17, 2011 at 5:26 pm

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 10 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Update… i have sorted it…. pressed enter and router>

Reply

31 robert April 17, 2011 at 5:37 pm

I think the issue with the saving of the file is still there, but i think that might be down to not being
able to get into root to save the file

Reply

32 rajeev September 24, 2011 at 12:24 pm

Hi all,
I had installed minicom in my Linux PC with “Linux localhost.localdomain 2.6.23.1-42.fc8 #1 SMP Tue
Oct 30 13:55:12 EDT 2007 i686 i686 i386 GNU/Linux” installed. when i run minicom i can watch my
unit booting
Welcome to minicom 2.2

OPTIONS: I18n
Compiled on Sep 25 2007, 06:13:56.
Port /dev/ttyS0

Press CTRL-A Z for help on special keys

RomBOOT
>Start AT91Bootstrap…

U-Boot 2008.10 (Sep 19 2011 – 17:57:15)

DRAM: 64 MB
Initializing Display
NAND: 256 MiB
DataFlash:AT45DB642
Nb pages: 8192
Page Size: 1056
Size= 8650752 bytes
Logical address: 0xD0000000
Area 0: D0000000 to D00041FF (RO) Bootstrap
Area 1: D0004200 to D00083FF Environment
Area 2: D0008400 to D0041FFF (RO) U-Boot
Area 3: D0042000 to D0251FFF Kernel
Area 4: D0252000 to D083FFFF FS
*** Warning – bad CRC, using defaul

but when i try to type from keyboard i am unable to communicate to minicom


Distribution built by Analogics Tech Ind Limited,Hyderabad
Kernel 2.6.28-ATIL-H10 for armv5tejl
ATIL-H10 login:
i am unable to type a thing on minicom
pls help..
Regards,
Rajeev

Reply

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 11 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

33 prince May 29, 2014 at 11:02 am

Make the setup..


Hardware flow control : NO
software flow control: NO

Reply

34 parag dhake January 13, 2012 at 12:02 pm

hello friends,
we are doing a project on pci driver.
our project is write pci driver and use functionality of ARM7 through uart.
i am done with pci driver, now i want to check our driver for full fledge.
i have a problem, when i am starting comunication between two pc using db9 connectors, who will first
start the communication get full data & another side some data gets lost may be starting data.
plz tell me that how i will minimizes this problem?
what will i do in driver?
i am use platform “linux”………….
Rgards
parag
dhakeparag81@gmail.com

Reply

35 Swathi April 17, 2012 at 9:50 pm

Hello,
When I tried to configure my minicom using minicom -s, it is displaying dev/modem instead of dev/ttyS0.
What does this mean? I need to connect my Embedded Linux board (ARM processor) to one of the ports.
Hence I need to configure minicom correctly before doing that. Any help is appreciated.

Thank you

Reply

36 yannick June 15, 2012 at 9:52 am

I use minicom for modem with smslib. But when i connect, i cannot write the AT’s commands. My linux
terminal don’t show me the command AT that i write. Can somedy help me please.

Thank you

Reply

37 Greg Ennis September 6, 2012 at 8:43 pm

I am trying to use minicom within a bash script to logon to a remote computer, poll it to see if files for
downloading are present, and then download the files and process them accordingly. Can minicom be
used without user interaction? Is there a tutorial present pertaining the script language that minicom
supports? Thanks much, Greg Ennis

Reply

38 passing by January 14, 2013 at 5:40 pm

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 12 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Don’t bother with minicom unless you need modem functions. Otherwise, you can probably do what you
like with a package called “expect” – using the “autoexpect” script. This is a TCL script that allows you
to simply type your responses and then gives you an editable script. When combined with bash, you can
do a lot.
Also, have a look at curl and wget.

Reply

39 arvid May 22, 2013 at 11:04 am

Hi everyone,

I’m not getting any output from minicom.. I’ve tried shorting pins 2 and 3 without result, and also
checked every pin with o-scope while typing or sending files – no response – just a constant +5V. I’m
using a prolific USB-to-serial adapter on OS X. I have no problems with input, so I’m pretty sure I’m on
the right serial device, just no output..
I’ve also tried all possible combinations of hardware/software flow control without any luck.

Any suggestions much appreciated!

Arvid

Reply

Leave a Comment

Name *

E-mail *

Notify me of followup comments via e-mail.

Submit

Tagged as: configure minicom Soekris net4521, configure minicom Soekris net4801, minicom command,
minicom configuration, minicom console, minicom hyperterminal, minicom linux, minicom null modem, null
modem cable, serial communication program, serial devices, serial port, serial ports, single board computer,
soekris, soekris linux, soekris minicom, telecommunications program

Previous post: Download of the day: PostgreSQL 8.3 Database Server

Next post: Download of the day: atool for Managing File Archives of Various Types

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 13 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Safari Power Saver


Click to Start Flash Plug-in

To search, type and hit enter

nixCraft

Follow +1

+ 94,887

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 14 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Related Posts

Display real-time system information from your Linux box on a LCD with
LCDproc software

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 15 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Windows Vista: No HyperTerminal to Configure Cisco Routers Connected


Via a Local COM Port

Book: iPhone Hacks

Linux x86_64: Detecting Hardware Errors

NETGEAR Launches Open Source WGR614L Wireless-G Router

How to use a Bluetooth phone with Linux

Lighttpd mod_rrdtool: Monitor The Load, Requests Per Seconds and Traffic

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 16 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Vmware Linux Guest Add a New Hard Disk Without Rebooting Guest

Tutorial: Ubuntu Linux on a Handheld / Mobile Device

Linux Find Out If PCI Hardware Supported or Not In The Current Running Kernel

Latest Linux/Unix Q & A


Linux: Hide Processes From Other Users
CentOS / RHEL 7 Restart / Stop / Start Networking Command
Linux / Unix logtop: Realtime Log Line Rate Analyser
Install EPEL Repo on a CentOS and RHEL 7.x
Connect To Amazon AWS EC2 Instance From a CentOS / RHEL Using SSH Client
CentOS / RHEL 7: Install GCC (C and C++ Compiler) and Development Tools
FreeBSD: (EE) Failed to load module “fbdev” (module does not exist, 0) Error and Solution
Linux Redirect Error Output To File
FreeBSD 10: Apply Binary Updates To Keep Base System Up To Date
CentOS and RHEL 7: Install Linux, Apache, MariaDB, PHP (LAMP) Stack
Fedora Linux 19/20 Install Adobe Flash Player
Linux: Bash Delete All Files In Directory Except Few
Fedora Linux 20: Install Broadcom-wl STA BCM43228 Wireless Driver
CentOS / RHEL / Fedora Linux: Use Yum Command With A Proxy Server
OS X: Create and use Live USB Fedora Linux Media
HowTo: Compile And Run a C/C++ Code In Linux
Linux And Unix Command To View File
HowTo: Upgrade To a Newer Version of Ubuntu 14.04 LTS
Linux / Unix: Find And List All Hidden Files Recursively
OS X Terminal: -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such
file or directory Fix

Subscribe to nixCraft

Learn something new about Linux/Unix by email


Enter your email address:

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 17 of 18
Linux / UNIX minicom Serial Communication Program - nixCraft 08/10/14 16:49

Subscribe

©2004-2014 nixCraft. All rights reserved. Privacy Policy - Terms of Service - Questions or Comments - We are
proudly powered by Linux + Nginx + WordPress.
The content is copyrighted to nixCraft and may not be reproduced on other websites.

http://www.cyberciti.biz/tips/connect-soekris-single-board-computer-using-minicom.html Page 18 of 18

You might also like