I recently migrated my home automation from Domoticz on a Raspberry Pi to Home Assistant with ESP32 boards. In my old Domoticz setup I used to control an AC dimmer through a Python script on the Pi — it worked reliably for over two years.
Now I’m running the dimmer directly from an ESP32 DevKit. I searched the Arduino Library Manager for “rbdimmer” and installed the first result — RBDDimmer. The code compiles, uploads, and initially seems to work. But after a few minutes the ESP32 crashes with a Guru Meditation Error, restarts, works for another 2-3 minutes, then crashes again. Sometimes it runs for 10 minutes, sometimes only 30 seconds.
I found in the documentation that there appear to be two separate libraries:
- RBDDimmer (RBDdimmer.h)
- rbdimmerESP32 (rbdimmerESP32.h)
Can someone confirm — is the RBDDimmer library not supposed to be used on ESP32? Is this the cause of my crashes? I assumed since it compiled without errors it was compatible.
My current code:
#include <RBDdimmer.h> // is this the wrong library for ESP32?
dimmerLamp dimmer(25, 18);
void setup() {
Serial.begin(115200);
dimmer.begin(NORMAL_MODE, ON);
}
void loop() {
dimmer.setPower(50);
delay(5000);
dimmer.setPower(80);
delay(5000);
}
Board: ESP32 DevKit V1, Arduino IDE 2.3, rbdimmer 1CH 8A module.