@@ -45,18 +45,22 @@ def configure_default_packages(self, variables, targets):
45
45
if "arduino" in frameworks :
46
46
self .packages ["framework-arduinoespressif32" ]["optional" ] = False
47
47
self .packages ["framework-arduinoespressif32-libs" ]["optional" ] = False
48
- # use latest stable release Arduino core
49
- ARDUINO_CORE_API_URL = "https://api.github.com/repos/espressif/Arduino-esp32/releases/latest"
50
- api_data = requests .get (ARDUINO_CORE_API_URL , timeout = 10 ).json ()
51
- zipball = api_data .get ("zipball_url" )
52
- tag = api_data .get ("tag_name" )
53
- # print("Latest release Arduino core URL:", zipball)
54
- self .packages ["framework-arduinoespressif32" ]["version" ] = zipball
55
- # use corresponding espressif Arduino libs to release
56
- URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/" + tag + "/package/package_esp32_index.template.json"
57
- packjdata = requests .get (URL , timeout = 10 ).json ()
58
- dyn_lib_url = packjdata ['packages' ][0 ]['tools' ][0 ]['systems' ][0 ]['url' ]
59
- self .packages ["framework-arduinoespressif32-libs" ]["version" ] = dyn_lib_url
48
+ try :
49
+ # use latest stable release Arduino core
50
+ ARDUINO_CORE_API_URL = "https://api.github.com/repos/espressif/Arduino-esp32/releases/latest"
51
+ api_data = requests .get (ARDUINO_CORE_API_URL , timeout = 2 ).json ()
52
+ zipball = api_data .get ("zipball_url" )
53
+ tag = api_data .get ("tag_name" )
54
+ if tag is not None :
55
+ # print("Latest release Arduino core URL:", zipball)
56
+ self .packages ["framework-arduinoespressif32" ]["version" ] = zipball
57
+ # use corresponding espressif Arduino libs to release
58
+ URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/" + tag + "/package/package_esp32_index.template.json"
59
+ packjdata = requests .get (URL , timeout = 10 ).json ()
60
+ dyn_lib_url = packjdata ['packages' ][0 ]['tools' ][0 ]['systems' ][0 ]['url' ]
61
+ self .packages ["framework-arduinoespressif32-libs" ]["version" ] = dyn_lib_url
62
+ except :
63
+ pass
60
64
61
65
if "buildfs" in targets :
62
66
filesystem = variables .get ("board_build.filesystem" , "littlefs" )
0 commit comments