Hayes AT Command Set for Modem Configuration

Author

Reads 2.7K

Monitor Displaying Error Text
Credit: pexels.com, Monitor Displaying Error Text

The Hayes AT command set is a widely used protocol for configuring and controlling modems. It's a simple yet powerful set of commands that allows you to interact with your modem.

The Hayes AT command set is based on a set of standardized commands that start with the letters "AT". This is where the "AT" in AT command set comes from.

To use the Hayes AT command set, you need to send a command to your modem using a terminal or command line interface. This can be done using a computer or a mobile device.

The Hayes AT command set is still widely used today, especially in older modems and devices.

Modem Basics

Hayes was the first modem manufacturer to develop modems that could support multiple communication methods, making them compatible with almost any other modem on the market.

This was a game-changer because it allowed companies to buy one modem model, which significantly lowered hardware costs. Hayes became the leading vendor for a time due to this innovation.

Credit: youtube.com, Building a Go package to control an LTE modem using serial AT commands (June 21, 2020)

The AT command set was developed by Hayes to support different configurations of the local modem for each remote connection, even if the remote modem was not a Hayes modem.

Terminal software first sent the letters AT to get the modem's attention, followed by a configuration string of up to 45 characters.

A typical modem string sent to the modem is a series of commands that follow the D for 'dial', and can be up to 45 characters long.

The pattern for each command in the configuration string is either a capital letter-number, a symbol-capital letter-number, or a symbol-capital letter-number-equal sign-number.

A unique perspective: How to Set up Direct Tv Remote

Commands

The Hayes AT command set is a standardized set of commands that allows you to interact with your modem. Every command starts with "AT" or "at", and the strings "aT" and "At" are invalid to start a command.

To make adjustments to your modem string, you can use the basic command set, which consists of all the necessary commands to use the modem. The basic command set can be recognized by the alphanumeric character directly following the "AT".

Credit: youtube.com, AT Command Set 101

The length of a command line should be less than 40 characters. Telephone numbers can contain the characters "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "=", "",, ";", "#", "+", and ">". All other characters in a telephone number are ignored.

Here are some basic AT commands:

The AT+CFUN command can be used to set the phone functionality to either 0 (minimum functionalities) or 1 (full functionality).

Basic Commands

The basic commands are the foundation of the Hayes AT command set. Every command starts with “AT” or “at”, and the strings “aT” and “At” are invalid to start a command.

Commands can be given in uppercase and lower case, and several commands can be combined in one command line. The length of a command line should be less than fourty characters.

The basic command set consists of all the necessary commands to use the modem. Basic commands can be recognized by the alphanumeric character directly following the “AT”.

Ethnic kid showing command to intelligent dog while squatting on asphalt pavement in city
Credit: pexels.com, Ethnic kid showing command to intelligent dog while squatting on asphalt pavement in city

To switch from command mode to data mode, a control command can be used. However, switching back from data mode to command mode with in-band signalling was a little bit more tricky.

The escape sequence to jump back to command mode is defined as “+++”, three plus signs. The chance that three plus signs within a data stream would trigger the switch was reduced by adding an additional rule: only when the “+++” data sequence was preceded and followed by one second of silence on the line, the modem would recognize it as an escape sequence.

Some basic commands are:

  • ATE - Command Echo: determines whether or not the modem echoes characters received from the DTE during command state.
  • ATD - Dial Command: used to dial a telephone number.
  • AT+CPIN - Enter PIN: used to enter or change the PIN code.
  • AT+CFUN - Set Phone Functionality: used to set the phone functionality to minimum or full.

At+creg Network Registration

AT+CREG Network Registration is used to control network registration unsolicited result codes. You can enable or disable this feature by setting the value to 1 or 0 respectively.

The AT+CREG command has two main settings: 0 and 1. Setting it to 0 disables network registration unsolicited result codes, while setting it to 1 enables them.

Here are the possible network registration status values:

You can use these values to determine the network registration status of your device.

At+CMgf Sms Format

Credit: youtube.com, Sending SMS with VB.NET and AT commands

AT+CMGF SMS Format is used to set the SMS format.

The AT+CMGF command supports two modes: PDU Mode and Text Mode.

PDU Mode is represented by the number 0.

Text Mode is represented by the number 1.

Here are the supported modes in a list:

  • 0 : PDU Mode
  • 1 : Text Mode

Flow Control and Settings

Flow control is a crucial aspect of serial communication, and the Hayes AT command set has several commands to manage it. The AT+IFC command controls local flow control between the DTE and DCE when the modem is in Data Mode.

You can set flow control to one of three modes: none, XON/XOFF, or line 133. This is done by using the dce2dte/dte2dce option with the AT+IFC command.

Here are the supported flow control modes:

To prevent lost characters, CTS/RTS handshaking can be configured using the AT command AT&K3. This setting is essential for reliable serial communication.

