Close

Talking to a remote webserver

A project log for Playing with ESP8266

What I've learned about the very exciting $3 WiFi module.

hari-wigunaHari Wiguna 11/27/2014 at 06:360 Comments

Arduino Code

Source: ESP8266 documentation

AT // Returns OK
AT+RST // Returns OK
AT+CWMODE=1 // 1=Client, 2=Access Point, 3=Client & AP. Returns either "OK" or "no change"
AT+CIPMUX=0 // 0=Single Channel, 1=Multi Channel. Returns OK
AT+CIPMODE=0 // 0=Received data will be sent to serial port as +IPD,conn, len. 1=plain data stream. Returns OK
AT+CWJAP="WIFI_SSID","WIFI_PASSWORD" // Connect to WIFI_SSID. Returns OK
AT+CIFSR // Returns module's IP Address followed by OK
AT+CIPSTART="TCP","SERVER_IP",PORT_NUM // Connect to SERVER_IP to send data. Returns OK
AT+CIPSEND=LENGTH // Prepare to send string of LENGTH bytes. Returns ">"
Once ">" is received, send the actual data (must end with two sets of CR+LF (counted in LENGTH). Returns OK or ERROR.
AT+CIPCLOSE // Close the connection to SERVER_IP. Returns OK or ERROR

Discussions