ESP8266 AT

From ElectroDragon
Revision as of 02:29, 17 September 2020 by Chao (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Use Guide of AT Commands

At Commands Header text Header text
Reset AT+RST restart the module, received some strange data, and "ready"
Set Work Mode AP+STA AT+CWMODE=3 change the working mode to 3, AP+STA, only use the most versatile mode 3, AT+RST may be necessary when this is done
Join Network AT+CWLAP search available wifi spot
Join Network AT+CWJAP=you ssid, password join my mercury router spot, e.g. AT+CWJAP=“TP-LINK_4226”,“1234567890”, password length must be correct, remove all the empty space in the command
Join Network AT+CWJAP? check if connected successfully, or use AT+CWJAP=?, or use AT+CIFSR to find your ip address
Cloud Update AT+GMR check current version, output AT+GMR AT version:0.30.0.0(Jul 3 2015 19:35:49) / SDK version:1.2.0 / Ai-Thinker Technology Co.,Ltd. / Build:1.2.0.A Aug 7 2015 17:21:44 / OK
Cloud Update AT+CIUPDATE get reply +CIPUPDATE:1, +CIPUPDATE:2, +CIPUPDATE:3, +CIPUPDATE:4, OK
TCP Client AT+CIPMUX=1 turn on multiple connection
TCP Client AT+CIPSTART=4,"TCP","192,168.1.104",9999 connect to remote TCP server 192.168.1.104 (the PC)
TCP Client AT+CIPMODE=1 optionally enter into data transmission mode
TCP Client AT+CIPSEND=4,5 send data via channel 4, 5 bytes length (see socket test result below, only "elect" received), link will be "unlink" when no data go through
TCP Server AT+CIPSERVER=1,9999 setup TCP server, on port 9999, 1 means enable
TCP Server AT+CIFSR check module IP address
  • Test, PC as a TCP client connect to module using socket test, send data
  • Socket test running result, In the sockettest, do not tick the "secure" in TCP client, it causes unstable

AI Mod Added Commands

description Header text return
Set GPIO value, 12 is gpio, 1 is set value AT+CIOWRITE=12,1 OK
Read GPIO value, 13 is gpio AT+CIOREAD=13 1:HIGH -
Read ADC AT+CIOADC Example
Set serial baud:

AT+CIOBAUD =<baudrate>,<databits>,<stopbits>,<parity>,<flow control>

  • AT+CIOBAUD =115200
  • AT+CIOBAUD =115200,8
  • AT+CIOBAUD =115200,8,1,0,0
-
Check rams: AT+CSYSHEAP
smart start: AT+CWSMARTSTART =<method>, AT+CWSMARTSTART to stop it * 0: use AI-LINK
  • 1: use ESP-TOUCH
  • 2: use AIR-KISS