绵阳做公司网站,wordpress网址设置,企业网站模板 免费下载,四川省住房城乡建设厅网站不知道什么仙人设计的arduino连接网络部分#xff0c;死活下不下来。#xff08;真的沙口#xff0c;第一次看到这么抽风的下载口#xff09;
操作
给爷惹火了我踏马解析json选zip直接全部下下来 把这个大家的开发板管理地址下下来跟后面python放在同一目录下#xff0c…不知道什么仙人设计的arduino连接网络部分死活下不下来。真的沙口第一次看到这么抽风的下载口
操作
给爷惹火了我踏马解析json选zip直接全部下下来 把这个大家的开发板管理地址下下来跟后面python放在同一目录下下载下来的东西也都在一起 https://espressif.github.io/arduino-esp32/package_esp32_index.json
import json
import os.pathimport requests as requests
from contextlib import closingwith open(package_esp32_index.json) as f:metadata json.load(f)def download_with_prigress(url, store_path):with closing(requests.get(url, streamTrue)) as response:chunk_size 1024 # 单次请求最大值content_size int(response.headers[content-length]) # 内容体总大小data_count 0with open(store_path, wb) as file:for data in response.iter_content(chunk_sizechunk_size):file.write(data)data_count data_count len(data)now_jd (data_count / content_size) * 100print(\r 文件下载进度%d%%(%d/%d) - %s % (now_jd, data_count, content_size, url), end )print(\n)for platform in metadata[packages][0][platforms]:if platform[url][-4:] .zip:url platform[url]target_name platform[archiveFileName]if os.path.exists(target_name):print(exist, target_name)else:print(downloading, url)download_with_prigress(url, target_name)for tool in metadata[packages][0][tools]:for system in tool[systems]:# if system_or_platform[host] x86_64-mingw32 or system_or_platform[host] i686-mingw32:if system[url][-4:] .zip:url system[url]target_name system[archiveFileName]if os.path.exists(target_name):print(exist, target_name)else:print(downloading, url)download_with_prigress(url, target_name)
直接运行把这些下完的zip通通滚去这软件的默认下载暂存的地方再arduino C:\Users\xxxxxxx\AppData\Local\Arduino15\staging\packages 整个文件夹下好的全zip、代码、元数据json
github其实连接很快的防谁还抽风我直接传百度云了有需自取 链接https://pan.baidu.com/s/1O8yZFpKJAHDlx6HJhzOaPA 提取码ud1c 废弃的分析过程不用管
有幸等了半天下下来了部分包经过观察某一个包报错请求的是这个文件https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip 发现通过浏览器可以直接下载该文件 然后我们直接干去首选项要我们填入的地址https://espressif.github.io/arduino-esp32/package_esp32_index.json看看里面是什么东西 https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip 同时发现和下的url的对应关系于是就可以拼接了可以一个一个拼url把它下载但是懒试试url https://github.com/espressif/crosstool-NG/releases 可以访问再找到版本发现对应列表在检验发现list中文件url和上面报错要下载的是一样的可以依此类推但是好像还有些文件是不行的 https://github.com/espressif/crosstool-NG/releases/tag/esp-2021r2-patch5 本地的位置经过搜索得到C:\Users\xxxxxxx\AppData\Local\Arduino15\staging\packages 把zip放到这个文件夹下就行了然后再运行原来arduino包管理的ESP32的点击安装