Installation¶
Prerequisites¶
Before installing ReactiveESP32, ensure you have:
ESP32 Development Board (any variant: ESP32, ESP32-S2, ESP32-S3, ESP32-C3)
PlatformIO or Arduino IDE installed
C++17 compatible compiler (included with ESP-IDF/Arduino-ESP32)
Method 1: PlatformIO (Recommended)¶
PlatformIO provides the easiest installation and dependency management.
Step 1: Add to platformio.ini¶
Add ReactiveESP32 to your project’s platformio.ini:
[env:your_env_name]
# Use pioarduino !
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
framework = arduino
board = ... # your ESP32 board
; Most recent changes
lib_deps =
https://github.com/alkonosst/ReactiveESP32.git
; Release vx.y.z (using an exact version is recommended)
lib_deps =
https://github.com/alkonosst/ReactiveESP32.git#vx.y.z
Step 2: Build your project¶
PlatformIO will automatically download and install the library. Then you can build and upload your project as usual.
Method 2: Arduino IDE¶
Step 1: Install via Library Manager¶
Open Arduino IDE
Go to Sketch > Manage Libraries…
Search for “ReactiveESP32”
Click Install
Step 2: Add it to your sketch¶
Go to Sketch > Include Library
Click ReactiveESP32
Verify Installation¶
Create a simple test sketch:
#include <ReactiveESP32.h>
using namespace RxESP32;
Signal<int> number(0);
Computed<int> doubled([]() {
int val = number.get() * 2;
Serial.printf("Doubled: %d\n", val);
return val;
});
void setup() {
Serial.begin(115200);
// Start the ReactiveESP32 dispatcher
if (!Dispatcher::start()) {
Serial.println("Failed to start ReactiveESP32 Dispatcher!");
while (true)
delay(1000);
}
}
void loop() {
static int count = 1;
number.set(count++);
delay(1000);
}
Expected output:
Doubled: 2
Doubled: 4
Doubled: 6
If you see this output, installation was successful! ✅
Configuration Options¶
The library comes configured with default settings, suitable for most applications. However, you can customize certain aspects by defining preprocessor. Some common options include:
Enabling Signal History (
RXESP32_ENABLE_SIGNAL_HISTORY)Enabling Dependency Graph printing utility (
RXESP32_ENABLE_DEPENDENCY_GRAPH)Enabling library logs with ESP-IDF logging system (
RXESP32_LOG_LEVEL)
See Advanced configuration for the full list of configuration options.
There a two ways to do this:
PlatformIO Build Flags (Recommended)¶
Add to your platformio.ini:
build_flags =
-DRXESP32_ENABLE_SIGNAL_HISTORY
-DRXESP32_ENABLE_DEPENDENCY_GRAPH
-DRXESP32_LOG_LEVEL=3
Arduino IDE¶
Go to C:\Users\your_username\Documents\Arduino\libraries\ReactiveESP32\src\ and create a file
named rxesp32_custom_config.h. Add your configuration options there:
#define RXESP32_ENABLE_SIGNAL_HISTORY
#define RXESP32_ENABLE_DEPENDENCY_GRAPH
#define RXESP32_LOG_LEVEL 3
Troubleshooting¶
Compilation error about C++17 support¶
Solution: Probably you are using PlatformIO with the espressif32 platform. Ensure your
platformio.ini specifies the correct platform (pioarduino):
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
“ReactiveESP32.h not found”¶
Solution: Verify library installation. In PlatformIO, ensure
lib_deps is correctly set. In Arduino IDE, ensure the library is installed via Library Manager.
Next Steps¶
Quick Start - Build your first reactive application
Core Concepts - Understand Signals, Computed, and Effects before diving deeper