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

Marcin Mx231Marcin Mx231
2 min read

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 PinESP32 Pin
VCC3.3V
GNDGND
SCL/SCKGPIO 22
SDAGPIO 21

💡 This schematic is also available on the official nRFBox website.


⬇️ Downloading the Code

  1. Visit the nRFBox GitHub Releases.

  2. Download the latest version (e.g., v2.5.0) as a ZIP file.

  3. Extract the ZIP and open the folder nRFBox_V2 in the Arduino IDE.


🧠 Common Compilation Fix

Out of the box, the project may fail to compile due to an incompatibility between std::string and Arduino's native String class.

Here’s the error you might see:

error: cannot convert 'std::string' to 'String'

To fix this:

🔧 Locate and edit the following lines in spoofer.cpp:

Before:

AdvertisementData.setManufacturerData(std::string((char *)dataAirpodsPro, 31));

After:

AdvertisementData.setManufacturerData(String((char *)dataAirpodsPro, 31));

📝 Make sure String 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:

  1. Connect your ESP32.

  2. Make sure the correct board and COM port are selected.

  3. Click Upload in the Arduino IDE.

Your ESP32 should now be running the nRFBox firmware!


🔗 Useful Links

0
Subscribe to my newsletter

Read articles from Marcin Mx231 directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Marcin Mx231
Marcin Mx231