macOS 安装 ESP32 环境

macOS 安装 ESP32 环境

GitHub 上提供的在 Arduino IDE 中安装 ESP32 环境的方法,我翻成中文希望能帮助到一些洋文不太好的小伙伴哈哈哈
原文小学生英语,我这翻译也没啥用,只是希望我遇到的几个问题可以提供参考

原文

Installation instructions for Mac OS

  • Install latest Arduino IDE from arduino.cc

  • Open Terminal and execute the following command (copy->paste and hit enter):

mkdir -p ~/Documents/Arduino/hardware/espressif && \
cd ~/Documents/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 --depth 1 && \
cd esp32 && \
git submodule update --init --recursive --depth 1 && \
cd tools && \
python get.py 

Where ~/Documents/Arduinorepresents your sketch book location as per “Arduino” > “Preferences” > “Sketchbook location” (in the IDE once started). Adjust the command above accordingly if necessary!

  • If you get the error below. Install the command line dev tools with xcode-select --install and try the command above again:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcode-select --install
  • Try python3instead of pythonif you get the error: IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)when running python get.py

  • If you get the following error when running python get.pyurllib.error.URLError: <urlopen error SSL: CERTIFICATE_VERIFY_FAILED, go to Macintosh HD > Applications > Python3.6 folder (or any other python version), and run the following scripts: Install Certificates.command and Update Shell Profile.command

  • Restart Arduino IDE

翻译

译者注:这里建议从 Arduino 中文社区下载

  • 打开终端运行下面的代码(复制,粘贴,然后按下回车键)
mkdir -p ~/Documents/Arduino/hardware/espressif && \
cd ~/Documents/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 --depth 1 && \
cd esp32 && \
git submodule update --init --recursive --depth 1 && \
cd tools && \
python get.py 

~/Documents/Arduino的位置是根据“Arduino”>“偏好设置(cmd+)”>“项目文件夹位置”。有必要的话调整上面的命令

译者注:例如,我是在 /Documents 文件夹下新建了 /学习资料/嵌入式/Arduino,项目文件保存于此,所以我上方的代码改为了:

mkdir -p ~/Documents/学习资料/嵌入式/Arduino/hardware/espressif && \
cd ~/Documents/学习资料/嵌入式/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 --depth 1 && \
cd esp32 && \
git submodule update --init --recursive --depth 1 && \
cd tools && \
python3 get.py  #这里因为 Python版本做的改动,后文会解释
  • 如果你显示了这样的错误:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

在终端中运行下面的命令来安装命令行开发工具

xcode-select --install

安装好后重新运行第二步的代码(即mkdir -p ~/Do。。。)

  • 如果你在运行python get.py时显示了这样的错误
IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)

python换成python3

  • 如果你在运行python get.py时显示了这样的错误
urllib.error.URLError: <urlopen error SSL: CERTIFICATE_VERIFY_FAILED

前往 Macintosh HD > Applications > Python3.6 文件夹(或其他 python 版本),运行「Install Certificates.command」和「Update Shell Profile.command」

译者注:让我看看有没有憨批和我一样在终端运行这行代码:

Install Certificates.command and Update Shell Profile.command

如果你是和我一样的憨憨,你会得到这个界面哈哈哈
憨憨认证界面

其他问题

如果你在过程中遇到了其他的问题,可以看一下这篇博客

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值