Next Previous Table of Contents

### 5. Modem Tricks & Hints

This section should get the fearful started on the (not so) arcane art of modem tweaking. The commands here are all Hayes AT standard, but all modems are not equal, so your mileage may vary.

### 5.1 Modem Sessions

A Modem session allows you to interact with the modem directly. You type commands, and it will respond. To obtain a modem session, when no connection is active, go into Setup/Modem/Terminal dialog. This will open a window for interactive configuration of the modem. Try typing ATZ (which resets your modem) Your should get an OK response. use File/Close to end the session.

### 5.2 Modem Profiles

One reason you might want to send the modem commands directly is if you have a set of modem configurations you want to keep, and not have to specify for every connection. A good way to do that is via modem profiles. Modems can have several stored profiles numbered 0,1,... AT&V can be used to view them all. The default profile is usually 0 (this can be changed via AT&Y.) The profile currently in use is called the "active" profile.

When you change a setting, the active profile is modified. The ATZ command will have the modem load the default profile, erasing any changes you have made. To save changes, Load the profile you want to change via ATZ n (where n is the profile number). Make the changes you want, then save it with AT&Wn. To have kppp use the profile you want, change the modem initialization string (Setup/Modem/Modem Commands/Initialization String.) For example ATZ1 will have the kppp reset the modem and use stored profile #1.

If you want reset you modem to get back to some known starting point, use AT&F&W to set the active profile to the factory defaults, and store those settings as the default profile.

Example of profile changes are in the next section.

### 5.3 Getting the modem to hang up

Sometimes, you may find kppp has difficulties hanging up the modem. This is likely the result of a mismatch between kppp settings and those of the modem. A standard modem uses two methods to decide to hangup: Command, and DTR. The Command method involves sending an escape sequence to the modem, which puts it in command mode, then issuing the hangup command (ATH).

Outside of kppp, when configuring the pppd package manually, it's often helpful to use the command method, so that one can exit a terminal session, and then start pppd without having the modem hangup. In most other situations, the DTR method is preferred, as it is simpler.

#### DTR (AT&Dn) method

The DTR method will have the modem hangup whenever kppp stops using the modem. If you obtain a modem session, and query the state via AT&V, and the among the settings displayed for the active profile are &D0, then the DTR hangup method is disabled. To enable the DTR method Use the Setup/More/Terminal to get a modem session. Then:

> `

>     ATZ             # reset to default profile
>     AT&D2               # Set to hang up on DTR drop.
>     AT&W                # Write to default profile

> `

#### How The DTR Method Works

Whenever the Data Terminal Ready (DTR) line on the serial line between the host computer and the modem goes high, the modem hangs up. When kppp opens the serial port, the DTR line is pulled low, on an external modem, you can see the DTR (or TR) light come on when this happens. When the TR light goes out (because kppp has closed the serial port, or something worse!), the modem will hangup.

#### Command Method

The other way to have a modem hang up when connected (used when AT&Dn where n is not 2) is to have the modem accept the command when a session is in progress. To have it hangup properly, Get a modem session, and set the guard time to a short interval like so:

> `

>     ATZ
>     ATS12=5
>     AT&W

> `

Then use the Settings/More/Modem Commands/Guard Time slider to match the register (S12) value to match (5) The modem should then hangup properly.

#### How The Command Method Works

When the local modem is connected to a remote modem, it is in the "connect" state, where it passes all the characters it receives to the remote modem without interpretation. To have the modem accept the characters as commands for itself, one must put the modem into the command state. The escape code does this.

The escape code is defined as a being three intervals of time whose length is defined by S12 (in fiftieth of a second.)

- Quiet (must last more than S12/50 seconds)
- Escape character (defined by register S2, default is "+") repeated three times (less than S12/50 seconds between each)
- Quiet (must last more than S12/50 seconds)

Once the modem is in the command state, you can send it commands. To have it hang up. Sent ATH. The escape codes and hangup string used by kppp are shown in the Setup/More/Modem Commands dialogs. These should match your modem.

### 5.4 Make Tone Dialling Faster

If you can use tone dialling, the amount of time it takes to dial can be changed using the S11 register. It gives the duration (in 100hundreds of a second) to send each tone while dialling. The default is usually 95 (almost a second.) How fast you can dial depends on the phone company's switching equipment which handles your line. The minimum duration is 50, almost twice as fast, and that speed often works.

> `

>     ATZ             # reset to default profile
>     ATS11=50        # fastest possible dialling, use a higher number if it doesn't work.
>     AT&W                # Write to default profile

> `

Next Previous Table of Contents