AT&T Read Configuration

The AT&T Read Configuration feature is a useful tool for modem users. It displays the stored and active modem profile settings.

High-Angle Shot of a Boy Sitting on Grey Chair while Using His Laptop Computers
Credit: pexels.com, High-Angle Shot of a Boy Sitting on Grey Chair while Using His Laptop Computers

You can access this feature by using the command "AT&V" in the modem's configuration menu. This will show you the current settings and any changes that have been made.

The stored and active modem profile settings are crucial for maintaining a stable internet connection. They determine how data is transmitted and received.

To troubleshoot any issues with your modem, it's essential to understand the settings that are currently in place. The AT&T Read Configuration feature makes it easy to do just that.

AT+ICF to DCE Character Framing

AT+ICF to DCE Character Framing is a crucial setting that determines the local serial port's start-stop character framing used by the DCE. This setting has a significant impact on data transmission.

You can get possible values for AT+ICF by using the command, which will list the available options. The current values can be retrieved using the same command.

Here are the possible values for AT+ICF:

  • 0 : auto detect
  • 1 : 8 data bits, 0 parity bit, 2 stop bits (8N2)
  • 3 : 8 data bits, 0 parity bit, 1 stop bit (8N1)
  • 4 : 7 data bits, 0 parity bit, 2 stop bits (7N2)
  • 5 : 7 data bits, 1 parity bit, 1 stop bit (7P1)

These options give you flexibility in configuring your serial port to work with different devices and systems.

AT+IPR Boud Rate

A mother and her young son bond on a hay bale in a sunny countryside field.
Credit: pexels.com, A mother and her young son bond on a hay bale in a sunny countryside field.

The AT+IPR command is used to set the data rate on the GSM Data Module's serial interface. This is a crucial setting that affects how quickly data is transmitted.

The default rate is 9600, which is a common baud rate used in many serial communication applications.

At+Cops Operator Selection

At+Cops Operator Selection is a crucial setting for controlling the flow of data in your device. It allows you to select the operator for your device's flow control.

The default setting for At+Cops Operator Selection is 0, which means the operator is set to the default value. This setting can be changed to 1, 2, or 3 to select a specific operator.

Changing the operator setting can affect the flow control of your device, so it's essential to choose the correct operator for your specific use case. For example, setting the operator to 1 can enable the flow control feature for a specific service.

A unique perspective: Wireless Set No. 1

At+Cbst: Bearer Type Selection

Colorful medieval parade with flag bearers in historic town square.
Credit: pexels.com, Colorful medieval parade with flag bearers in historic town square.

AT+CGBT is used to control the presentation format of short messages, from the modem.

This command is useful for selecting the bearer service for mobile originated calls.

The AT+CBST command allows you to select the bearer type.

The bearer type selection is crucial for controlling the presentation format of short messages.

Flow Control

Flow Control is a crucial aspect of communication between devices, especially when it comes to preventing lost characters. This is achieved through CTS/RTS handshaking, which can be configured using the AT&K3 command.

There are different flow control methods, including XON/XOFF and line 133. These can be selected using the AT+IFC command, which controls the operation of local flow control between the DTE and DCE.

The AT+IFC command has three options for flow control: none, XON/XOFF, and line 133. These options are listed below:

  • 0 : none
  • 1 : XON/XOFF
  • 2 : line 133

By selecting the right flow control method, you can ensure smooth communication between devices and prevent lost characters.

Data Terminal Ready

Credit: youtube.com, How to do hardware DTR/DSR flow control on Linux (serial port programming)?

Data Terminal Ready should control the modem, and if DTR is high, the modem is ready to receive calls. If DTR is low, the modem should not receive any more calls and should hang up any existing call.

The AT command to configure Data Terminal Ready is AT&D2. This command tells the modem to control the DTR signal, ensuring that incoming calls are properly handled.

Data Terminal Ready is an essential setting for any modem, as it helps manage the flow of data and prevent lost characters. By controlling the DTR signal, you can ensure that your modem is always ready to receive calls when needed.

Optional Silent Connection

You can configure your modem to be quieter by turning off the speaker. This is especially useful if you're in a computer room where noise needs to be kept to a minimum.

To turn off the speaker, use the ATM0 command.

If you want to disable command echoing, you can use the ATE command. Set it to 0 to disable echoing.

On a similar theme: Google Ad Settings Turn off

Web banner with online information on computer
Credit: pexels.com, Web banner with online information on computer

Alternatively, you can use the ATQ1 command to disable CONNECT messages. This will prevent the modem from outputting messages like "CONNECT 9600" when a call is received.

The modem has a "quiet mode" that disables these messages, making it ideal for a quieter computer room.

Here's a summary of the commands to turn off the speaker and disable command echoing:

