ESP32 Arduino GitHub: Where the Core, Docs and Examples Live

What is the ESP32 Arduino GitHub repository?
When people search for "esp32 arduino github" they almost always mean one of two things: the official Arduino core for ESP32 chips, which Espressif maintains at github.com/espressif/arduino-esp32, or the wider ecosystem of ESP32 projects and libraries that other developers publish on GitHub and that build on that core.
The core repo is more than a pile of C++ files. Its docs/en folder contains the reference documentation for the bundled libraries, written in reStructuredText. Two good examples are the Matter guide (docs/en/matter/matter.rst) and the OpenThread guide (docs/en/openthread/openthread.rst). Reading these directly on GitHub is often faster than hunting for a rendered site, and you see exactly the version that matches the branch you are on.
Community libraries reference the same repo. The IRremoteESP8266 README, for instance, points to espressif/arduino-esp32 as the ESP32 target when it says the library works with the Arduino framework on both ESP8266 and ESP32 boards. That link is a good sanity check: if a library's README names the Espressif core, it was written with ESP32 Arduino in mind.
\2A typical ESP32 development board, the usual target for arduino-esp32 sketches. Image: Edwiyanto, CC BY-SA 4.0, via Wikimedia Commons
What's inside arduino-esp32 that you won't find in plain Arduino?
The ESP32 core extends the classic Arduino API in ways that matter when you copy example code from GitHub. A few highlights from the repo's docs and from real-world questions:
| Feature | What it gives you | Where it comes from |
|---|---|---|
| Matter library | Build Matter devices over Wi-Fi, Thread or Ethernet; commission via QR code or pairing code; works with Home Assistant, Apple Home, Alexa and Google Home | Built on ESP Matter SDK |
| OpenThread library | Thread mesh networking on ESP32 SoCs with an IEEE 802.15.4 radio; CLI-helper API or object-oriented Classes API | Built on ESP OpenThread |
FunctionalInterrupt.h |
An extra attachInterrupt() overload that accepts std::function, so lambdas and member functions can be interrupt handlers |
ESP32 core extension, not present in AVR Arduino |
Matter is organised around a singleton Matter object plus MatterEndPoint base class and specific endpoint classes. Key methods include begin(), isDeviceCommissioned(), isWiFiConnected(), isThreadConnected() and isDeviceConnected(). Helper headers (MatterHelpers.h, MatterButton.h) handle things like waiting for commissioning and board-button events.
OpenThread offers two ways in. The CLI helpers (otGetRespCmd(), otExecCommand(), otPrintRespCLI(), OpenThreadCLI) send OpenThread CLI commands and parse the replies. The Classes API (OpenThread, DataSet, OThreadScan, OThreadDNSSD, OThreadUDP, OThreadCoAP*) calls the OpenThread functions directly. The docs describe Thread device roles (Leader, Router, Child, Detached, Disabled) and note that Thread networks scale to 250+ devices.
FunctionalInterrupt.h solves a classic C++ headache: a non-static member function cannot be a plain void(*)() callback. On ESP32 the ESP-IDF runtime passes a user parameter to interrupt handlers, which the core uses to wrap a std::function. Without the include, you get the error no suitable conversion function from "std::function<void ()>" to "void (*)()" exists. The fix is one line:
#include <FunctionalInterrupt.h>
\2Espressif ESP-WROOM-32 module with its metal RF shield. Image: Ubahnverleih, CC0, via Wikimedia Commons
How do I install ESP32 Arduino libraries and examples from GitHub?
Most ESP32 projects on GitHub are either Arduino libraries (with an examples/ folder) or standalone sketches. The IRremoteESP8266 README documents the three standard install routes, and they apply to almost any Arduino-compatible library on GitHub.
1. Library Manager (easiest). In the Arduino IDE go to Sketch > Include Library > Manage Libraries, type the library name in the search box, pick a version and click Install. Only libraries that have been registered with Arduino show up here.
2. ZIP download (Windows-friendly). On the GitHub page use "Clone or Download" > "Download ZIP", extract it, rename the folder to the library name (for example IRremoteESP8266), move it into C:\Users\YOURNAME\Documents\Arduino\libraries\, and restart the IDE. Then open the bundled examples.
3. git clone (Linux/macOS, best for tracking updates).
cd ~/Arduino/libraries
git clone https://github.com/crankyoldgit/IRremoteESP8266.git
To pull the latest changes later:
cd ~/Arduino/libraries/IRremoteESP8266 && git pull
The git route is the one most people searching for "esp32 example code github" end up using, because it lets you check out a specific tag or branch and read the examples in place. Swap the repo URL for whatever ESP32 project you are after.
Once installed, example sketches appear under File > Examples in the IDE. For the arduino-esp32 core itself, the Matter and OpenThread example sketches are part of the core and described in the docs linked above.
\2ESP32-C3 NodeMCU-style board with a CH340 USB-to-serial chip; a RISC-V variant of the ESP32 family. Image: Popolon, CC BY-SA 4.0, via Wikimedia Commons
How do I build the Matter examples from the arduino-esp32 repo?
The Matter examples are a good test of whether you have read the repo docs, because they fail silently if you skip two IDE settings. Before uploading any Matter sketch:
- Tools > Partition Scheme must be set to Huge APP (3 MB No OTA / 1 MB SPIFFS). The Matter stack plus your sketch needs a 3 MB application partition.
- Tools > Erase All Flash Before Sketch Upload must be enabled. Old Wi-Fi credentials, Matter fabric data or commissioning state left in NVS can break commissioning or connectivity on the new firmware.
A couple of behaviours are worth knowing so you don't misread them as bugs:
- On chips with PSRAM enabled, the Matter data model (endpoints, clusters, attributes) is placed in PSRAM.
ESP.getFreeHeap()may stay flat whileESP.getFreePsram()drops as endpoints are created. That is expected. CHIP, AES DMA bounce buffers and NimBLE still use internal RAM. Matter.begin()on Wi-Fi station builds starts the Wi-Fi driver with reduced buffer counts (4 static RX, 8 dynamic RX, 8 dynamic TX, AMPDU RX BA window 6) unless the sketch already calledmatterConnectWiFi(),WiFi.begin()orWiFi.mode(), or Thread/Ethernet was selected.selectNetwork()only records your intent before an endpoint'sbegin(); it does not start Wi-Fi, Thread or Ethernet, and it does not apply a Thread dataset.isEthernetEnabled()reflects the compile-timeCONFIG_ETH_ENABLEDflag, not whether a cable is plugged in.
What are the common pitfalls with ESP32 projects on GitHub?
Wrong chip variant. A sketch that compiles for the original ESP32 may not compile for an ESP32-S3. One widely copied AM-transmitter repo uses I2S_MODE_DAC_BUILT_IN to drive the internal DAC; on the S3 this throws 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope because the S3 simply has no DAC. Check the README's target board and the chip's datasheet before assuming a project is portable across the ESP32 family.
Framework mismatch. Example code found for a sensor on GitHub is often written for a specific framework. One MLX90393 magnetometer example was written for ESP32 Arduino; a beginner trying to port it to Mbed on an STM32 board ended up with -1 readings on every axis and days of debugging. "ESP32 example github" results are usually Arduino or ESP-IDF; know which one you are looking at.
Missing ESP32-specific headers. Code that uses lambdas or member functions as interrupt handlers needs #include <FunctionalInterrupt.h> on the ESP32 core. Without it you get the std::function to void (*)() conversion error even though the call looks identical to a working desktop build.
Breaking changes between library versions. IRremoteESP8266 changed its usage API at v2.0 and, from v2.5, switched #define constants to const values using the kConstantName style. Older CONSTANT_NAME names were only partially aliased, so old sketches may stop compiling. When a README has an "Upgrading" section, read it before pinning a new version.
Leftover flash contents. For Matter and similar stateful stacks, stale NVS data causes commissioning failures. Erase flash before uploading when switching between projects.
Skipping the repo's own troubleshooting docs. Well-maintained libraries like IRremoteESP8266 ship a Troubleshooting Guide and FAQ on their wiki, plus Doxygen-generated API docs. Work through those before opening an issue.
How do I judge whether an ESP32 project on GitHub is worth using?
Searching "esp32 projects on github" returns thousands of repos of wildly different quality. A few signals, taken from what a mature library like IRremoteESP8266 actually provides, help you filter:
| Signal | Why it matters |
|---|---|
| CI badges (Build, Lint, Tests, Documentation) | The code is compiled and tested automatically, so the master branch is less likely to be broken |
| Tagged releases with release notes | You can pin a known-good version instead of a random commit |
| Explicit ESP32 support statement | The README should name espressif/arduino-esp32 or ESP32 boards, not just ESP8266 |
A SupportedProtocols.md-style compatibility list |
Tells you up front whether your hardware is covered |
| Wiki with Troubleshooting Guide and FAQ | Saves you from re-asking solved questions |
| Generated API docs (Doxygen) | Lets you read function signatures without digging through headers |
| Contributing guide | Signals the maintainer accepts bug reports and pull requests |
IRremoteESP8266, for example, is at v2.9.0, lists its history back to Ken Shirriff's original Arduino-IRremote, and was largely rewritten at v2.0 with ESP8266 resources in mind before gaining ESP32 support. That kind of lineage note is a good sign the maintainer understands the hardware.
For the Espressif core itself, the docs folder is your best friend. Library guides like Matter and OpenThread are versioned alongside the code, so the master branch docs describe the newest API, while a release tag describes the API you actually installed.
Frequently asked questions
Where is the official ESP32 Arduino core on GitHub?
At github.com/espressif/arduino-esp32. Its docs folder holds reference guides for bundled libraries such as Matter and OpenThread.
How do I install an ESP32 Arduino library from GitHub without the Library Manager?
Download the ZIP, extract and rename the folder to the library name, move it into your Arduino libraries folder and restart the IDE; or run git clone inside ~/Arduino/libraries and git pull to update.
Why does attachInterrupt with a lambda fail to compile on ESP32?
The std::function overload is an ESP32 core extension that lives in FunctionalInterrupt.h. Add #include <FunctionalInterrupt.h> to your sketch.
Why does an ESP32 example from GitHub fail on my ESP32-S3?
Some chips lack peripherals the original ESP32 has. I2S_MODE_DAC_BUILT_IN is undefined on the S3 because it has no DAC, so DAC-based sketches won't compile there.
What settings do the Matter examples in arduino-esp32 need?
Partition Scheme set to Huge APP (3 MB No OTA / 1 MB SPIFFS) and Erase All Flash Before Sketch Upload enabled, both under the Tools menu.
The arduino-esp32 GitHub repo is the canonical source for the ESP32 Arduino core and its library docs, and the same GitHub workflow (Library Manager, ZIP, or git clone) covers the community libraries and example projects built on it. Read the target-board notes and upgrade sections before copying code, and you will avoid most of the chip-variant and version-mismatch errors that trip up beginners.
Sources
github.comMatter (arduino-esp32 docs)github.comOpenThread (arduino-esp32 docs)stackoverflow.comC++ Callback to member function pointers on ESP32 / Arduinostackoverflow.comgetting 'I2S_MODE_DAC_BUILT_IN' was not declared in this scope error when compiling for ESP32S3electronics.stackexchange.comHow to read data from this sensor?github.comcrankyoldgit/IRremoteESP8266 (GitHub README)This guide summarises the public sources listed above in our own words. Check the original documentation before relying on exact figures.


