From c90e066eae8b2bb459dad32fb3a905414d177f2e Mon Sep 17 00:00:00 2001 From: gitgayhub Date: Fri, 22 Dec 2023 13:05:15 +0000 Subject: [PATCH] Add homekit integration --- README.md | 1 + en/homekit-integration.md | 88 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 en/homekit-integration.md diff --git a/README.md b/README.md index 7ba1a34..1bf37a3 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ OpenIPC Wiki - [ACMEv2](en/acme-v2.md) - [YouTube streaming](en/youtube-streaming.md) - [WiFi XM530](en/wifi-xm530.md) +- [HomeKit integration](en/homekit-integration.md) ### FPV diff --git a/en/homekit-integration.md b/en/homekit-integration.md new file mode 100644 index 0000000..06f6096 --- /dev/null +++ b/en/homekit-integration.md @@ -0,0 +1,88 @@ +[Table of Content](../README.md) + +Integrate OpenIPC into HomeKit +--- + +Currently OpenIPC doesn't have native HomeKit support yet, integration is made by 3rd party package [go2rtc](https://github.com/AlexxIT/go2rtc "go2rtc"), thanks [@gtxaspec](https://github.com/gtxaspec "@gtxaspec") for adding this package into OpenIPC + +### Hardware requirement + +Since the compiled binary file will 3.3MB in size, flash chip size should be 16MB at least, DDR size should be 128MB at least + +### Compile go2rtc package + +Install go and upx first +``` +apt update +apt install golang upx +``` +- #### Method 1: Compile the whole firmware +Edit board config file in `firmware/br-ext-chip-xxxx/configs` directory, add the following line to enable the go2rtc package +``` +BR2_PACKAGE_GO2RTC=y +``` +then run +``` +make distclean +make all BOARD=board_config_name +``` +- #### Method2: Compile the package only +``` +make distclean +make br-go2rtc-rebuild BOARD=board_config_name +``` +The compiled go2rtc binary file will located at `firmware/output/per-package/go2rtc/target/usr/bin`, default config file at `firmware/output/per-package/go2rtc/target/etc` + +### Edit config file + +Put config file `go2rtc.yaml` into `/etc/` directory, example config: + +``` +log: + level: info # default level + api: trace + exec: debug + ngrok: info + rtsp: warn + streams: error + webrtc: fatal + +rtsp: + listen: ":8553" + +webrtc: + candidates: + - stun:8555 + +streams: + openipc: rtsp://admin:12345@127.0.0.1/stream=0 + +homekit: + openipc: # same stream ID from streams list + pin: 19550224 # custom PIN, default: 19550224 + name: openipc-ssc30kq # custom camera name, default: generated from stream ID + device_id: openipc # custom ID, default: generated from stream ID +``` + +### Run go2rtc + +``` +/usr/bin/go2rtc -config /etc/go2rtc.yaml & +``` + +Open the Home app on your Apple device, click the `+` button on the top-right corner, the OpenIPC camera should appear there automatically, enter the pin numbers in the config file to pair with it. + +### Autorun on startup + +Add the following lines into /etc/rc.local + +``` +/usr/bin/go2rtc -config /etc/go2rtc.yaml & +``` + +### Limitations + +- No HomeKit Secure Video support yet +- No motion sensor support yet +- No two-way audio support yet +