Before spending a lot of time deciding how to configure your modem, you first need to make sure it can be found and that AT-commands and the like can be sent to it. So I suggest you first give it a very simple configuration using the communication program you will be using on the port and see it it works. If this works you may then want to improve on the configuration, If not then see My Modem is Physically There but Can't be Found. A winmodem may be hard to find and will not work under Linux.
While the serial port on which a modem resides requires configuring, so does the modem itself. The modem is configured by sending AT commands (or the like) to it on the same serial line that is used to send data.
Most modems use an AT command set. These are cryptic and short ASCII commands where all command strings must be prefaced by the letters AT. AT means: ATtention, expect a command to follow. For example: ATZ&K3<return> This is an AT-command string with two commands here: Z and &K3. Z is short for Z0 and a few modems require that you use Z0 instead of just Z. It's like this for other commands ending in 0. The command string is terminated by a return character (use the <enter> key if you are manually typing it). A string that's too long (40 or more characters) may not work on older modems. You may use either uppercase or lowercase letters.
Unfortunately there are many different variations of the AT command set so that what works for one modem may or may not work for another modem. Thus there is no guarantee that the AT commands given in this section will work on your modem.
Such command strings are either automatically sent to the modem by communication programs or are manually typed in by you. Most communication programs provide a screen where you may change (edit) and save the init string that the communication program will use. The modem itself has a stored configuration (profile) which is like a long init string. It represents the configuration of the modem when it's first tuned on. You may change it to suit your taste. In most cases there are a few different such configurations (profiles) and there are ways to designate one of them to be active.
If you have a manual for your modem (either on paper or on floppy disk) you might find AT-commands there. 3Com modems (and others ??) have AT-Command help files built into the modem so if you type say "AT$" to the modem it will display some "online help".
You can also find info on AT commands on the Internet. You should first try a site for your modem manufacturer. If this doesn't work out then you can search the Internet using terms that are from AT commands such as &C1, &D3, etc. This will tend to find sites that actually list AT-Commands instead of sites that just talk about them in general. You might also try a few of the sites listed in the subsection Web Sites. Be warned that the AT-commands for a different brand of modem may be somewhat different.
The examples given in this subsection are from the Hayes AT modem command set. All command strings must be prefaced by the two letters AT. For example: AT&C1&D3^M (^M is the return character). When a modem is powered on, it automatically configures itself with one of the configurations it has stored in its non-volatile memory. If this configuration is satisfactory there is nothing further to do.
If it's not satisfactory, then one may either alter the stored configuration or configure the modem each time you use it by sending it a string of commands known as an "init string" (= initialization string). Normally, a communication program does this. What it sends will depend on how you configured the communications program. Your communication program should allow you to edit the init string and change it to whatever you want. Sometimes the communications program will let you select the model of your modem and then it will use an init string that it thinks is best for that modem.
The configuration of the modem when it's first powered on may be expressed by an init string. You might think of this as the default "string" (called a profile). If your communications program sends the modem another string (the init string), then this string will modify the default configuration. For example, if the init string only contains two commands, then only those two items will be changed. However, some commands will recall a stored profile from inside the modem so a single such command in the init string can thereby change everything in the configuration.
Modern modems have a few different stored profiles to choose from that are stored in the modem's non-volatile memory (it's still there when you turn it off). In my modem there are two factory profiles (0 and 1, neither of which you can change) and two user defined profiles (0 and 1) that the user may set and store. Your modem may have more. To view some of these profiles send the command &V. At power-up one of the user-defined profiles is loaded. For example, if you type the command &Y0 (just Y0 for a 3Com modem) then in the future profile 0 will be used at power-on.
There are also commands to load (activate) any of the stored profiles. Such a load command may be put in an init string. Of course if it loads the same profile that was automatically loaded at power-up, nothing is changed (unless the active profile has been modified since power-up). Since your profile could have thus been modified it's a good idea to use some kind of an init string even if it does nothing more than load a stored profile.
Examples of loading saved profiles:
Z0 loads user-defined profile 0 and resets (hangs up, etc.)
&F1 loads factory profile 1
Once you have sent commands to the modem to configure it the way you
want (such as loading a factory profile and modifying it a little)
you may save this as a user-defined profile:
&W0 saves the current configuration to user-profile 0.
Many people don't bother saving a good configuration in their modem, but instead, send the modem a longer init string each time the modem is used. Another method is to restore the factory default by &F1 at the start of the init string and then modify it a little by adding a few other commands to the end of the init string. Since there is no way to modify the factory default this prevents anyone from changing the configuration by modifying (and saving) the user-defined profile.
You may choose an init string supplied by someone else that they think is right for your modem. Some communication programs have a library of init strings to select from. The most difficult method (and one which will teach you the most about modems) is to study the modem manual and write one yourself. You could save this configuration inside the modem so that you don't need an init string. A third alternative is to start with an init string that someone else wrote, but modify it to suit your purposes.
If you look at init strings used by communication programs you may see symbols which are not valid modem commands. These symbols are commands to the communication program itself and will not be sent to the modem. For example, ~ may mean to pause briefly.
This depends on your communication program (often a PPP program). If this is the latest version of Modem-HOWTO send me info for other cases.
For dial-in see Dial-in Modem Configuration. The rest of this section is mostly what was in the old Serial-HOWTO. All strings must start with AT. Here's a few Hayes AT codes that should be in the string (if they are not set by using a factory default or by a saved configuration).
Here's some more AT commands for special purposes:
Note: to get his old USR Courier V.34 modem to reset correctly
when DTR drops, Greg Hankins had to set
(this sets bit 0 of register S13). This has been confirmed to work on
USR Sportster V.34 modems as well.
Note: some old Supra modems treat CD differently than other
modems. If you are using a Supra, try setting
&C1. You must also set
&D2 to handle DTR
If phone number is dialed a few times with no success, some modems may blacklist a phone number. After a certain time you may try again. Some countries require this to reduce needless repeated dialing. To view the blacklist try %B. To delete the blacklist use these AT commands:
You may try to use minicom for viewing your modem profile. It's
best not to have any other process running on the modem port when you
do this. If you have set up minicom for your modem, then you may type
on the command line:
minicom -o to start minicom without
restoring the saved modem profile. Then type
atI4 on 3Com modems) to display the profile. To exit minicom without
disturbing this profile, use the q (quit) command for exiting without
The above may not work for various reasons. If the modem has been set not to echo result codes it may not even display any profile. If there is another process running on the modem port at the same time, some of what the modem sends to you is likely to be read by the other process so you will see only part of the profile. Is there some way to temporarily stop the other process on the port so it will not interfere? I tried the "stop" signal using the "kill" command but it didn't work. If this is the latest version of this HOWTO, let me know if you find a way to do it.
If you have at least one process running on the modem port and kill them, the modem's profile may be reset so you will not observe what the original profile was. This will happen if you kill getty (or it's replacements: login or bash) and have &D3 set. The killing of getty (or the like) will drop DTR and reset the modem's profile to the power-on state. To keep getty from respawning when killed, comment it out in /etc/inittab and do an "init q".
Since the channel for sending AT commands to the modem is the same channel that is used for the flow of data (files, packets, etc.) then it's important to cleanly separate the AT commands from the data.
When the modem is first turned on it's in the command mode (also called terminal mode, idle state or AT-command mode). Anything sent to it from the PC is assumed to be an AT command and not data. Then if a dial command is sent to it (ATD...), it dials and connects to another modem. It's now in the on-line data mode (connected) and sends and receives data (such as Internet pages). In this mode, any AT command one trys to send it will not work but will be transmitted to the other modem instead. Except for the escape command. This is +++ with a minimum time delay both at the start and end. The time delay allows the modem to determine that it is likely a real escape and not just +++ in a file being transmitted.
So we have two states so far: AT-command and on-line data. But there is a third important state which is sort of a combination of these two. It's the on-line command mode. This is when the modem maintains a connection (without sending/receiving data) but anything sent from the PC is interpreted as an AT command. This is the state reached with a +++ escape signal or by a DTR drop from the PC provided the &D1 has been set. Then one can send AT commands to the modem including commands which will leave this state and go to one of the other two states.
There are other states also: dialing state and handshaking state but they normally lead to the connected (on-line) state. If they don't then the modem should hang up, thereby returning to the initial AT-command (or idle) state.
Закладки на сайте
Проследить за страницей
Created 1996-2023 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру