Use Minicom For Linux Modem & Dialup AT Command Testing
There is a device I am doing testing on that can either use dial-up as a backup connection or if the location does not have broadband it can use dialup as the primary connection. It has been interesting doing so much dialup testing recently since it has been almost 10 years since I have done much with dial-up. One of the ways to test dialing out from Linux is to use minicom which will allow you to communicate with the modem installed on your computer. So minicom will setup the connection to the modem and then AT commands can be used to dial the number of your dialup provider. Below we describe how to configure minicom and then a brief list of AT commands that can be used.
Configure Minicom To Use Linux Modem:
The first time you launch minicom you will want to use the “-s” switch to set it up as shown below.
This will bring you to the minicom setup screen as displayed below.
Minicom Setup Screen:
ÚÄÄÄÄÄ[configuration]ÄÄÄÄÄÄ¿ ³ Filenames and paths ³ ³ File transfer protocols ³ ³ Serial port setup ³ ³ Modem and dialing ³ ³ Screen and keyboard ³ ³ Save setup as dfl ³ ³ Save setup as.. ³ ³ Exit ³ ³ Exit from Minicom ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Scroll down to the “Serial port setup” and click enter to bring up the serial port setup configuration screen as shown below.
Minicom Serial Port Setup For Modem In Linux:
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ A - Serial Device : /dev/ttyAM1 ³ ³ B - Lockfile Location : /var/lock ³ ³ C - Callin Program : ³ ³ D - Callout Program : ³ ³ E - Bps/Par/Bits : 38400 8N1 ³ ³ F - Hardware Flow Control : No ³ ³ G - Software Flow Control : No ³ ³ ³ ³ Change which setting? ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Here you can type the letter to the left of each option to configure that option. For instance to modify the Serial Device you will click “A” which allows you to directly modify the Serial Device. In the example above the Serial Device has been changed to the modem which is /dev/ttyAM1. Verify the device your modem is connected to and make sure to enter it properly in Serial Device. You may also want to modify “E” (Bps/Par/Bits) which is the baud rate, parity, and stop bit settings. Typically modems will be 57600 for the Bps so you should modify to that. You will more than likely also want to turn off “Hardware Flow Control” by clicking “F” and verifying that it changes to “No” as shown in the above example.
Once you have completed making modifications click Enter to go back to the previous screen, scroll down to “Save Setup As DFL” and click Enter to save the settings as the default. Now “Exit From Minicom” by scrolling to the bottom and clicking Enter. Minicom should now be setup to use your modem in Linux properly. Below are some tips on dialing out properly.
Use Minicom To Establish A Dialup Connection In Linux:
Now that minicom is configured you can launch it using the command below which is just minicom with the “-s” switch.
This will make a direct connection to your modem similar to the below screen.
Welcome to minicom 2.1 OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n Compiled on Aug 18 2009, 20:19:22. Press CTRL-A Z for help on special keys
Once minicom is launched you can type “CTRL-a” followed by “z” to launch the minicom help screen as shown below.
Minicom Help Screen:
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Minicom Command Summary ³ ³ ³ ³ Commands can be called by CTRL-A <key> ³ ³ ³ ³ Main Functions Other Functions ³ ³ ³ ³ Dialing directory..D run script (Go)....G | Clear Screen.......C ³ ³ Send files.........S Receive files......R | cOnfigure Minicom..O ³ ³ comm Parameters....P Add linefeed.......A | Suspend minicom....J ³ ³ Capture on/off.....L Hangup.............H | eXit and reset.....X ³ ³ send break.........F initialize Modem...M | Quit with no reset.Q ³ ³ Terminal settings..T run Kermit.........K | Cursor key mode....I ³ ³ lineWrap on/off....W local Echo on/off..E | Help screen........Z ³ ³ | scroll Back........B ³ ³ ³ ³ Select function or press Enter for none. ³ ³ ³ ³ Written by Miquel van Smoorenburg 1991-1995 ³ ³ Some additions by Jukka Lahtinen 1997-2000 ³ ³ i18n by Arnaldo Carvalho de Melo 1998 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
Test Dialing Out From Modem On Linux Using Minicom:
Now to test actually dialing out use the below AT command sequence. The number used in the AT command beginning with ATX is an Earthlink modem bank in Louisville.
Modem Dial Out AT Commands Only:
ATH0 AT&D0 ATX1DT15023794077
As you can see below if the connection is successful you will be prompted with “Login:” at which time you can type the username followed by the password. If your connection is not successful you will receive back a “NO CARRIER” message instead of the Login prompt.
Modem Dial Out AT Commands & Output Via Minicom:
Welcome to minicom 2.1 OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n Compiled on Aug 18 2009, 20:19:22. Press CTRL-A Z for help on special keys ATH0 OK AT&D0 OK ATX1DT5023794077 CONNECT 31200 V42bis
As you can see above after entering the first two AT commands minicom will respond with “OK” and then after the final command the response will show the dial-up connection baud rate which in his example is 31,200. Below is a list of AT commands and their meaning including the three AT commands used above. AT actually means attention and AT commands are also known as the Hayes Command Set.
AT Commands To Use For Dialup Modem Testing:
- ATZ –> reset
- AT&V1, ATIn –> print out the configuration
- AT&W –> save configuration to NVRAM
- ATE0, ATE1 –> echo the commands, turn off echo
- ATX –> extended result codes
- ATX3, ATX4 –> ignore detect dial tone, detect busy, signal connect
- ATH0, ATH1 –> go on or off hook
- ATP –> set pulse dialing
- ATT –> set tone dialing
- ATD# –> dial number
- A –> cancel dialing
- ATA –> answer incoming call
The above is only a portion of the possible AT commands but will provide enough information to make successful dial-in connections to a provider.