2016-06-19 15 views
-3

我已连接ESP 8266模块的Arduino不执行交请求

rx-rx, 

tx-tx, 

vcc=vin, 

rst=3.3 
and 
chp=3.3v 
gnd=gnd; 

和我已连接并打开串行监控。我执行AT命令来检查

AT gives ok 

AT+CWJAP=" "," " 

它可以连接到我的移动热点,因为它表明然后一个连接 我执行

AT+CIPSTART="TCP","31.220.105.163",2082 

它显示CONNECTED,然后我执行AT+CIPSEND=2

它显示>符号

然后我做了

POST /arduino.php HTTP/1.1\r\nHost: locateurfamily.com\r\nContent-Type: application/x-www-form-urlencode\r\nContent-Length: 2\r\n\r\ntemp=1&humidity=1

它显示发送确定,但它还没有到达我的sql服务器。

我的PHP代码是正确的,因为我已经通过Android应用测试了它。

如果您没有看到任何问题,请告诉我另一种方式,以便我可以连接Arduino + ESP8266发送变化的温度和湿度。

+1

http://stackoverflow.com/help/how-to-ask –

+2

问题提示:不要求紧急处理 - 你的问题并不比其他任何问题更重要今天出现。不要求电子邮件或私人信使的待遇 - 本网站的重点是提供问题和答案公开展示,这样他们可以让未来的读者受益。 – halfer

+1

请仔细阅读[docs](https://github.com/espressif/ESP8266_AT/wiki/CIPSEND)。 –

回答

0

您发送的错误值为AT+CIPSEND

你应该把整个POST字符串的大小。

这里的程序为POST数据。

AT+CWJAP="Access Point","Password"\r\n // Join an access point. 
AT+CIPSTART="TCP","yourWebsite.com",80\r\n // Start TCP. 

AT+CIPSEND=75\r\n // Initiate sending. 
POST /arduino.php HTTP/1.1\r\nHost: locateurfamily.com\r\ntemp=1&humidity=1\r\n\r\n // Post data. 
AT+CIPCLOSE // Close the connexion. 

确保你在你的Arduino串行监视器选择 “无论NL & CR”。 要发送\r\n只需按Enter键。

AT+CIPSEND=75值是您POST字符串的长度,\r(和\n)只是一个字符。请看看这个(How to send a data from arduino uno to a webpage through esp8266 wifi module?