Fatal error: esp_intr.h: No such file or directory

I'm using esp32 devkit v1 with 38 pins and trying to run an ac dimmer module that is not robotdyn brand but uses the rbddimmer library. when I try to use and upload the RBDDimmer library example “SerialMonitorDim”. the error code appears, I'm confused about what I should do. Thank you very much

In file included from c:\Users\acern\OneDrive\Documents\Arduino\libraries\RBDDimmer\src/RBDdimmer.h:9,
                 from C:\Users\acern\AppData\Local\Temp\.arduinoIDE-unsaved2025620-1632-174dvx5.wxb0l\SerialMonitorDim\SerialMonitorDim.ino:54:
c:\Users\acern\OneDrive\Documents\Arduino\libraries\RBDDimmer\src/esp32/RBDmcuESP32.h:10:10: fatal error: esp_intr.h: No such file or directory
   10 | #include "esp_intr.h"
      |          ^~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1



Using the correct tags, post your code so we can understand and help you.

esp_intr.h is part of older v2 ESP32 board platform. The current version (for a little over a year) is v3, which no longer has this file. The library has apparently not been updated.

You can downgrade the esp32 board version: the last v2 is 2.0.17

if you wish to use ESP32 core 3.x have a look at System - under esp_hw_support
The header file esp_intr.h has been deleted. Please include esp_intr_alloc.h to allocate and manipulate interrupts.

This is the code I used, and when I compiled it, the error code appeared as above

#include <RBDdimmer.h>//

#define USE_SERIAL  Serial
#define outputPin  12 
#define zerocross  5 // for boards with CHANGEBLE input pins


dimmerLamp dimmer(outputPin);

int outVal = 0;

void setup() {
  USE_SERIAL.begin(9600); 
  dimmer.begin(NORMAL_MODE, ON); 
  USE_SERIAL.println("Dimmer Program is starting...");
  USE_SERIAL.println("Set value");
}

void printSpace(int val)
{
  if ((val / 100) == 0) USE_SERIAL.print(" ");
  if ((val / 10) == 0) USE_SERIAL.print(" ");
}

void loop() {
  int preVal = outVal;

  if (USE_SERIAL.available())
  {
    int buf = USE_SERIAL.parseInt();
    if (buf != 0) outVal = buf;
    delay(200);
  }
  dimmer.setPower(outVal); 

  if (preVal != outVal)
  {
    USE_SERIAL.print("lampValue -> ");
    printSpace(dimmer.getPower());
    USE_SERIAL.print(dimmer.getPower());
    USE_SERIAL.println("%");

  }
  delay(50);

}

Read this

System - ESP32 - — ESP-IDF Programming Guide v5.0 documentation

at esp_hw_support

“ The header file esp_intr.h has been deleted…………….”

I have uninstalled the previous version and downloaded version 2.0.17, and there is a message like this

do I have to include “include esp_intr_alloc.h” into my program like I include header files or library? if yes, the same error still appears

Obviously, github.com should be pretty durable. Try accessing the web site with your browser. If it's working, uninstall/remove the board and try again.

If you want to use the replacement header, you'd have to go into the files in the library that use it.

So line 10 of that file; and every other file that uses the old file name. But there may be other changes between v2 and v3 that you have to accommodate. Even worse are subtle changes that compile OK, but the code now works differently.

I tried to include this file, but it didn't work. I got several other compilation errors.

I found this file (esp_intr.h) at this link.

" https://git.liberatedsystems.co.uk/jacob.eva/arduino-esp32/src/commit/697d4ff7c4c35cf774aee8952126dd98daef3868/tools/sdk/include/esp32/esp_intr.h

It's part of this library:

" jacob.eva/arduino-esp32 - arduino-esp32 - Git - Liberated Embedded Systems

Hello, I have solved the problem. I downgraded my Arduino from version 2.0 to 1.8 and installed the esp32 board version 2.0.17. Thank you.