Make offline use possible again
* make more failsafe when no Internet connection
This commit is contained in:
+16
-12
@@ -45,18 +45,22 @@ class Espressif32Platform(PlatformBase):
|
|||||||
if "arduino" in frameworks:
|
if "arduino" in frameworks:
|
||||||
self.packages["framework-arduinoespressif32"]["optional"] = False
|
self.packages["framework-arduinoespressif32"]["optional"] = False
|
||||||
self.packages["framework-arduinoespressif32-libs"]["optional"] = False
|
self.packages["framework-arduinoespressif32-libs"]["optional"] = False
|
||||||
# use latest stable release Arduino core
|
try:
|
||||||
ARDUINO_CORE_API_URL = "https://api.github.com/repos/espressif/Arduino-esp32/releases/latest"
|
# use latest stable release Arduino core
|
||||||
api_data = requests.get(ARDUINO_CORE_API_URL, timeout=10).json()
|
ARDUINO_CORE_API_URL = "https://api.github.com/repos/espressif/Arduino-esp32/releases/latest"
|
||||||
zipball = api_data.get("zipball_url")
|
api_data = requests.get(ARDUINO_CORE_API_URL, timeout=2).json()
|
||||||
tag = api_data.get("tag_name")
|
zipball = api_data.get("zipball_url")
|
||||||
# print("Latest release Arduino core URL:", zipball)
|
tag = api_data.get("tag_name")
|
||||||
self.packages["framework-arduinoespressif32"]["version"] = zipball
|
if tag is not None:
|
||||||
# use corresponding espressif Arduino libs to release
|
# print("Latest release Arduino core URL:", zipball)
|
||||||
URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/" + tag + "/package/package_esp32_index.template.json"
|
self.packages["framework-arduinoespressif32"]["version"] = zipball
|
||||||
packjdata = requests.get(URL, timeout=10).json()
|
# use corresponding espressif Arduino libs to release
|
||||||
dyn_lib_url = packjdata['packages'][0]['tools'][0]['systems'][0]['url']
|
URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/" + tag + "/package/package_esp32_index.template.json"
|
||||||
self.packages["framework-arduinoespressif32-libs"]["version"] = dyn_lib_url
|
packjdata = requests.get(URL, timeout=10).json()
|
||||||
|
dyn_lib_url = packjdata['packages'][0]['tools'][0]['systems'][0]['url']
|
||||||
|
self.packages["framework-arduinoespressif32-libs"]["version"] = dyn_lib_url
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if "buildfs" in targets:
|
if "buildfs" in targets:
|
||||||
filesystem = variables.get("board_build.filesystem", "littlefs")
|
filesystem = variables.get("board_build.filesystem", "littlefs")
|
||||||
|
|||||||
Reference in New Issue
Block a user