Firmware for esp32-camera module to act as Apple Homekit IP camera.
Based on esp-homekit.
- esp-idf
- Install esp-idf by following instructions on esp-idf project page (https://github.com/espressif/esp-idf#setting-up-esp-idf).
- At the end you should have xtensa-esp32-elf toolchain in your path and IDF_PATH environment variable pointing to esp-idf directory.
- Clone git repo
- Change directory to repo
cd esp32-homekit-camera
- Initialize and sync all submodules (recursively)
git submodule update --init --recursive
- Configure device settings per menuconfig settings section,
make menuconfig
- This step is critical
- Apply esp32-camera.patch patch
git apply --directory="components/esp32-camera" esp32-camera.patch
- Compile code
make all
- To prevent any effects from previous firmware (e.g. firmware crashing right at start), highly recommend to erase flash
make erase_flash
- Upload Upload firmware to ESP32
make flash monitor
- Note, ESP32 GPIO0 pin needs to be connected to GND pin to enable flashing
- To exit monitor, on mac control+]
Before compiling, you need to alter several settings in menuconfig, follow configuration prompts make menuconfig
:
- Serial flasher config
- Default serial port
- Flash size = 4 MB
- Partition Table
- Partition Table = Custom partition table CSV
- Custom partition CSV file = partitions.csv
- Component config
- Driver configuration
- RTCIO configuration
- Support array
rtc_gpio_desc
for ESP32 = check
- Support array
- RTCIO configuration
- ESP32-specific
- Support for external, SPI-connected RAM = check
- SPI RAM config
- Initialize SPI RAM during startup = check
- SPI RAM access method = Make RAM allocatable using malloc() as well
- Camera configuration
- OV2640 Support = check
- HomeKit
- SPI flash address for storing HomeKit data = 0x3A0000
- Driver configuration
- ESP32 HomeKit Camera
- WiFi SSID
- WiFi Password
- Device hostname
- Select Camera Pinout
- Select Camera Pinout = your variant of module
- LED Pin
- PIN = your variant of module
- ESP32-CAM by AI-Thinker == 33
- PIN = your variant of module
- Image sensor vertical flip
- Toggle if HomeKit app has video feed upside down
- Image sensor horizontal mirror
- Toggle if HomeKit app has video feed mirrored
- Image sensor enhance settings
- EXPERIMENTAL: adjusts contrast, saturation, etc for better image quality
- HomeKit Device Setup Code
- HomeKit Device Manufacturer
- HomeKit Device model name
- HomeKit Device model number
- HomeKit Device Serial number
- Use WIFI MAC address as serial number
- Note: this takes precedence over static serial number setting above
- HomeKit Device Firmware version
- Open Home app
- Click + sign to add accessory
- On Add Accessory screen, click
I Don't Have a Code or Cannot Scan
button - The ESP camera accessory should be shown, click the icon
- On Uncertified Accessory prompt, select Add Anyway
- On Enter HomeKit Setup Code, enter setup code
- Default is
111-11-111
- Default is
- Click
Continue
button - Select camera location, continue
- Enter camera name, continue
- Click Done
- Camera ready to use
While not HomeKit specific, good amount of troubleshooting information for flashing ESP32 devices can be found at https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/
Device runs a webserver on HTTP port 5556