The Hayes command set or AT commands are instructions used to control a modem, but the default firmware of ESP8266 also allows us to use AT commands to communicate with ESP8266.
AT is the abbreviation of Attention. Every command line starts with “AT” or “at”. Note that the starting “AT” is the prefix that informs the modem about the start of a command line. It is not part of the AT command name. For example, +GMR is the actual AT command name in AT+GMR. However, some people and web sites use them interchangeably as the name of an AT command.
Here is a list of AT commands which you can use to communicate with ESP8266 (you can send these commands via Arduino/MCU to drive ESP8266). There are two types of AT commands – basic commands(commands that do not start with “+”) and extended commands(commands that start with “+”).
Basic commands are AT commands that do not start with “+”. For example, D (Dial), A (Answer), H (Hook control) and O (Return to online data state) are basic commands. Rest are extended commands explained below :
Commands | Description | Set/Execute | Parameters |
---|---|---|---|
AT+RST | restart the module | – | – |
AT+CWMODE | wifi mode | AT+CWMODE=<mode> | 1= Sta, 2= AP, 3=both |
AT+CWJAP | join the AP | AT+ CWJAP =<ssid>,< pwd > | ssid = ssid, pwd = wifi password |
AT+CWLAP | list the AP | AT+CWLAP | |
AT+CWQAP | quit the AP | AT+CWQAP | |
AT+ CWSAP | set the parameters of AP | AT+ CWSAP= <ssid>,<pwd>,<chl>, <ecn> | ssid, pwd, chl = channel, ecn = encryption |
AT+ CIPSTATUS | get the connection status | AT+ CIPSTATUS | |
AT+CIPSTART | set up TCP or UDP connection | 1)single connection (+CIPMUX=0) AT+CIPSTART= <type>,<addr>,<port>; 2) multiple connection (+CIPMUX=1) AT+CIPSTART= <id><type>,<addr>, <port> | id = 0-4, type = TCP/UDP, addr = IP address, port= port |
AT+CIPSEND | send data | 1)single connection(+CIPMUX=0) AT+CIPSEND=<length>; 2) multiple connection (+CIPMUX=1) AT+CIPSEND= <id>,<length> | |
AT+CIPCLOSE | close TCP or UDP connection | AT+CIPCLOSE=<id> or AT+CIPCLOSE | |
AT+CIFSR | Get IP address | AT+CIFSR | |
AT+ CIPMUX | set mutiple connection | AT+ CIPMUX=<mode> | 0 for single connection 1 for mutiple connection |
AT+ CIPSERVER | set as server | AT+ CIPSERVER= <mode>[,<port> ] | mode 0 to close server mode, mode 1 to open; port = port |
+IPD | received data |
A brief list of AT commands can be found HERE
Comprehensive list of AT commands can be found HERE