esp32.diy

esp32-homekit-camera: Native Apple HomeKit IP Camera Build

Oct 13, 2026 · 5 min read

Advanced 441 stars 79 forks C MIT Updated 2022-05-05
TL;DR esp32-homekit-camera is MIT-licensed C firmware that turns an ESP32-CAM module into a native Apple HomeKit IP camera — no bridge, no cloud. You compile it with esp-idf, flash it over serial, and pair it directly in the iOS Home app.
What you need
  • ESP32-CAM (AI-Thinker)
  • OV2640 camera module
BoardESP32-CAM (AI-Thinker and compatible)
SensorOV2640
Frameworkesp-idf
LanguageC
LicenseMIT
DifficultyAdvanced

What You Will Build

You will flash an ESP32-CAM module with firmware that makes it appear as a native Apple HomeKit IP camera. Once paired, the camera shows up directly in the iOS Home app — no third-party bridge, no cloud service, no subscription. The device also runs a local web server on HTTP port 5556, giving you a second way to access the feed on your network.

This is useful for anyone already invested in the Apple Home ecosystem who wants a low-cost, self-hosted camera that respects local privacy. Because the firmware is open source and written in plain C on top of Espressif's official esp-idf SDK, you have full visibility into what the device is doing on your network.

What You Need

Hardware

Software and toolchain

Installing esp-idf is the most involved step. Follow the official esp-idf setup guide for your operating system before continuing.

Typical use cases

HomeKit Doorbell Camera

Mount an ESP32-CAM at your front door and monitor visitors directly from the Apple Home app without a cloud subscription.

Local-Only Surveillance

Deploy in areas where cloud cameras are not appropriate — all video stays on your local network and HomeKit infrastructure.

Custom Embedded Camera Firmware

Use the project as a starting point for your own HAP-compliant camera firmware, with full access to the C source.

Low-Cost HomeKit Accessory Prototyping

Quickly prototype HomeKit-connected camera accessories for maker projects or product development at minimal hardware cost.

How It Works

The firmware is built on esp-homekit, a pure C implementation of the HomeKit Accessory Protocol (HAP). This means the ESP32 speaks HAP directly over your local Wi-Fi network — no Apple TV or HomePod hub is required for local access, though one is needed for remote access as with any HomeKit device.

The OV2640 sensor is driven by the esp32-camera component. A patch (esp32-camera.patch) is applied to that component before compilation to make it work correctly with this firmware. The device stores HomeKit pairing data in a dedicated SPI flash region at address 0x3A0000, defined by a custom partition table (partitions.csv). SPI-connected PSRAM is enabled so the module can buffer camera frames in the external RAM rather than relying solely on the ESP32's internal SRAM.

Build and Flash Steps

1. Clone the repository and pull all submodules

git clone https://github.com/maximkulkin/esp32-homekit-camera.git
cd esp32-homekit-camera
git submodule update --init --recursive

2. Configure the firmware with menuconfig

make menuconfig

Work through the menu and apply every change listed below. Save before exiting.

3. Apply the esp32-camera patch

This step is required once before the first build:

git apply --directory="components/esp32-camera" esp32-camera.patch

4. Compile the firmware

make all

5. Erase flash and upload

Before flashing, connect GPIO0 to GND on the ESP32-CAM to put it into bootloader mode. Then erase any previous firmware to avoid conflicts:

make erase_flash

Flash the new firmware and open the serial monitor:

make flash monitor

To exit the monitor on macOS, press Control+].

Once the monitor shows the device has connected to Wi-Fi, you are ready to pair.

Adding the Camera to Apple Home

  1. Open the Home app on your iPhone or iPad.
  2. Tap the + button and choose Add Accessory.
  3. On the Add Accessory screen, tap I Don't Have a Code or Cannot Scan.
  4. The ESP camera accessory should appear in the list — tap its icon.
  5. When warned about an uncertified accessory, tap Add Anyway.
  6. Enter the HomeKit setup code. The default is 111-11-111 (you can change this in menuconfig under the HomeKit section).
  7. Tap Continue, choose a room, enter a name for the camera, and tap Done.

The camera is now live in your Home app. You can also access it from any browser on your local network at http://<device-ip>:5556.

Ideas to Extend It and Limitations

Ways to extend the build

Limitations to be aware of

Verdict

esp32-homekit-camera is one of the most practical ways to add a native, no-cloud HomeKit camera to your home using commodity ESP32-CAM hardware. The build process is involved — esp-idf setup and menuconfig require patience — but the payoff is a privacy-respecting camera that integrates cleanly with Apple Home. The project has not seen active commits recently, so treat it as a stable but mature codebase rather than one under active development.

Sources

github.commaximkulkin/esp32-homekit-camera — repository & README

Facts in this article come from the project's public README and GitHub metadata at the time of writing. Images belong to their respective owners and link back to the original source.