要點:
①安裝git,安裝python3.7以上,
②從gitee clone esp32-idf, 下載地址: git clone https://gitee.com/EspressifSystems/esp-idf.git , 注意不要使用github,無法下載的。下載完后,實際上esp-idf的子模塊並沒有下載下來,下一步要更新所有子模塊。
③從gitee clone esp-gitee-tools , 下載地址:https://gitee.com/EspressifSystems/esp-gitee-tools.git
④打開cmd.exe,依次運行以下命令:
a, 切換到國內源,提高下載速度: pip config set global.index-url http://mirrors.aliyun.com/pypi/simple , pip config set global.trusted-host mirrors.cloud.tencent.com , 如果下一步的安裝速度不錯,這步可以不做。
b, 進入到 esp-gitee-tools目錄, 執行: export EGT_PATH=$(pwd) ,即設置一個 EGT_PATH 變量方便使用,也可以不用設置,下面運行的時候全部用絕對路徑代替也可以。
c,進入到 esp32-idf目錄,執行:$(EGT_PATH)\install.sh 開始安裝esp-idf.
d,進入到 esp32-idf目錄,執行更新子模塊動作: $(EGT_PATH)\submodule-update.sh,這里面會下載更新所有esp32-idf的子模塊。
⑤進入到 esp32-idf目錄,執行 export.bat 設置環境變量
⑥測試hello_world,執行: xcopy /e /i %IDF_PATH%\examples\get-started\hello_world ..\esp-proj\hello_world
遇到問題:The following Python requirements are not satisfied , 解決辦法: 運行: python -m pip install -r $IDF_PATH/requirements.txt