
Help in Solving Your |
![]() |
by M. L. Giggleman |
I receive a lot of calls about modems and communications problems. Since a communications problem can originate with the software, the modem, the port, or any combination, it is necessary to isolate the source(s) of the problem. Often the first impulse is to reinstall the communications software. However, before you invest the time involved in reinstalling and reconfiguring the software, be sure the problem is not with the hardware.
Check the most obvious things first. Make certain the phone line is plugged into the modem. Be sure the phone line is operational - plug in a phone and verify the dial tone. Make certain the external modem is connected to the computer. Then check the modem hardware.
A simple way to check the modem hardware involves using the ECHO command from the DOS prompt. If you are having communication problems in Windows, first verify the modem hardware is working on the lowest level (i.e., DOS). This technique uses the AT command set for Hayes-compatible modems. It works equally well from the DOS prompt or in a DOS-box in Windows 3.x or Windows 95.
To check the modem hardware, use the following command: ECHO ATDT > COMx where "x" is the number of the port to be tested. For the scope of this article, COM1 will be used in all examples. Change this as necessary for your system.
For example, to test COM1, type: ECHO ATDT > COM1. If you hear a dial tone, it means both the communication port and the modem hardware are working and you are ready to configure the communications software.
If you did not hear a dial tone, either the wrong communication port was used or the modem is not set up correctly.
If the wrong communication port was used, try the command again using another communication port. For instance, if you used COM1 above, try using COM2. This should correct the problem.
If the modem is not set up correctly, you will need access to either the modem manual or to the manufacturer. Most modem manufacturers have web sites and BBSs where you can download electronic versions of their modem manuals. Most also provide support on-line.
To cancel the dial tone, type: ECHO ATH > COM1 USING ECHO.
In the examples above, the DOS ECHO command is used to "echo" or send the commands to the specified port using redirection. AT the DOS prompt, type: ECHO HELLO WORLD and it appears to display the message HELLO WORLD on the screen. The whole story is that the message is being sent (via redirection) to the default DOS output device. ECHO can be used to redirect strings to any virtual device, such as a communications port or a printer. You could ECHO the same command to your printer by typing: ECHO HELLO WORLD > LPT1.
If you have a laser printer and typed the above line, you would now need to eject the partial page. You could do this by taking the printer off-line and pressing the Form Feed button or you could send a Page Feed command to the printer using ECHO: ECHO ^L > LPT1.
To generate the ^L for this string, hold down the Ctrl (Control) key on the keyboard while pressing the L key. You could create a batch file containing the line above to keep from having to walk over to a laser printer and press the Form Feed button. If you named the file FF.BAT, you could simply type FF at the DOS prompt to eject a page in your laser printer.
Using the AT Command set
The commands used in the above test are called AT commands, which stands for "ATtention". This is a set of commands developed for Hayes-compatible modems. These commands allow you to directly control and communicate with the modem.
In the first example above, DT stands for Dial Tone. This AT command instructs the modem to dial using Touch Tone. In the second example above, H stands for Hangup, another AT command which instructs the modem to terminate the call.
AT commands can be used in the terminal mode of your communications software or from the DOS prompt (or in a batch file).
You can do many things with the modem from DOS, such as dial phone numbers, reset the modem, and hang up. However, you will not be able to see the modem's response. To do this, you will need to be in the terminal mode of a communications program, such as Windows Terminal program. This really is not a problem unless you are using a command to query the modem for information; more on that later.
There are some ground rules for using the AT commands. In almost all cases, AT must precede the command. Many modems only understand uppercase letters, so be sure the CapsLock key is on. And finally, AT commands may differ depending on a particular modem. Check your modem manual or contact the manufacturer for a listing. AT the end of this article is a listing of reference files on the HAL-PC BBS that may be of use.
Dialing phone numbers
Using the above information, you can write a batch file to auto-dial a phone number or dial directly from the DOS prompt.
The syntax to dial a local phone number (111-2345) through a modem on COM1 is: ECHO ATDT1112345 > COM1.
To dial a long distance number, add the "1" and the area code before the phone number: ECHO ATDT18001112345 > COM1.
Some phone systems require dialing an access number, usually an 8 or a 9,
prior to the phone number to get an outside line. You usually have to wait a
moment for a dial tone before you begin dialing. To use AT commands in this
situation, use one or more commas to separate the access number from the phone
number. Each comma represents a 2 second pause. The following example dials
tone, then 9, waits 2 seconds for an outside line, then dials the
phone
number of 111-2345: ECHO ATDT9,1112345 > COM1.
If the 2 second pause is not adequate to receive a dial tone, you could use more than one comma or you could increase the length of the pause. The 2 second pause is determined by the setting of the S8 register. You can change the contents of that register, if needed, to make the pause longer. To change the default 2 second pause to a 5 second pause: ECHO ATS8=5 > COM1.
The command syntax to disable call-waiting is: ECHO ATDT*70,1112345
Call-waiting is disabled for the scope of the call and terminates when the call is disconnected.
Enabling speaker for the modem
The modem speaker can be shut off completely, overriding the speaker volume
settings below. You might want to have the speaker on
until the modem
connects to listen for operator messages, etc.
Mx Speaker Control Commands
M0 Speaker off
M1 Speaker on until carrier detected (connected) ** Default
M2 Speaker on continuously
M3 Speaker on after dialing until carrier detect (connected)
Shut the speaker off completely: ECHO ATM0 > COM1
Speaker on until connected: ECHO ATM1 > COM1
Speaker on and leave on: ECHO ATM2 > COM1
Speaker off during dial, on until connect: ECHO ATM3 > COM1
Adjusting speaker volume
If the modem speaker volume is too low, use the L command to adjust the Loudness. Values range from the lowest, L0, to the highest, L3. The default setting is usually L2.
Lx Speaker Volume Commands
L0 Lowest
L1 Low
L2 Medium **Default
L3 Highest
To lower modem speaker volume: ECHO ATL1 > COM1
Maximum speaker volume: ECHO ATL3 > COM1
Combining AT Commands
You could send each command separately or combine. This command dials using tone (DT), medium loudness (L2), the phone number 111-2345 using COM1: ECHO ATL2DT1112345 > COM1.
Other useful AT Commands
Set the modem to auto-answer: ECHO ATS0=1 > COM1
Disable auto-answer: ECHO ATS0=0 > COM1
Execute a software reset: ECHO ATZ > COM1
The following is a simple QBasic program to dial a phone number. This program will prompt for a number to dial. Be sure to include any access numbers required, such as area code, long distance codes, etc.
REM Save as CALL.BAS
CLS
INPUT "Phone number to dial ", PNumber$
OPEN "COM1:" as #1
PRINT #1, "ATDT"; PNumber$
INPUT "Press the ENTER key to hang up ", X$
CLOSE
Remember to change Line 4 to the communications port used by your system and change Line 5 from ATDT to ATDP if you have a pulse phone.
Files on the HAL-PC BBS
The following nine files were uploaded to the HAL-PC BBS under the title NOV96MLG.ZIP (programs referenced in this article). (References will be repeated in Part 2.)
CALL.BAS - Simple QBasic program to dial a phone number.
PROFILE.BAS - Simple QBasic program to obtain modem stored profile.
FF.BAT - Batch file to eject page on printer using ECHO, DK_DIAL.BAT - .
DOSKEY macro to enable phone dialing from DOS command line.
HAYES.TXT - Technical Reference for Hayes Modem Users, version 2.0. Downloaded from the Hayes BBS.
HAYESREF.HLP - Technical Reference for Hayes Modem Users as above, except in Windows Help format with hypertext. Downloaded from the Hayes BBS.
PRACCON.HLP - Practical Peripherals technical reference in Windows Help format. Downloaded from vendor BBS.
WW0645.TXT - Microsoft Product Support Services Application Notes 02/93. Information about serial communications in the Microsoft Windows operating system environment. Sections discuss basic and advanced concepts in serial communications (port addresses, device contention, etc.), common causes for serial communications difficulties, what to do once a problem has been identified, and troubleshooting.
PCM_AT.DOC - Jeff Prosise's excellent article on the AT Command Set from the 09/27/94 issue of PC Magazine.
Part 2 of this article will be in the January issue.
M. L. Giggleman, a HAL-PC member, works contract as a Network Administrator/PC System Specialist. She authored a series of technical tutorials on exploring the computer via DEBUG and is currently working on a "cookbook" of programs to test and troubleshoot computer systems and peripherals. She can contacted at supgigg1@airmail.net.
E-mail me at webmaster@hal-pc.org with any comments you have and tell me what you want to see here.
Back to the User Journal Home Page