|
16 | 16 | import contextlib
|
17 | 17 | import json
|
18 | 18 | import requests
|
19 |
| -import socket |
20 | 19 | import subprocess
|
21 | 20 | import sys
|
22 | 21 | import shutil
|
|
35 | 34 | MKLITTLEFS_VERSION_400 = "4.0.0"
|
36 | 35 | DEFAULT_DEBUG_SPEED = "5000"
|
37 | 36 | DEFAULT_APP_OFFSET = "0x10000"
|
38 |
| -ARDUINO_ESP32_PACKAGE_URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/master/package/package_esp32_index.template.json" |
39 | 37 |
|
40 | 38 | # MCUs that support ESP-builtin debug
|
41 | 39 | ESP_BUILTIN_DEBUG_MCUS = frozenset([
|
|
86 | 84 | # Configure logger
|
87 | 85 | logger = logging.getLogger(__name__)
|
88 | 86 |
|
89 |
| -def is_internet_available(): |
90 |
| - """Check if connected to Internet""" |
91 |
| - try: |
92 |
| - with socket.create_connection(("8.8.8.8", 53), timeout=3): |
93 |
| - return True |
94 |
| - except OSError: |
95 |
| - return False |
96 |
| - |
97 | 87 | def safe_file_operation(operation_func):
|
98 | 88 | """Decorator for safe filesystem operations with error handling."""
|
99 | 89 | def wrapper(*args, **kwargs):
|
@@ -310,16 +300,6 @@ def _configure_arduino_framework(self, frameworks: List[str]) -> None:
|
310 | 300 | self.packages["framework-arduinoespressif32"]["optional"] = False
|
311 | 301 | self.packages["framework-arduinoespressif32-libs"]["optional"] = False
|
312 | 302 |
|
313 |
| - if is_internet_available(): |
314 |
| - try: |
315 |
| - response = requests.get(ARDUINO_ESP32_PACKAGE_URL, timeout=30) |
316 |
| - response.raise_for_status() |
317 |
| - packjdata = response.json() |
318 |
| - dyn_lib_url = packjdata['packages'][0]['tools'][0]['systems'][0]['url'] |
319 |
| - self.packages["framework-arduinoespressif32-libs"]["version"] = dyn_lib_url |
320 |
| - except (requests.RequestException, KeyError, IndexError) as e: |
321 |
| - logger.error(f"Failed to fetch Arduino framework library URL: {e}") |
322 |
| - |
323 | 303 | def _configure_espidf_framework(
|
324 | 304 | self, frameworks: List[str], variables: Dict, board_config: Dict, mcu: str
|
325 | 305 | ) -> None:
|
|
0 commit comments