---
name: "modemu"
section: "1"
platform: "linux"
package: "modemu"
version: "0.0.1-10"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/modemu"
---

# modemu(1)

dialup TCP connecting

## NAME

modemu - dialup TCP connecting

## SYNOPSIS

**modemu** \[**-c** *comm\_prog*\] \[**-d** *pty\_master*\] \[**-e** *atcmds*\] \[**-h**\] \[**-s**\] \[**-**\]

## DESCRIPTION

**Modemu** is a TELNET client with a modem-like user interface. It can redirect its I/O via a [**pty**(4)](/pty/4.md) so that a comm program can handle the pty as a tty with a real modem.

**Modemu** has two major modes: a command mode and online mode. When invoked, **modemu** is in the command mode, waiting for AT commands input. Entering a D or O command will put into the online mode, in which  **modemu** communicate with a remote host. Connection closing or a escape command input returns to the command mode.

## OPTIONS

- **-c** *comm\_prog*

  Invoke a comm program *comm\_prog*. **Modemu** invokes it by passing /bin/sh an option \`-c *comm\_prog*'. Therefore, any [**sh**(1)](/sh/1.md) commands can be specified. The string *comm\_prog* can include a \`%s', which will be replaced with the  device name of the slave device after removal of the initial "/dev/".

  Example:

  modemu -c "xc -l %s"

- **-d** *pty\_master*

  Open a file *pty\_master* and talk through it. A named pipe can be a *pty\_master* as well as a pty master device because **modemu** doesn't ioctl a *pty\_master*.

- **-e** *atcmds*

  Execute a series of AT commands *atcmds* initially. *Atcmds* must have an \`AT' or \`at' prefix. D and O commands in *atcmds* are ignored.

- **-h**

  Print a usage summary.

- **-s**

  Print the last two letters of a device name. The device is a pty master device which **modemu** talks through. Therefore, when **modemu** prints \`p8', comm program must open /dev/tty*p8*.

- **\`-'**

  **Modemu** talks through the standard input/output. (Default)

Note: -c, -d, -s and - options are exclusive each other. If two or more of the options are specified, only the last one is effective.

## COMMAND MODE

Command mode expects lines in the following format:

-

  \[*garbage*\]*at*\[*sp*\]\[*cmd*\[*sp*\]\]...*cr*

where *at* is an \`AT' or \`at', *sp* is spaces, *cr* is a carriage return character (register S3), *garbage* is a string includes no *at*. If a \`#' prefixes a line, the line is ignored. Available *cmd*s are listed below. They are all case in-sensitive except for some literally used arguments. A (\*) marks default settings.

- **D***str*

  Dialing command. Open a connection to *host*. If *port* is specified, **modemu** attempts to connect with the port instead of the default TELNET port, and doesn't initiate TELNET option negotiation. The following formats are available for *str*:

  - *host*\[:*port*\]

    *Host* is an Internet address in numbers-and-dots notation. Optional *port* is a port number.

  - "*host*\[:*port*\]\["\]

    *Host* is an Internet address or host name. Optional *port* is a port number or service name. The closing double quote can be omitted if no command follows.

  *Str* can be prefixed with \`T', \`P', \`*digit*W' and/or \`*digit*,'. The prefixes are simply ignored.\
   Example:

  ATDT0W127.0.0.1\
   ATDP"foo.bar.jp:daytime

- **E1**

  No operation.

- **F1**

  No operation.

- **H**\[**0**\]

  Close the current TELNET session.

- **I***n*

  Print various information.

  - I4

    Current settings

  - I5

    \`&W'ed settings

  - I6

    TELNET option states

  - I7

    **Modemu** version

- **O**\[**0**\]

  Return to online mode.

- **P**

  No operation.

- **Q**\[**0**\]

  No operation.

- **T**

  No operation.

- **V1**

  No operation.

- **X**\[**0**\]

  No operation.

- **S***n***=***m*

  Set S-register S*n* to *m*. A number from 0-255 is allowed for *m*.

- **S***n***?**

  Print an S-register S*n*'s value.

- **Z**

  Close the current TELNET session, and restore \`&W'ed settings.

- **&W**

  Save current settings. The saved settings will be lost with the end of the process because they are not stored into NV-RAM nor files.

- **%B***n***=***m*

  Control TELNET binary option. Valid values for *n* are:

  - 0

    Control the local (modemu) option

  - 1

    Control the remote (TELNET server) option

  Valid values for *m* are:

  - 0

    Request non-binary transmission mode (\*)

  - 1

    Request binary transmission (8bit through) mode

  - *above+2*

    Disconnect if the request is refused

  Example:

  - AT%B1=1

    Requesting binary mode in remote-to-modemu direction

  - AT%B0=3%B1=3

    Requesting binary mode in both remote-to-modemu and modemu-to-remote direction. No use connecting in non-binary mode (using file xfer protocol or something)

- **%D***n*

  Control dial-canceling.

  - %D0

    A keypress cancels dialing (\*)

  - %D1

    Keypresses don't cancel dialing

- **%L***n*

  Control line-mode.

  - %L0

    Request character-at-a-time mode (\*)

  - %L1

    Request line-at-a-time mode (old line-mode). Input characters are buffered and not sent until a CR character is entered.

- **%Q**

  Quit **modemu**.

- **%R***n*

  Control raw-mode.

  - %R0

    Normal mode (\*)

  - %R1

    Raw mode. **Modemu** transmits every octet as received. Applied to both remote-to-modemu and modemu-to-remote direction. Override %B and %L settings.

- **%T***str*

  Control TELNET terminal-type option.

  - %T0

    Refuse terminal-type option

  - %T1

    Same as %T="$**TERM**" (**TERM** environment value is used) (\*)

  - %T="*term*\["\]

    Send *term* as the terminal-type if remote requests. The closing double quote can be omitted if no command follows.

- **%V***n*

  Control verbose level. %V0 (\*) is the quietest, and adding following values to *n* lets **modemu** print more information to stderr.

  - \+1

    Print misc info to make up for less descriptive ATX0 indication

  - \+2

    Print TELNET option negotioation

## ONLINE MODE

**Modemu** recognizes only the following command when in online mode.

- *wait* **+++** *wait*

  Escape to command mode. The \`+++' must be input within the guard time. *Wait* is a period of time longer than the guard time without hitting any key. See also S2 and S12 register descriptions.

## S REGISTERS

Only meaningful registers are listed here. Values in braces are default ones.

- **S2**

  Escape character code. (43 = \`+')

- **S3**

  Carriage return character code. (13)

- **S4**

  Line feed character code. (10)

- **S5**

  Backspace character code. (8)

- **S7**

  Connecting attempt time limit in seconds. (20)

- **S12**

  Escape sequence guard time in 50ths of a second.  (50)

## ENVIRONMENT VARIABLES

- **MODEMU**

  Initially evaluated as AT commands (before -e option argument is evaluated). Must have an \`AT' or \`at' prefix.

- **TERM**

  See %T1 command description.

## AUTHOR

Toru Egashira (egashira@nwk.CL.nec.co.jp)

## SEE ALSO

[telnet(1)](/telnet/1.md), *Your favorite modem's manual*

## BUGS

No dial-resriction, or blacklisting, capability. So using **modemu** maybe unlawful in some countries. B)
