Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximkulkin/esp-homekit
Apple HomeKit accessory server library for ESP-OPEN-RTOS
https://github.com/maximkulkin/esp-homekit
esp8266 homekit
Last synced: 5 days ago
JSON representation
Apple HomeKit accessory server library for ESP-OPEN-RTOS
- Host: GitHub
- URL: https://github.com/maximkulkin/esp-homekit
- Owner: maximkulkin
- License: mit
- Created: 2017-12-05T18:44:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-18T21:03:14.000Z (about 1 year ago)
- Last Synced: 2025-01-11T22:04:58.053Z (12 days ago)
- Topics: esp8266, homekit
- Language: C
- Homepage:
- Size: 1010 KB
- Stars: 1,137
- Watchers: 91
- Forks: 170
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esp-homekit
Apple HomeKit accessory server library for
[ESP-OPEN-RTOS](https://github.com/SuperHouse/esp-open-rtos).See [esp-homekit-demo](https://github.com/maximkulkin/esp-homekit-demo) for examples.
## Building for ESP-IDF 4.x
In ESP-IDF >= 4.0 there is a SPI flash write protection that checks if area written
to is inside writable parition. Haven't figured out yet how esp-homekit can modify
parition table automatically, so for the time being you need to disable that check in
menuconfig: go to Component config -> SPI Flash driver -> Write to dangerous flash
regions and set it to "Allowed".## Building for ESP-IDF >= 5.0
You need to add a custom partition of type data and subtype "homekit"
and at least 4KB (0x1000) in size for HomeKit data storage. Put this into
partitions.csv file in your project:```
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
phy_init, data, phy, 0xe000, 0x1000,
homekit, data, homekit, 0xf000, 0x1000,
factory, app, factory, 0x10000, 1M,
```Enable custom partitions in project configuration (sdkconfig):
```
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
```## QR code pairing
You can use a QR code to pair with accessories. To enable that feature, you need to
configure accessory to use static password and set some setup ID:```c
homekit_server_config_t config = {
.accessories = accessories,
.password = "123-45-678",
.setupId="1QJ8",
};
```The last piece of information you need is accessory category code. You can find it in
mDNS announcement in accessory logs
```
mDNS announcement: Name=Sample LED-1692md=MyLEDpv=1.0id=16:92:CE:D4:EE:7Ac#=1s#=1ff=0sf=1ci=5 Port=5556 TTL=4500
```
(notice "**ci=5**" <- this is accessory category code)Or just find value of category enum you set in main accessory:
```c
HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_lightbulb, .services=(homekit_service_t*[]){
```
(notice "**homekit_accessory_category_lightbulb**" <- this is accessory category code)Then you need to generate QR code using supplied script:
```
tools/gen_qrcode 5 123-45-678 1QJ8 qrcode.png
```![QR code example](qrcode-example.png)