我正在做一个简单的tcp通信,从arduino到树莓派pi与无线arduino上的ESP8266 wifi模块进行通信。tcp服务器运行在树莓派。我是能够在9600如何让AT命令在arduino中以编程方式在ESP8266 wifi模块中工作
AT+CIPMUX=1
AT+CIPSTART=4,"TCP","192.168.43.150",7777
AT+CIPSEND=4,5
>hai
如何做到这一点编程的一个Arduino sketch.I用在我的Arduino UNO下面的代码波特率做以下AT在Arduino的串口监视器命令TCP通信,但仍然没有任何成功。波特率仅为9600,因为它直接在串行监视器上工作。
#include <SoftwareSerial.h>
SoftwareSerial esp8266(2,3);
void setup()
{
Serial.begin(9600);
esp8266.begin(9600); // your esp's baud rate might be different
}
void loop()
{
esp8266.println("AT");
if(esp8266.available()) // check if the esp is sending a message
{
while(esp8266.available())
{
// The esp has data so display its output to the serial window
char c = esp8266.read(); // read the next character.
Serial.write(c);
}
}
}
的连接如下
ESP8266 Arduino Uno
Vcc 3.3V
CH_PD 3.3V
RX RX(PIN 2)
TX TX(PIN 3)
GND GND
现在有效。 Thankyou – 2015-03-10 09:08:32