ESP8266 WiFi – AT commandolijst

ESP8266 chip bovenkant

Espressif logo vol

Gebruik je de standaard  “AT” firmware op de ESP8266 chip, dan kun je eenvoudig met seriele commando’s de chip aansturen, instellen en data verzenden/ontvangen!
Ps. AT is een afkorting van “ATtention” en wordt veelal bij communicatie van modems gebruikt, hieronder vind je een lijst van AT commando’s voor de ESP8266 chip.
Een AT commando geeft een begin van een regel aan, en is niet een daadwerkelijk onderdeel van een commando zelf.

CommandsDescriptionTypeSet/ExecuteInquiryTestParametersExamplesResponse
AT+RSTrestart the modulebasic------
AT+GMRget firmware versionbasicAT+GMR----0018000902-AI03
AT+CIOBAUDset module baud ratebasicAT+CIOBAUD=AT+CIOBAUD?-Baud rate. Factory value is 9600.AT+CIOBAUD=57600BAUD->57600 OK, then garbage since the module has switched to the new baud rate.
Set to 57600 for Uzebox.
AT+CWQAPquit the APwifiAT+CWQAP-AT+CWQAP=?---
AT+CWLAPlist available APswifiAT+CWLAP-----
AT+CWSAPset wifi login credentialswifiAT+ CWSAP= ,,, AT+ CWSAP?-ssid, pwd, chl = channel, ecn = encryptionConnect to your router: AT+CWJAP="YOURSSID","YOURPASSWORD"; and check if connected: AT+CWJAP?-
AT+CWJAPjoin the APwifiAT+ CWJAP =,< pwd >AT+ CWJAP?-AT+CWJAP="WifiName"--
,"WifiPass" MAX 64 bytes long
AT+CWMODEwifi modewifiAT+CWMODE=AT+CWMODE?AT+CWMODE=?1= Sta, 2= AP, 3=both--
AT+CIPSTARTstart a TCP or UDP connectionTCP/IP1)single connection (+CIPMUX=0) AT+CIPSTART= ,,; 2) multiple connection (+CIPMUX=1) AT+CIPSTART= ,, -AT+CIPSTART=?id = 0-4, type = TCP/UDP, addr = IP address, port= portConnect to another TCP server, set multiple connection first: AT+CIPMUX=1; connect: AT+CIPSTART=4,"TCP","X1.X2.X3.X4",9999-
AT+CIPSENDsend data over connection(id)TCP/IP1)single connection(+CIPMUX=0) AT+CIPSEND=; 2) multiple connection (+CIPMUX=1) AT+CIPSEND= ,-AT+CIPSEND=?-send data: AT+CIPSEND=4,15 and then enter the data MAX 2048 bytes-
AT+CIPCLOSEclose connection(id)TCP/IPAT+CIPCLOSE= or AT+CIPCLOSE-AT+CIPCLOSE=?---
AT+CIFSRlist the local IP addressTCP/IPAT+CIFSR-AT+ CIFSR=?---
AT+CIPSTATUSget the connection statusTCP/IPAT+ CIPSTATUS-----
AT+CIPSERVERset as server/listen()TCP/IPAT+ CIPSERVER= [, ]--mode 0 to close server mode, mode 1 to open; port = portturn on as a TCP server: AT+CIPSERVER=1,8888, check the self server IP address: AT+CIFSR=?-
AT+CIPMUXset multiple connections modeTCP/IPAT+ CIPMUX=AT+ CIPMUX?-0 for single connection 1 for mutiple connection--
AT+CWLIFget IP's of devices connected to APTCP/IPAT+CWLIF--returns ip addresses of all devices connected to softAP(module as AP or STA+AP)--
AT+CIPSTOset server timeout(listen wait time)TCP/IPAT+CIPSTO=AT+CIPSTRO?---automatic query response:"+CIPSTO:
AT+CIPUPDATEupdate firmware over networkTCP/IPAT+CIPUPDATE----automatic response:"+CIPUPDATE:1\n2\n3\n4\n
AT+GSLPput module into deep sleepbasicAT+GSLP=----module will sleep and wake up after milliseconds, not all versions pins are setup for this.
AT+CIPSTAMACset MAC address of STAtionwifiAT+CIPSTAMAC=----automatic query response:+CIPSTAMAC:, ex:AT+CIPSTAMAC="18:aa:35:97:d4:7b"
AT+CIPAPMACset MAC address of softAPwifiAT+CIPAPMAC=----automatic query response:+CIPAPMAC:, ex:AT+CIPSTAMAC="18:aa:35:97:d4:7b"
AT+CIPSTAset IP address of STAtionwifiAT+CIPSTA=----automatic query response:+CIPSTA:, ex:AT+CIPSTA="192.168.101.108"
AT+CIPAPset IP address of softAPwifiAT+CIPAP=----automatic query response:+CIPAP:, ex:AT+CIPAP="192.168.101.108"
+IPDreceived packet header, received data followsbasicreceive only----"+IPD,x,y:recv_bytes\r\n" where x is the connection it's from and y is the number of bytes

Meer informatie is in de documentatie (pdf) te vinden.

Bronnen:
developershome.com
uzebox.org