ESP-32 implementation of Apple Homekit Accessory Protocol(HAP)
To use the component on macos/linux, do the following:
- Setup Espressif development environment. This project is tested with ESP-IDF version 4.1: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#
- Create your application
- Install submodules git submodule add https://github.com/slompf18/esp32_hap_wolfssl.git components/esp32_hap_wolfssl git submodule add https://github.com/slompf18/esp32-homekit.git components/esp32-homekit
- Setup unit test app: https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/unit-tests.html
- In make menuconfig enable the following points under Component config->Heap memory debugging
- Enable heap tracing (2)
- Enable heap task tracking
- Compile and start unit test app: make flash monitor TEST_COMPONENTS='esp32-homekit'
In order to get more (or less) verbosity, change the following line in CMakeLists.txt: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG")
- Connect device by USB
- Get your UDID: http://whatsmyudid.com/
- Check your network devices: ifconfig -l
- Start capturing: rvictl -s
- Check your network devices again: ifconfig -l
- Open WireShark
- Start capturing on the new interface (normally rvi0)
- Filter for http
HomeKit uses the service type of '_hap._tcp' on the 'local.' domain, so you can query for HomeKit devices as such:
$ dns-sd -Z _hap._tcp local.
For HomeKit hubs, look for the service type of _homekit._tcp:
$ dns-sd -Z _homekit._tcp local.
- To be able to upload to the EP-WROOM-32 when connected to a breadboard, you may need a 10K (or so) pull-down resistor between RX0 and GND.
- In case you cannot find your device, it may be a problem with your router: https://jlian.co/post/reliable-homekit/