AT Modem Emulator
Router App Description
Warning
- This Router App has been tested on a router with firmware version 6.3.10. After updating the router firmware to a higher version, check whether a newer version of the Router App has also been released and update it accordingly for compatibility.
- This Router App is not part of the router's firmware. It will only work properly if the serial expansion port RS-232 is installed in the router.
The AT Modem Emulator router app emulates telephone modem behavior. The modem can receive dial-up requests via the serial port and convert them to TCP/IP connections. A device connected to the Advantech router serial interface sees the router as a HAYES-compatible modem. The device can use standard AT commands to establish connections, configure parameters, and terminate sessions. Connections can be established with another AT Modem Emulator (in the router) or with any TCP server listening on the proper port. For supported commands and protocol specifications, see the AT Modem Emulator Protocol chapter.

This router app enables distributed system connectivity without software adjustments, ideal for older equipment with RS-232 interfaces (e.g., water-treatment stations, remote stock data transmission, or database updates).
To access the router app web interface:
- Click Router Apps in the router web interface.
- Select AT Modem Emulator.

- The Status section shows system status and logs (see Status).
- The Configuration section allows setting serial/TCP parameters, S-registers, DTR actions, and writing Configuration Scripts for substitution rules (see Configuration Script).
- The Customization section provides a Return item to navigate back to the router's web interface.
Status
AT Modem Emulator Status

The Status page displays:
Firmware Versions
- Router firmware version (visible via
ATI2command) - Router App version (visible via
ATI3command)
Status Variables and S-Registers
- Variables: E (ECHO), Q (responses), V (response format),
&D(DTR action) - S-registers S0–S25 (configure behavior; some editable via web interface or AT commands)
Connection Status
- Online:
- No: Operating/Command mode (disconnected)
- Yes: Online mode (active data communication)
- Connected:
- No: Operating mode
- IP address: Online/Command mode (connected)
To understand the AT Modem Emulator modes, see the figure below. Operating Mode is the initial AT Modem Emulator status after enabling it in the Configuration section. There are AT commands to switch the modes and Status page messages in the figure. For details on AT commands, see AT Modem Emulator Protocol.

System Log
The System Log page displays log messages. It is the same system log as the one in the main menu of the router. Router App messages are indicated by atmodemd string. You can monitor the Router App operation in the log and view messages if there are problems with the configuration. You can download the messages and save them to your computer as a text file (.log) by clicking the Save Log button. You can also download a detailed report (.txt) for communication with support by clicking the Save Report button.

Configuration
Click the AT Modem item in the Configuration section to enable and configure the AT Modem Emulator. This page opens when the Router App is accessed from the router's web interface. Check the Enable AT Modem box at the top and click the Apply button at the bottom. All changes in the configuration will take effect after clicking the Apply button. Configuration items are explained in the table below.

