How to Use the Arduino IDE to Upload the nRFBox Project to ESP32

In today’s post, I’ll walk you through the steps required to upload the nRFBox firmware to your ESP32 using the Arduino IDE. If you're new to this process or looking to troubleshoot issues along the way, this guide will help ensure a smooth setup.
✅ Prerequisites
Before diving into the project, make sure the following are ready:
Arduino IDE is installed on your system.
Your PC correctly detects the ESP32 (via USB).
You’ve installed the ESP32 board package in the Arduino IDE (via Board Manager).
Once that’s done, open the Arduino IDE and:
Select the correct board (e.g., ESP32 Dev Module).
Select the correct COM port (e.g., COM6 – this will vary depending on your setup).
📦 Install Required Libraries
The nRFBox project relies on several libraries. Make sure the following are installed:
U8g2 (for OLED display support)
RF24 (for nRF24L01 communication)
You can install them via:
Arduino IDE → Tools → Manage Libraries...
🔌 OLED Display Wiring
Here is the correct schematic to connect an SH1106 OLED display to the ESP32:
OLED Pin | ESP32 Pin |
VCC | 3.3V |
GND | GND |
SCL/SCK | GPIO 22 |
SDA | GPIO 21 |
💡 This schematic is also available on the official nRFBox website.
⬇️ Downloading the Code
🧠 Common Compilation Fix
Out of the box, the project may fail to compile due to an incompatibility between std::st
ri
ng
and Arduino's native String
class.
Here’s the error you might see:
error: cannot convert 'std::string' to 'String'
🔧 Locate and edit the following lines in spo
ofer.cpp
:
AdvertisementData.setManufacturerData(std::string((char *)dataAirpodsPro, 31));
After:
AdvertisementData.setManufacturerData(String((char *)dataAirpodsPro, 31));
📝 Make sure
St
ring
starts with a capital S, as that's how it's declared in Arduino.
Repeat this fix for all similar lines using std::string
.
🟢 Final Steps
Once you've applied the changes:
Connect your ESP32.
Make sure the correct board and COM port are selected.
Click Upload in the Arduino IDE.
Your ESP32 should now be running the nRFBox firmware!
🔗 Useful Links
Subscribe to my newsletter
Read articles from Marcin Mx231 directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
