Hayes AT Command Set
   HOME

TheInfoList



OR:

The Hayes command set (also known as the AT command set) is a specific
command language A command language is a language for job control in computing. It is a domain-specific and interpreted language; common examples of a command language are shell or batch programming languages. These languages can be used directly at the ...
originally developed by Dale Heatherington and Dennis Hayes for the Hayes Smartmodem in 1981. The command set consists of a series of short text strings which can be combined to produce commands for operations such as dialing, hanging up, and changing the parameters of the connection. The vast majority of
dial-up modems The Democratic Movement (, ; MoDem ) is a centre to centre-right political party in France, whose main ideological trends are liberalism and Christian democracy, and that is characterised by a strong pro-Europeanist stance. MoDem was establish ...
use the Hayes command set in numerous variations. The command set covered only those operations supported by the earliest modems. When new commands were required to control additional functionality in higher speed modems, a variety of one-off standards emerged from each of the major vendors. These continued to share the basic command structure and syntax, but added any number of new commands using some sort of prefix character for Hayes and
USRobotics U.S. Robotics Corporation, often called USR, is a company that produces USRobotics computer modems and related products. Its initial marketing was aimed at bulletin board systems, where its high-speed HST protocol made FidoNet transfers much fast ...
, and for
Microcom Microcom, Inc., was a major modem vendor during the 1980s, although never as popular as the "big three", Hayes, U.S. Robotics (USR) and Telebit. Nevertheless, Microcom holds an important place in modem history for introducing the MNP error- ...
, for instance. Many of these were re-standardized on the Hayes extensions after the introduction of the SupraFAXModem 14400 and the market consolidation that followed. The term "''Hayes compatible''" was and still is important within the industry.


History


Background

