Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 41 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ Based on [esp-homekit](https://github.com/maximkulkin/esp-homekit).

## Prerequisites

* 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.
### esp-idf

## Build instructions ESP32
- 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.

1. Clone git repo
1. Change directory to repo `cd esp32-homekit-camera`
1. Initialize and sync all submodules (recursively) `git submodule update --init --recursive`
1. Configure device settings per **menuconfig settings** section, `make menuconfig`
* This step is critical
1. Apply **esp32-camera.patch** patch `git apply --directory="components/esp32-camera" esp32-camera.patch`
1. Compile code `make all`
1. To prevent any effects from previous firmware (e.g. firmware crashing right at start), highly recommend to erase flash `make erase_flash`
1. 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+]*
### esp32-homekit-camera code

- Clone this repository `git clone https://github.com/maximkulkin/esp32-homekit-camera.git`
- Work out of this directory going forward `cd esp32-homekit-camera`
- Initialize and sync all submodules (recursively) `git submodule update --init --recursive`

## Configuration

Before compiling, you need to alter several settings in **menuconfig**. Make sure you save
this file, as it will be used in the `build` section to configure ESP32-CAM as well as your
network/Homekit settings.

- Open the menuconfiguration with the command `make menuconfig`
- Scroll through each section of the menu, and make these changes:

## Menuconfig settings

Before compiling, you need to alter several settings in **menuconfig**:
* Serial flasher config
* Default serial port
* Flash size = **4 MB**
Expand Down Expand Up @@ -54,19 +54,32 @@ Before compiling, you need to alter several settings in **menuconfig**:
* LED Pin
* PIN = *your variant of module*
* ESP32-CAM by AI-Thinker == **33**
* Image sensor vertical flip
* Image sensor vertical flip *(optional)*
* Toggle if HomeKit app has video feed upside down
* Image sensor horizontal mirror
* Image sensor horizontal mirror *(optional)*
* Toggle if HomeKit app has video feed mirrored
* Image sensor enhance settings
* Image sensor enhance settings *(optional)*
* 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
* HomeKit Device Firmware version
* HomeKit Device Setup Code *(optional)*
* HomeKit Device Manufacturer *(optional)*
* HomeKit Device model name *(optional)*
* HomeKit Device model number *(optional)*
* HomeKit Device Serial number *(optional)*
* HomeKit Device Firmware version *(optional)*

## Build instructions ESP32

1. Make sure you have followed the `Configuration` changes above
1. Apply **esp32-camera.patch** patch:
* `git apply --directory="components/esp32-camera" esp32-camera.patch`
* This is only required once.
1. Compile code `make all`
1. To prevent any effects from previous firmware (e.g. firmware crashing right at start), highly recommend to erase flash:
* `make erase_flash`
1. 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+]*


## Add camera to HomeKit app
Expand All @@ -76,8 +89,9 @@ Before compiling, you need to alter several settings in **menuconfig**:
1. On Add Accessory screen, click `I Don't Have a Code or Cannot Scan` button
1. The ESP camera accessory should be shown, click the icon
1. On Uncertified Accessory prompt, select *Add Anyway*
1. On Enter HomeKit Setup Code, enter setup code
1. On Enter HomeKit Setup Code, enter setup code
* Default is `111-11-111`
* Found in the HomeKit `Configuration` section above
1. Click `Continue` button
1. Select camera location, continue
1. Enter camera name, continue
Expand Down