过程
最近用XIAO ESP32 C3的板子做个小项目,使用Arduino IDE进行开发,在按照文档步骤,在File\Perference\Additional Board Manager URLs中添加了
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
但是确定的时候,总是报异常:
Some indexes could not be updated.Get "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json": dial tcp: lookup raw.githubusercontent.com:
getaddrinfow: The requested name is valid, but no data of the requested type was found.: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
启用Clash后,可以在浏览器中直接打开链接 https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json ,就天真的以为arduino IDE访问也没有问题,但是每次设置总是报上面的错误
以至于不得已换了其他的esp32的json文件,但是会出现无法烧录的情况,烧录时报com3端口上没有设备,No device found on COM3,可以编译但无法烧录。
在重装了多次以后,问题依旧,于是把arduino IDE的代理设置打开,改成Clash工具的Proxy端口,再设置https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
后,就可以顺利的完成包的下载和更新了
问题原因总结:
- 因为网络的问题,国内大部分需要Proxy才能顺利的完成更新,也就是网络要能访问https://raw.githubusercontent.com;
- arduino IDE不会自动使用系统的Proxy,如果想让它走Proxy,必须单独指定,这是问题的根源
- 设置其实很简单,如下图,端口指向本机上网工具提供的端口即可
这个问题折腾了我大半天的时间,记录下来留个梯子,给遇到的小伙伴爬坑