Software Serial for ESP8266

Software serial uses timer, be careful when you are using software serial. Timer is also used for WiFi communication section if you don’t give enough time to WiFi routines it will create problem of stack error or misbehavior. It is better to use software serial only when you need two serial ports and also avoid use of software serial for data reception.

Software serial can be implemented on any GPIO pin of ESP8266.

For this you need SoftwareSerial Library for ESP.

Download from here Link

To add library in Arduino IDE, Library path is different for ESP8266

C:\Program Files\Arduino\portable\packages\esp8266\hardware\esp8266\2.1.0\libraries

Software serial library can be included in your program using below commands

 

 

Command format is SoftwareSerial(rxPin, txPin, inverse_logic, buffer size);

Program for software serial

We are using GPIO14 as Rx pin and GPIO15 as Tx pin

 

 

Results

Observe both serials and send some data to both serial data, data send from hardware serial is sent out from software serial and vice versa.

I will not recommend use of software serial until it becomes must. It disturbs WiFi functionality.

Leave a Reply