配置:RaspBerryPi4B|8GB|ForeignWirelessNet
搭建环境
sudo 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
Y //选择Y
sudo apt-get install libtool-bin
mkdir esp
cd esp
git clone --recursive https://github.com/maximkulkin/esp-homekit-demo.git //克隆esp-homekit-demo
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git //克隆esp-homekit-demo
git clone --recursive https://github.com/RavenSystem/esp-homekit-devices.git //克隆espesp-homekit-devices
cd esp-open-sdk
make//完成大概需30-60minutes
cd
sudo apt update
sudo apt install python-pip
pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7) //显示版本格式示例
pip install esptool
cd esp
git clone --recursive https://github.com/Superhouse/esp-open-rtos.git //克隆esp-open-rtos
export PATH=~/esp/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
export SDK_PATH=~/esp/esp-open-rtos
Flash篇
cd esp/esp-homekit-demo //进入esp-homekit-demo
git submodule update --init --recursive
export FLASH_SIZE=8 //ESP8266-01S
export HOMEKIT_SPI_FLASH_BASE_ADDR=0x7a000 //ESP8266-01S
export FLASH_MODE=dout //ESP8266-01S
export ESPPORT=/dev/ttyUSB0 //烧录芯片接口
make -C examples/led erase_flash //清楚所有原数据
make -C examples/led flash //编译与写入
常见问题
问题1.configure: error: could not find bash >= 3.1
cd crosstool-NG //进入crosstool-NG
vim configure.ac //编辑configure.ac
改前 |$EGREP '^GNU bash, version (3.[1-9]|4)')
改后 |$EGREP '^GNU bash, version (3.[1-9]|4|5)')
问题2.newlib-2.0.0.tar无法下载
cd crosstool-NG/.build/tarballs
下载newlib-2.0.0.tar
地址:https://codeload.github.com/jcmvbkbc/newlib-xtensa/tar.gz/newlib-2_0_0
FTP上传至crosstool-NG/.build/tarballs
问题3.USB无法识别或者无法SSH
sudo raspi-config //进入菜单
开启P2 SSH //openssh
开启P6 Serial //usb
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Retrieving needed toolchain components' tarballs'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: do_expat_get[scripts/build/companion_libs/210-expat.sh@12]
[ERROR] >> called from: do_companion_libs_get[scripts/build/companion_libs.sh@15]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@591]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> 'share/doc/crosstool-ng/crosstool-ng-1.22.0-60-g37b07f6f/B - Known issues.txt'
[ERROR]
[ERROR] (elapsed: 0:08.53)
[00:09] / ct-ng:152: recipe for target 'build' failed
make[2]: * [build] Error 1
make[2]: Leaving directory '/home/bohan/esp-open-sdk/crosstool-NG'
../Makefile:135: recipe for target '_toolchain' failed
make[1]: * [_toolchain] Error 2
make[1]: Leaving directory '/home/bohan/esp-open-sdk/crosstool-NG'
Makefile:130: recipe for target 'crosstool-NG/.built' failed
make: * [crosstool-NG/.built] Error 2
哪个步骤出现的error
checking for gobjcopy... no
checking for objcopy... no
configure: error: missing required tool: gobjcopy objcopy
make[1]: * [_ct-ng] Error 1
make: * [crosstool-NG/ct-ng] Error 2
网络限制问题