Hi, I have a problem with sending AT command from Arduino Mega to ESP8266.
Below my code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(19, 18); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("AT+CIPMUX=1");
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}
Connection between Arduino and ESP ,
RX1 - TX
TX1 - RX
3,3v - VCC,CH_EN
GND - GND
If I connect ESP to USB UART converter and I use serial port then i have communication and i can send AT command and ESP responds.
If you have any advice please reply.