使用git搭建Arduino的ESP32/ESP8266开发环境(win10)

1. Arduino搭建ESP8266开发环境

关于ESP32/ESP8266在arduino上面的环境搭建,网上大部分教程都是使用开发板管理器安装。但是很遗憾的是 https://arduino.esp8266.com/stable/package_esp8266com_index.json这个网址不翻墙进不去了,所以使用GitHub源码安装,整个过程很简单也很快。
源码地址https://github.com/esp8266/Arduino
GitHub安装教程 : https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version
推荐大家直接看官网,比我写的好~~

  1. 首先确保已经删除掉了使用board manager安装的ESP8266,位置在Arduino15文件夹里C:\Users\Administrator\AppData\Local\Arduino15,删掉ESP8266。
  2. 安装git,安装地址 https://git-scm.com/download/win
  3. 进入Arduino的默认目录(不是安装目录),一般是在 C:\users{username}\Documents\Arduino.
  4. 将源码下载到hardware/esp8266com/esp8266
    官方的命令(git中操作):
cd %USERPROFILE%\Documents\Arduino\
if not exist hardware mkdir hardware
cd hardware
if not exist esp8266com mkdir esp8266com
cd esp8266com
git clone https://github.com/esp8266/Arduino.git esp8266

要是不想敲命令可以直接在网页上从GitHub上下载后copy到hardware/esp8266com/esp8266里面。
最后的文件层级应该为下面这样:
在这里插入图片描述

  1. 初始化
cd %USERPROFILE%\Documents\Arduino\hardware\esp8266com\esp8266
git submodule update --init
  1. 下载二进制工具(binary tools)(直译,不知道什么意思。。。)
cd esp8266/tools
python3 get.py

也可以直接双击get.py文件,前提是你已经安装了python。

  1. 重启Arduino,可以看到开发板里面有ESP8266了。
  2. 更新(可选):
cd %USERPROFILE%\Documents\Arduino\hardware\esp8266com\esp8266
git status
git pull

2. Arduino搭建ESP32开发环境

安装ESP32差不多的,传送门:
源码仓库:https://github.com/espressif/arduino-esp32
win10安装: https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/windows.md

猜你喜欢

转载自blog.csdn.net/qq_30267617/article/details/108267101