Before the introduction of the
bulletin board system A bulletin board system (BBS), also called a computer bulletin board service (CBBS), is a computer server running list of BBS software, software that allows users to connect to the system using a terminal program. Once logged in, the user perfor ...
(BBS), modems typically operated on direct-dial
telephone line A telephone line or telephone circuit (or just line or circuit industrywide) is a single-user circuit on a telephone communication system. It is designed to reproduce speech of a quality that is understandable. It is the physical wire or oth ...
s that began and ended with a known modem at each end. The modems operated in either "originate" or "answer" modes, manually switching between two sets of frequencies for data transfer. Generally, the user placing the call would switch their modem to "originate" and then dial the number by hand. When the remote modem answered, already set to "answer" mode, the telephone handset was switched off and communications continued until the caller manually disconnected. When automation was required, it was commonly only needed on the answer side; for instance, a bank might need to take calls from a number of branch offices for end-of-day processing. To fill this role, some modems included the ability to pick up the phone automatically when it was in answer mode, and to clear the line when the other user manually disconnected. The need for automated outbound dialling was considerably less common, and was handled through a separate peripheral device: a "dialler". This was normally plugged into a separate input/output port on the computer (typically an
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
port) and programmed separately from the modem itself. This method of operation worked satisfactorily in the 1960s and early 1970s, when modems were generally used to connect dumb devices like
computer terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. Most early computers only had a front panel to input or display ...
s (dialling out) with smart
mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterprise ...
s (answering). However, the
microcomputer revolution The history of the personal computer as a mass-market consumer electronic device began with the microcomputer revolution of the 1970s. A personal computer is one intended for interactive individual use, as opposed to a mainframe computer whe ...
of the 1970s led to the introduction of low-cost modems and the idea of a semi-dedicated point-to-point link was no longer appropriate. There were potentially thousands of users who might want to dial any of the other thousands of users, and the only solution at the time was to make the user dial manually. The
computer industry A computer is a machine that can be programmed to automatically carry out sequences of arithmetic or logical operations (''computation''). Modern digital electronic computers can perform generic sets of operations known as ''programs'', ...
needed a way to tell the modem what number to dial through software. The earlier separate dialers had this capability, but only at the cost of a separate port, which a
microcomputer A microcomputer is a small, relatively inexpensive computer having a central processing unit (CPU) made out of a microprocessor. The computer also includes memory and input/output (I/O) circuitry together mounted on a printed circuit board (P ...
might not have available. Another solution would have been to use a separate set of "command pins" dedicated to sending and receiving commands; another could have used a signal pin indicating that the modem should interpret incoming data as a command. Both of these had hardware support in the
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such as a compu ...
standard. However, many implementations of the RS-232 port on microcomputers were extremely basic, and some eliminated many of these pins to reduce cost.


Hayes' solution

Hayes Communications Hayes Microcomputer Products was a US-based manufacturer of modems. The company is known for the Smartmodem, which introduced a control language for operating the functions of the modem via the serial interface, in contrast to manual operation wi ...
introduced a solution in its 1981
Smartmodem Hayes Microcomputer Products was a US-based manufacturer of modems. The company is known for the Smartmodem, which introduced a control language for operating the functions of the modem via the serial interface, in contrast to manual operation wi ...
by using the existing data pins with no modification. Instead, the modem itself could be switched between one of two modes: # ''Data mode'' in which the modem sends the data to the remote modem. (A modem in data mode treats everything it receives from the computer as data and sends it across the phone line). # ''Command mode'' in which data is interpreted as commands to the local modem (commands the local modem should execute). To switch from data mode to command mode, sessions sent an
escape sequence In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters. Examples * In C and ma ...
string of three plus signs () followed by a pause of about a second. The pause at the end of the escape sequence was required to reduce the problem caused by
in-band signaling In telecommunications, in-band signaling is the sending of control information within the same band or channel used for data such as voice or video. This is in contrast to out-of-band signaling which is sent over a different channel, or even o ...
: if any other data was received within one second of the three plus signs, it was not the escape sequence and would be sent as data. To switch back they sent the ''online'' command, . In actual use many of the commands automatically switched to the online mode after completion, and it is rare for a user to use the online command explicitly. In order to avoid licensing Hayes's patent, some manufacturers implemented the escape sequence without the time guard interval ( Time Independent Escape Sequence (TIES)). This had a major
denial of service In computing, a denial-of-service attack (DoS attack) is a cyberattack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host co ...
security implication in that it would lead to the modem hanging up the connection should the computer ever try to transmit the byte sequence in data mode. For any computer connected to the Internet through such a modem, this could be easily exploited by sending it a
ping of death A ping of death is a type of attack on a computer system that involves sending a malformed or otherwise malicious ping to a computer. In this attack, a host sends hundreds of ping requests with a packet size that is large or illegal to another ho ...
request containing the sequence in the payload. The computer operating system would automatically try to reply the sender with the same payload, immediately disconnecting itself from the Internet, as the modem would interpret the
ICMP The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating success or failure when com ...
data payload as a Hayes command. The same error would also trigger if, for example, the user of the computer ever tried to send an e-mail containing the aforementioned string.


Commands

The Hayes command set includes commands for various phone-line operations such as dialing and hanging-up. It also includes various controls to set up the modem, including a set of ''
register Register or registration may refer to: Arts, entertainment, and media Music * Register (music), the relative "height" or range of a note, melody, part, instrument, etc. * ''Register'', a 2017 album by Travis Miller * Registration (organ), ...
commands'' which allowed the user to directly set the various memory locations in the original Hayes modem. The command set was copied largely verbatim, including the meaning of the registers, by almost all early 300 baud modem manufacturers, of which there were quite a few. The expansion to 1200 and 2400 baud required the addition of new commands, some of them prefixed with an
ampersand The ampersand, also known as the and sign, is the logogram , representing the grammatical conjunction, conjunction "and". It originated as a typographic ligature, ligature of the letters of the word (Latin for "and"). Etymology Tradi ...
() to denote those dedicated to new functionality. Hayes itself was forced to quickly introduce a 2400 baud model shortly after their 1200, and the command sets were identical as a time-saving method. Essentially by accident, this allowed users of existing 1200 baud modems to use the new Hayes 2400 models without changing their software. This re-inforced the use of the Hayes versions of these commands. Years later, the
Telecommunications Industry Association The Telecommunications Industry Association (TIA) is accredited by the American National Standards Institute (ANSI) to develop voluntary, consensus-based industry standards for a wide variety of information and communication technology (Informat ...
(TIA)/
Electronic Industries Alliance The Electronic Industries Alliance (EIA; until 1997 Electronic Industries Association) was an American standards organization, standards and trade organization composed as an alliance of trade associations for electronics manufacturers in the ...
(EIA) formally standardized the 2400-baud command set as Data Transmission Systems and Equipment – Serial Asynchronous Automatic Dialing and Control, TIA/EIA-602. However, Hayes Communications was slow to release modems supporting higher speeds or
compression Compression may refer to: Physical science *Compression (physics), size reduction due to forces *Compression member, a structural element such as a column *Compressibility, susceptibility to compression * Gas compression *Compression ratio, of a ...
, and three other companies led:
Microcom Microcom, Inc., was a major modem vendor during the 1980s, although never as popular as the "big three", Hayes, U.S. Robotics (USR) and Telebit. Nevertheless, Microcom holds an important place in modem history for introducing the MNP error- ...
, U.S. Robotics, and
Telebit Telebit Corporation was a US-based modem manufacturer, known for their TrailBlazer series of high-speed modems. One of the first modems to routinely exceed 9600 bit/s speeds, the TrailBlazer used a proprietary modulation scheme that proved highly ...
. Each of these three used its own additional command-sets. By the early-1990s, there were four major command sets in use, and a number of versions based on one of these. Things became simpler again during the widespread introduction of 14.4 and modems in the early 1990s. Slowly, a set of commands based heavily on the original Hayes extended set using commands became popular, and then universal. Only one other command set has remained popular, the U.S. Robotics set from their popular line of modems.


Description

The following text lists part of the Hayes command set, also called the AT commands: "AT" meaning 'attention'. Each command string is prefixed with "AT", and a number of discrete commands can be concatenated after the "AT". The Hayes command set can subdivide into four groups: # basic command set – A capital character followed by a digit. For example, M1. # extended command set – An "&" (ampersand) and a capital character followed by a digit. This extends the basic command set. For example, &M1. Note that M1 is different from &M1. # proprietary command set – Usually starting either with a backslash (“\”) or with a percent sign (“%”); these commands vary widely among modem manufacturers. # register commands – Sr=n where r is the number of the register to be changed, and n is the new value that is assigned. A
register Register or registration may refer to: Arts, entertainment, and media Music * Register (music), the relative "height" or range of a note, melody, part, instrument, etc. * ''Register'', a 2017 album by Travis Miller * Registration (organ), ...
represents a specific physical location in memory. Modems have small amounts of memory on board. The fourth set of commands serves for entering values into a particular register (memory location). For example, ''S7=60'' instructs the modem to "Set register #7 to the value 60". Registers usually control aspects of the modem operation (e.g. transmission strength, modulation parameters) and are usually specific to a particular model. Although the command-set syntax defines most commands by a letter-number combination (L0, L1 etc.), the use of a zero is optional. In this example, "L0" equates to a plain "L". Keep this in mind when reading the table below. When in data mode, an
escape sequence In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters. Examples * In C and ma ...
can return the modem to command mode. The normal escape sequence is three plus signs ("+++"), and to disambiguate it from possible real data, a guard timer is used: it must be preceded by a pause, not have any pauses between the plus signs, and be followed by a pause; by default, a "pause" is one second and "no pause" is anything less.


Syntactical definitions

The following syntactical definitions apply: * Carriage return character, is the command line and result code terminator character, which value, in decimal ASCII between 0 and 255, is specified in register S3. The default value is 13. * Linefeed character, is the character recognised as line feed character. Its value, in decimal ASCII between 0 and 255, is specified in register S4. The default value is 10. The line feed character is output after the carriage return character if verbose result codes are used (V1 option is used); otherwise, if numeric format result codes are used (V0 option is used), it will not appear in the result codes. * Name enclosed in angle brackets is a syntactical element. They do not appear in the command line. * Optional subparameter of a command or an optional part of AT information response is enclosed in square brackets. Brackets themselves do not appear in the command line. When the subparameter is not given in AT commands which have a Read command, the new value equals its previous value. In AT commands which do not store the values of any of their subparameters, and so have not a Read command, which are called action type commands, the action should be done on the basis of the recommended default setting of the subparameter.


Modem initialization

A string can contain many Hayes commands placed together, so as to optimally prepare the modem to dial out or answer, e.g. AT&F&D2&C1S0=0X4. Most modem software supported a user supplied initialization string, which was typically a long
concatenated In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalizations of concatenatio ...
AT command which was sent to the modem upon launch. The V.250 specification requires all DCEs to accept a body (after "AT") of at least 40 characters of concatenated commands.


Example session

The following represents two computers, computer A and computer B, both with modems attached, and the user controlling the modems with
terminal emulator A terminal emulator, or terminal application, is a computer program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term ''terminal'' covers all remote term ...
software. Terminal-emulator software typically allows the user to send Hayes commands directly to the modem, and to see the responses. In this example, the user of computer A makes the modem dial the phone number of modem B at phone number (212) 555-0100 (long distance). After every command and response, there is a
carriage return A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed ...
sent to complete the command.


Compatibility

While the original Hayes command set represented a huge leap forward in modem-based communications, with time many problems set in, almost none of them due to Hayes ''per se'': * Due to the lack of a written standard, other modem manufacturers just copied the external visible commands and (roughly) the basic actions. This led to a wide variety of subtle differences in how modems changed from state to state, and how they handled error conditions, hangups, and timeouts. * Each manufacturer tended to add new commands to handle emerging needs, often incompatible with other modems. For example, setting up hardware or software handshaking often required many different commands for different modems. This undermined the handy universality of the basic Hayes command set. * Many Hayes compatible modems had serious quirks that made them effectively incompatible. For example, many modems required a pause of several seconds after receiving the "AT Z" reset command. Some modems required spaces between commands, while others did not. Some would unhelpfully change baud-rate of their own volition, which would leave the computer with no clue how to handle the incoming data. As a result of all this, eventually many communications programs had to give up any sense of being able to talk to all "Hayes-compatible" modems, and instead the programs had to try to determine the modem type from its responses, or provide the user with some option whereby they could enter whatever special commands it took to coerce their particular modem into acting properly.


Autobaud

The Hayes command set facilitated
automatic baud rate detection Automatic baud rate detection (ABR, autobaud) refers to the process by which a receiving device (such as a modem) determines the speed, code level, start bit, and stop bits of incoming data by examining the first character, usually a preselected ...
as "A" and "T" happen to have bit patterns that are very regular; "A" is "100 0001" and so has a 1 bit at the start and end and "T" is "101 0100" which has a pattern with (nearly) every other bit set. Since the RS-232 interface transmits
least significant bit In computing, bit numbering is the convention used to identify the bit positions in a binary number. Bit significance and indexing In computing, the least significant bit (LSb) is the bit position in a binary integer representing the lowes ...
first, the according line pattern with ''8-N-1'' (eight data bits, no parity bit, one stop bit) is ''0''10000010''10''00101010''1'' (start and stop bits ''italicized'') which is used as
syncword In computer networks, a syncword, sync character, sync sequence or preamble is used to synchronize a data transmission by indicating the end of header information and the start of data. The syncword is a known sequence of data used to identif ...
.


The basic Hayes command set

The following commands are understood by virtually all modems supporting an AT command set, whether old or new. Note: a command string is terminated with a CR (\r) character Although not part of the command set, a
tilde The tilde (, also ) is a grapheme or with a number of uses. The name of the character came into English from Spanish , which in turn came from the Latin , meaning 'title' or 'superscription'. Its primary use is as a diacritic (accent) in ...
character ~ is commonly used in modem command sequences. The ~ causes many applications to pause sending the command stream to the device (usually for half a second), e.g. after a ''Reset''. The ~ is not sent to the modem.


Modem S register definitions


V.250

The
ITU-T The International Telecommunication Union Telecommunication Standardization Sector (ITU-T) is one of the three Sectors (branches) of the International Telecommunication Union (ITU). It is responsible for coordinating Standardization, standards fo ...
established a standard in its V-Series Recommendations, ''V.25 ter'', in 1995 in an attempt to establish a standard for the command set again. It was renamed ''V.250'' in 1998 with an annex that was not concerning the Hayes command set renamed as ''V.251''. A V.250 compliant modem implements the A, D, E, H, I, L, M, N, O, P, Q, T, V, X, Z, &C, &D, and &F commands in the way specified by the standard. It must also implement S registers and must use registers S0, S3, S4, S5, S6, S7, S8, and S10 for the purposes given in the standard. It also must implement any command beginning with the plus sign, "+" followed by any letter A to Z, only in accordance with ITU recommendations. Modem manufacturers are free to implement other commands and S-registers as they see fit, and may add options to standard commands.


GSM

The ETSI GSM 07.07 (3GPP TS 27.007) specifies AT style commands for controlling a
GSM The Global System for Mobile Communications (GSM) is a family of standards to describe the protocols for second-generation (2G) digital cellular networks, as used by mobile devices such as mobile phones and Mobile broadband modem, mobile broadba ...
phone or modem. The ETSI GSM 07.05 (3GPP TS 27.005) specifies AT style commands for managing the
Short Message Service Short Message Service, commonly abbreviated as SMS, is a text messaging service component of most telephone, Internet and mobile device systems. It uses standardized communication protocols that let mobile phones exchange short text messages, ...
(SMS) feature of GSM. Examples of GSM commands: 090505 developer.sonyericsson.com 090505 m2m-platforms.com GSM/3G modems typically support the ETSI GSM 07.07/3GPP TS 27.007 AT command set extensions, although how many commands are implemented varies. Most USB modem vendors, such as Huawei, Sierra Wireless, Option, have also defined proprietary extensions for radio mode selection (GSM/3G preference) or similar. Some recent high speed modems provide a virtual Ethernet interface instead of using a
Point-to-Point Protocol In computer networking, Point-to-Point Protocol (PPP) is a data link layer (layer 2) communication protocol between two routers directly without any host or any other networking in between. It can provide loop detection, authentication, transmissio ...
(PPP) for the data connection because of performance reasons (PPP connection is only used between the computer and the modem, not over network). The set-up requires vendor-specific AT command extensions. Sometimes the specifications for these extensions are openly available, other times the vendor requires an NDA for access to these.


Voice command set

Modems with voice or answering-machine capabilities support a superset of these commands to enable digital audio playback and recording.


See also

*
Access Point Name An Access Point Name (APN) is the name of a gateway between a mobile network (GSM, GPRS, 3G, 4G and 5G) and another computer network A computer network is a collection of communicating computers and other devices, such as printers an ...
(APN) * Command and Data modes (modem) *
ITU-T The International Telecommunication Union Telecommunication Standardization Sector (ITU-T) is one of the three Sectors (branches) of the International Telecommunication Union (ITU). It is responsible for coordinating Standardization, standards fo ...
Recommendations: ** H.324 (video) ** T.31 (
fax Fax (short for facsimile), sometimes called telecopying or telefax (short for telefacsimile), is the telephonic transmission of scanned printed material (both text and images), normally to a telephone number connected to a printer or other out ...
)


Notes and references


External links


List of AT commands: Basic (Hayes), Extended, Proprietary
*


3gpp.org
3GPP The 3rd Generation Partnership Project (3GPP) is an umbrella term for a number of standards organizations which develop protocols for mobile telecommunications. Its best known work is the development and maintenance of: * GSM and related 2G and ...
AT command set for
User Equipment In the Universal Mobile Telecommunications System (UMTS) and 3GPP Long Term Evolution (LTE), user equipment (UE) is any device used directly by an end-user to communicate. It can be a hand-held telephone, a laptop computer equipped with a mobile b ...

Modem initialisation string


(dead)
Determining your Class of Fax / Modem

Openmoko: AT Commands

Cell modem commands

ITU Standard V.250

AT Commands Reference Guide
from
Telit Telit Cinterion (known as Telit prior to January 1, 2023) is an Internet of Things (IoT) Enabler company headquartered in Irvine, California, United States. It is a privately held company with key operations in the US, Brazil, Italy, Israel, an ...
(dead) {{Modem standards Telecommunications-related introductions in 1981 Networking standards Modems AT command set