| Item | Description |
|---|---|
| Expansion Port | Select PORT1/PORT2 (RS-232) |
| Baudrate | Communication speed (300–115200) |
| Data Bits | 7 or 8 |
| Parity | None, even, odd |
| Stop Bits | 1 or 2 |
| TCP Port | Port for TCP communication |
| Check TCP Connection | Enable TCP Keepalive for connection checks |
| Keepalive Time | Interval between connection tests |
| Keepalive Interval | Wait time for responses |
| Keepalive Probes | Test attempts before declaring connection unavailable |
| Drop DTR Action | Action on DTR signal loss: None, Off-line, Disconnect |
| S0 (Auto-answer) | Auto-response settings: Manual, Auto 1–Auto 5 |
| S6 (RING Interval) | Time between RING messages (2–255 sec) |
| S7 (CONNECT timeout) | Wait time for CONNECT response (1–255 sec) |
| S10 (Hang-up delay) | Auto-disconnect after inactivity (0–255 x 10 sec) |
| S11 (Split Timeout) | Max interval between characters (0–255 ms) |
| S12 (Esc Delays) | Delay before/after ESC sequence (0–255 x 20 ms) |
| S25 (DTR Ignore) | DTR change ignore interval (0–255 x 10 ms) |
| Configuration Script | Substitution rules (see below) |
| Syslog Level | Log detail: Warning, Notification, Informational, Debugging, Verbose |
AT Modem Emulator Configuration
Configuration Script
Tips
The purpose of Configuration Script is to change the default response to AT commands received from your application (DTE) connected to the AT Modem Emulator. This is to adapt the modem emulator to these applications because they usually cannot be modified. For example, some devices cannot dial IP addresses, but you can define the substitution rule here and assign the phone number to the IP address.
Each script line is a substitution rule. Two types exist:
"I" Type (Info Response)
Format: Ii:text
i: index - unsigned integer number. 0 to 9 range.text: all characters from behind ":" until the end of line
Example:
- Rule:
I4: I am modem emulator - Input:
ATI4→ Output:I am modem emulator
"D" Type (Dial Substitution)
Format: Dpn:IP
pn: phone number in any format, letters are not allowedIP: IP address as a series of 12 digits
Example:
- Rule:
D+420 123 256:010000002145 - Input:
ATD+420123256→ Connects to 10.0.2.145
Notes:
- Rules override default behavior.
- Whitespace is ignored in rules/commands.
- Max 100 rules allowed.
General notes on substitution rules:
Substitution rules have priority over standard behavior if in conflict.
Example 1: AT Modem Emulator is programmed to print the router app version as a response to
ATI3command. But if there is a substitution rule tellingI3: a b cthen enteringATI3command will return the"a b c"string.Example 2: The standard response to the
ATD010000002145command is trying to connect to the 10.0.2.145 IP address. But if there is a substitution ruleD010000002145:010000002146the result is trying to connect to the 10.0.2.146 IP address instead.
There can be any number of white characters (spaces) in the rules. There can be any number of spaces on the AT command input, too.
Maximum number of substitution rules is 100.
AT Modem Emulator Protocol
The table below lists the supported AT commands, followed by an explanation of connection establishment and termination and general notes on AT Modem Emulator protocol usage.
AT Commands Overview
Tips
Note: Some commands are not used by AT Modem Emulator, because there is no practical use for them. Although the response may be OK, they will be ignored. This is for compatibility purposes and to allow for the use of standard programs for data (telephone) modems. There are no range limitations for setting the values variables and S-registers via AT commands.
| Command | Description | Example |
|---|---|---|
AT | Attention — indicates all commands except for "+++", "A/"; basic part of a command. | |
A | Answer incoming call. This is a response to a "RING" call message from the other station. | ATA |
A/ | Repeat the last command, no <CR> (Enter) needed. | A/ |
D | Dial a phone number or an IP address (12 numbers). The address of the opposite station follows after the command. | ATD10 |
E0 | Commands are not echoed (ECHO OFF). The modem does not return characters received from the computer. | ATE0 |
E1 | Commands are echoed (ECHO ON) — default. The modem returns characters received from the computer (you can see what you type). | ATE1 |
H | Hangup — termination of the connection. See the figure below. | ATH |
I2 | Returns the firmware version of the router. | ATI2 |
I3 | Returns the version of the AT Modem Emulator router app. | ATI3 |
O | Return to the On-line mode when in Command mode (Off-line). See the figure below. The connection is still established. | ATO |
Q0 | Quiet mode OFF — responses to commands are displayed (returned). E.g. OK or ERROR. This is default. | ATQ0 |
Q1 | Quiet mode ON — responses to commands not displayed (returned) — result codes suppressed. | ATQ1 |
V0 | Verbose OFF — return codes are in the numeric form only. | ATV0 |
V1 | Verbose ON — return codes are in the text English form (e.g. CONNECT, BUSY). This is default. | ATV1 |
Sr=n | Set the value to the S-register: • r — is the number of S-register being set• n — is the value being set to the S-register. | ATS0=1 |
Sr? | Return (show) the value of the r-th S-register | ATS10? |
Z | Usually performs the reset of the modem before the connection establishment. This does not reset the router AT Modem Emulator is running on, but does the reset of the AT Modem Emulator router app. | ATZ |
+++ | ESCAPE sequence. Switch from On-line (data) mode to Command mode (off-line) without dropping the line. See the figure below. Before and after the sequence there has to be a time delay defined in S12. | +++ |
&Dn | Set the action on DTR signal drop: • 0 — Ignore DTR• 1 — Go to Command mode• 2 — Hangup• 3 — Reset AT Modem Emulator | AT&D1 |
&V | Display current values of status variables and S-registers. Same as the Status page in the web interface. | AT&V |
&W | Save current settings to the router's configuration file. The saved configuration is used when reset is performed (ATZ) or starting the AT Modem Emulator. | AT&W |
S0 | Defines response to a call: • 0 — Manual response with ATA• 1 — Auto-connect after 1st ring• 2 — Auto-connect after 2nd rings | ATS0=1 |
S1 | Ring counter — incremented every time a "RING" signal is heard. Range: 0–255. | ATS1 |
S2 | Escape character (default: +, ASCII 43). | ATS2=43 |
S3 | CARRIAGE RETURN character (default: CR (13)). | ATS3=13 |
S4 | LINE FEED character (default: LF (10)). | ATS4=10 |
S5 | BACKSPACE character (default: 8). | ATS5=8 |
S6 | Time (seconds) between repetitions of RING signal (default: 5). | ATS6=5 |
S7 | Wait time for CONNECT response before sending NO RESPONSE (default: 10 sec). | ATS7=10 |
S10 | Auto-disconnect time (in 10-second units) after no data communication (default: 60 x 10 sec). | ATS10=60 |
S11 | Maximum time between characters in a data block (0–255 ms, default: 10 ms). | ATS11=10 |
S12 | Time delay (in 1/50 seconds) before/after Escape sequence (default: 8 x 20 ms). | ATS12=50 |
S25 | Interval (in 10 ms units) to ignore DTR signal changes (default: 5 x 10 ms). | ATS25=5 |
AT Commands Overview
Initial Status and Connection Establishment
After enabling the AT Modem Emulator Router App (or booting the router with AT Modem Emulator enabled), it receives commands from the connected device. The CD signal is reserved and you can configure parameters via AT commands or the Router App's web interface.
The typical connection establishment may look like this:

Now the AT Modem Emulator is in the On-line mode. The CD signal is active and data communication is running. If the opposite modem is not ready, the "RING" message repeats according to S1 settings. After the S7 interval, it returns "NO CARRIER". If the opposite modem is busy, "BUSY" is returned. Note that ATZ resets to default settings but does not reboot the router.
Communication and Modes
See the figure below to understand the modes and how to switch between them. When connected (On-line mode), use "+++" to enter Command mode while staying connected. Use ATO to return to On-line mode or ATH to hangup.
Connection Termination
There are several ways to terminate the connection:
- Switch to Command mode using "
+++", then useATH(orATH0). A time delay (defined in S12) is required before/after the escape sequence. - Set action on DTR signal drop via
&Dcommand (e.g.,AT&D2). If DTR drops, the modem waits S25 time before disconnecting. - Auto-disconnect after S10 interval of no data communication.