softwareserial between arduino uno and esp8266
I have an Arduino UNO and HUZZAH ESP8266 module. I need to send data between Arduino UNO and ESP module via Software Serial. Right now I have the ESP module write data and Arduino UNO display data, but not working. When I run the Arduino UNO and open its Serial Monitor, nothing is printed using below source code.
- ESP8266 RX PIN connected to Arduino UNO PIN 2.
- ESP8266 TX PIN connected to Arduino UNO PIN 3.
- Using the FTDI cable that came with HUZZAH ESP8266 to power this module. I just individually connected the RX and TX pins to the ARDUINO PIN 2 and 3 as mentioned above.
Any ideas what why not working? Below is code for both modules. Thanks,
Arduino UNO
#include <SoftwareSerial.h>SoftwareSerial ESPserial(2, 3); // RX | TXvoid setup(void){ //Start hardware Serial communication Serial.begin(115200); //Start the software serial for communication with the ESP8266 component ESPserial.begin(57600); }void loop(void){if (ESPserial.available()){ Serial.println("ESP available!!!"); Serial.println(ESPserial.read());}}
HUZZAH ESP8266
#include <ESP8266WiFi.h>#include <SoftwareSerial.h>SoftwareSerial ESPserial(2, 3); // RX | TXvoid setup(void){ //Start the software serial for communication with the Arduino UNO component ESPserial.begin(57600); //TODO: setup Wifi}void loop(void){ ESPserial.write("This message generated by ESP module."); delay(500);}