3

I am using arduino and esp8266 to interact with my HTTP server(Nginx+flask). I have already successful sent the request to server, however, while I checked the message esp8266 received, the esp8266 did not get all data from server.

The supposed result should be:

+IPD,179:HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Sat, 02 Jan 2010 00:11:02 GMT
Content-Type: application/json
Content-Length: 25
Connection: keep-alive

{
  "status": "SUCCESS"
}

and currently the result I got is:

+IPD,179:HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Sat,

The stream I sent to the ESP8266 module:

AT+CWMODE=1  
AT+CWJAP="Telstra1357_2.4G","adelaide12345"  
AT+CIPMUX=0  
AT+CIPSTART="TCP","192.168.0.6",80  
AT+CIPSEND=217 POST /data/push/ HTTP/1.1  
Host: 192.168.0.6  
User-Agent: Sensor Station  
Content-Type: application/json  
Content-Length: 89  

{"device_id":0,"data":[{"label":"Light","reading":606},  {"label":"Motion","reading":497}]}  `

I have tried to use timeout/delay to wait for more data, but it didnt work. Anyone has same problem?

Pringles
  • 421
  • 6
  • 9

1 Answers1

0

I had similar prolems! For me it helped checking the baud rate. I connected the ESP8266 with SoftwareSerial but the ESP worked on 115200 which is too high for SoftwareSerial. I changed the baud rate with AT+UART_DEF=9600,8,1,0,0 to 9600 and then it worked fine! You need to check your firmware to get the right AT- command.

Check your power supply (external power is most suitable) and send an CLOSE-command. It might help!

TeaAge
  • 152
  • 1
  • 16