-->
Page 1 of 1

Receive data using the ESP8266 wifi module

PostPosted: Thu Jan 15, 2015 9:34 am
by CaymanEss
Hi,

I'm using the ESP8266 wireless transceiver module with an Arduino UNO. The module is working as expected (I've tested my configuration with several sample projects I found on the net).

For ease of testing I've set things up so that I can communicate directly with the ESP8266 via the Serial Monitor window. Here are the commands I use to get things going:

Code: Select all// What firmware version is installed?
AT+GMR
0018000902-AI03

// Reset the device
AT+RST
OK
L(CÇäÿZNÿbc@ˆþD@JSÀ€àà
[Vendor:www.ai-thinker.com Version:0.9.2.4]
ready

// Set the data transmission mode (1 is "data mode")
AT+CWMODE=1
no change

// Connect the ESP8266 to my access point
AT+CWJAP="XXXX","XXXX"
OK

// What is the ESP8266's ip address?
AT+CIFSR
192.168.161.27

// Start a UDP connection to an ntp server (port 123)
AT+CIPSTART="UDP","time-a.timefreq.bldrdoc.gov",123
OK


Ok... what is the next step? How do I receive the data that gets sent back from the ntp server? I know I can use the "AT+CIPSEND" to send data but what command(s) do I use to receive data?

Any advice would be much appreciated!
-CS

Re: Receive data using the ESP8266 wifi module

PostPosted: Thu Jan 15, 2015 3:53 pm
by quantalume
When data is received, it is automatically sent out the serial port. Each packet received produces an output that starts with "+IPD". See the +IPD row in the AT command table at the link below:

http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module

Re: Receive data using the ESP8266 wifi module

PostPosted: Thu Jan 15, 2015 4:41 pm
by CaymanEss
quantalume wrote:When data is received, it is automatically sent out the serial port. Each packet received produces an output that starts with "+IPD".


Thank you so much for your reply. Would you happen to know of any example code which does this? It seems to me that this would be a very common thing to do but I haven't seen any sample code that works.

Thank you in advance!

Re: Receive data using the ESP8266 wifi module

PostPosted: Tue Jan 27, 2015 8:28 pm
by erictaoy
There is a library for this: https://github.com/Diaoul/arduino-ESP8266