ESP32 Software Serial compiling error

HI,
i currenty work on a project with DOIT ESP32 DEVKIT V1
and i want to set up an UART communication with an Arduino MEGA
however the SoftwareSerial library has an error while compiling
(i did install the proper SoftwareSerial libraries for esp32)

ERROR message:

C:\Users\yahya\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:41:27: fatal error: avr/interrupt.h: No such file or directory
compilation terminated.
Multiple libraries were found for "WiFi.h"
Used: C:\Users\yahya\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries\WiFi
Multiple libraries were found for "SoftwareSerial.h"
Used: C:\Users\yahya\Documents\Arduino\libraries\SoftwareSerial-master
Not used: C:\Users\yahya\Documents\Arduino\libraries\EspSoftwareSerial-6.15.2
Not used: C:\Users\yahya\Documents\Arduino\libraries\EspSoftwareSerial-6.12.0
Not used: C:\Users\yahya\Documents\Arduino\libraries\EspSoftwareSerial
exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.

i checked for the "avr/interrupt.h" header and its fine
i even reinstalled the IDE but it still does it

in this project i use these libraries (idk if it matters)

#include <SoftwareSerial.h>
#include <WiFi.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <SPIFFS.h>

thank you for your time and help!!

Why do you want to use SoftwareSerial when the ESP32 has more than one hardware serial interface ?

which means??
idk really i m kind of a newbie with the esp32

It means that you don't need to use SoftwareSerial

Take a look at this sketch for the ESP32


void setup()
{
  Serial2.begin(115200, SERIAL_8N1, 14, 15);
}

void loop()
{
  Serial2.println("bong");
  delay(1000);
}

It uses pins 14 and 15 to create a serial interface named Serial2 using 8 bits, no parity and 1 stop bit then outputs a message on the pins every second

1 Like

ty very much i was struggeling
i will try it and see

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to [url=https://forum.arduino.cc/index.php?topic=710766.0]Learn How To Use The Forum[/url].

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

The is apparently a software serial for the ESP32, never used it myself, never needed to, the ESP32 has additional hardware serial ports.

You will find the details with a Google search on;

'software serial for ESP32'

Your trying to use the software serial for the AVR processors, thats not going to work on an ESP32.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.