By using these commands, you can create a more peaceful and efficient computer environment.

Autobaud

Autobaud is a feature that enables automatic baud rate detection, which is facilitated by the Hayes command set.

The Hayes command set uses specific characters to facilitate autobaud, with "A" being "100 0001" and "T" being "101 0100".

These characters have regular bit patterns that allow for easy detection.

The RS-232 interface transmits the least significant bit first, which is why the line pattern with 8-N-1 settings is used as a syncword.

V.250

V.250 is a standard established by the ITU-T in 1998, which aims to provide a common command set for modems. It's a crucial part of flow control and settings.

Close Up Photo of Black Cable Head
Credit: pexels.com, Close Up Photo of Black Cable Head

The standard mandates that a V.250 compliant modem must implement the A, D, E, H, I, L, M, N, O, P, Q, T, V, X, Z, &C, &D, and &F commands in a specific way.

In addition, it requires the implementation of S registers, including S0, S3, S4, S5, S6, S7, S8, and S10, for specific purposes.

Modem manufacturers are free to implement other commands and S-registers as they see fit, but must follow the ITU-T recommendations for commands starting with the plus sign, "+".

Here are the defined leading character sequences in V.250:

Error Handling and Connection

Error handling is crucial in the Hayes AT command set, as it allows you to detect and recover from errors that may occur during communication.

The Hayes command set includes several error-handling commands, such as `AT+CMEE=1`, which enables error messages to be displayed.

Error messages can be displayed in various formats, such as numeric or text, and can be configured using commands like `AT+CMEE=2` for numeric error messages.

Credit: youtube.com, How to fix dial connection error 777

A common error in the Hayes AT command set is the "busy" error, which occurs when the modem is already in use and cannot accept new commands.

To recover from this error, you can use the `AT+CLCK=1` command to check the modem's status and determine if it's busy or not.

The Hayes command set also includes commands for checking the modem's connection status, such as `AT+CSQ`, which displays the signal quality of the connection.

A signal quality of 0-99 is displayed, with higher values indicating a stronger signal.

The `AT+CSQ` command can be used to check the signal quality before sending data over the connection.

At F Reset to Factory Defaults

The AT&F command is a game-changer for anyone working with modems. It resets the modem to its factory-defined configuration, essentially wiping the slate clean and restoring it to its default settings.

To issue the AT&F command, simply type "AT&F" into the modem, and it will reset its parameters to the factory defaults. This is a great way to troubleshoot issues or start from a known good state.

Credit: youtube.com, AT Commands Demonstated on W2SW0012

The AT&F command is a key part of the Hayes AT command set, which has been widely adopted across the industry. It's a testament to the flexibility and versatility of the AT command set, which allows modems to be configured and customized in a wide range of ways.

Here's a quick rundown of the AT&F command and its effects:

  • Resets the modem to its factory-defined configuration
  • Wipes the modem's configuration memory
  • Restores the modem's parameters to their default values

If you're experiencing issues with your modem or just want to start fresh, the AT&F command is a great place to start. Just be aware that clearing the modem's configuration memory can delete any custom settings or configurations you may have made.

Compatibility

Many people assume that the Hayes AT command set was a universal standard, but that's not entirely true. The lack of a written standard led other modem manufacturers to copy the external visible commands and basic actions, but with subtle differences.

These differences affected how modems changed from state to state, handled error conditions, and timed out. It's like trying to communicate with someone who speaks the same language, but with a unique accent that throws you off.

Credit: youtube.com, Setup a terminal to send AT commands to the Telelogger cellular modem

Each manufacturer added new commands to handle emerging needs, often incompatible with other modems. This made it difficult to rely on the basic Hayes command set.

For example, setting up hardware or software handshaking required many different commands for different modems. Some modems needed a pause of several seconds after receiving the "AT Z" reset command, while others didn't.

Some modems required spaces between commands, while others didn't. This added complexity made it hard to write programs that could work with all "Hayes-compatible" modems.

Here are some quirks that made many modems effectively incompatible:

  • Requiring a pause of several seconds after receiving the "AT Z" reset command
  • Requiring spaces between commands
  • Unhelpfully changing baud-rate of their own volition, leaving the computer with no clue how to handle the incoming data

As a result, many communications programs had to give up on the idea of talking to all "Hayes-compatible" modems. Instead, they had to try to determine the modem type from its responses or provide the user with options to enter special commands to coerce their particular modem into acting properly.

Ellen Brekke

Senior Copy Editor

Ellen Brekke is a skilled and meticulous Copy Editor with a passion for refining written content. With a keen eye for detail and a deep understanding of language, Ellen has honed her skills in crafting clear and concise writing that engages readers. Ellen's expertise spans a wide range of topics, including technology and software, where she has honed her knowledge of Microsoft OneDrive Storage Management and other related subjects.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.