By | 2022-05-30

ESP2688接入HomeKit固件编译

  • 安装 esp-open-sdk
# 编译环境准备
root@localhost:~# apt-get install make unrar-free autoconf automake libtool gcc g++ gperf flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial sed git unzip bash help2man wget bzip2 libtool-bin
# 拉取项目
root@localhost:~# git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
# 修复bash >= 3.1错误(193行)
at@localhost:~$ vi ./esp-open-sdk/crosstool-NG/configure.ac
前:|$EGREP '^GNU bash, version (3\.[1-9]|4)')
后:|$EGREP '^GNU bash, version (3\.[1-9]|4|5)')
at@localhost:~$ cd ./esp-open-sdk
at@localhost:~/esp-open-sdk$ make toolchain esptool libhal STANDALONE=n
# 修复tarballs错误
at@localhost:~$ cd ./crosstool-NG/.build/tarballs
at@localhost:~/tarballs$ wget ftp://sourceware.org/pub/newlib/newlib-2.0.0.tar.gz
at@localhost:~/tarballs$ wget https://libisl.sourceforge.io/isl-0.14.tar.gz
at@localhost:~/tarballs$ wget https://github.com/libexpat/libexpat/releases/download/R_2_1_0/expat-2.1.0.tar.gz
at@localhost:~/esp-open-sdk$ make toolchain esptool libhal STANDALONE=n
# 安装编译工具
root@localhost:~# cp -r ./esp-open-sdk /opt
# 添加环境变量
root@localhost:~# vi /etc/profile
export PATH=$PATH:/opt/esp-open-sdk/xtensa-lx106-elf/bin
  • 编译esp-homekit-direct
# 拉取项目
root@localhost:~# git clone https://github.com/LeeLulin/esp-homekit-direct.git
# 编译固件[固件路径:/devices/switch/firmware/switch.bin]
root@localhost:~# cd esp-homekit-direct
root@localhost:~# make -C devices/switch all

#项目示例型号 ESP8266-01s,其他型号需要修改 /devices/switch/main.c