From 05d8eac4c7424c3eaf86968fc2df4a8f694b5340 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 18 Nov 2019 20:56:35 -0800 Subject: [PATCH] Use python3 for executing upload.py, drop --end The core has moved to Python3, so search for that instead of using obsolete Python2. Remove the --end argument since it is no longer needed by upload.py --- src/ESP8266LittleFS.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ESP8266LittleFS.java b/src/ESP8266LittleFS.java index 8e96fdd..70a2001 100644 --- a/src/ESP8266LittleFS.java +++ b/src/ESP8266LittleFS.java @@ -209,7 +209,7 @@ private void createAndUpload(){ File espota = new File(platform.getFolder()+"/tools"); File esptool = new File(platform.getFolder()+"/tools"); String serialPort = PreferencesData.get("serial.port"); - String pythonCmd = PreferencesData.get("runtime.os").contentEquals("windows") ? "python.exe" : "python"; + String pythonCmd = PreferencesData.get("runtime.os").contentEquals("windows") ? "python3.exe" : "python3"; String uploadCmd = ""; //make sure the serial port or IP is defined @@ -225,7 +225,7 @@ private void createAndUpload(){ uploadCmd = uploadPyFile.getAbsolutePath(); } // Find python.exe if present, don't fail if not found for backwards compat - String[] paths = { platform.getFolder()+"/tools", platform.getFolder()+"/tools/python", PreferencesData.get("runtime.tools.python.path") }; + String[] paths = { platform.getFolder()+"/tools", platform.getFolder()+"/tools/python3", PreferencesData.get("runtime.tools.python3.path") }; for (String s: paths) { File toolPyFile = new File(s, pythonCmd); if (toolPyFile.exists() && toolPyFile.isFile() && toolPyFile.canExecute()) { @@ -233,7 +233,7 @@ private void createAndUpload(){ break; } } - // pythonCmd now points to either an installed exe with full path or just plain "python(.exe)" + // pythonCmd now points to either an installed exe with full path or just plain "python3(.exe)" //find espota if IP else find esptool if(serialPort.split("\\.").length == 4){ @@ -327,13 +327,13 @@ private void createAndUpload(){ System.out.println("[LittleFS] port : "+serialPort); System.out.println("[LittleFS] speed : "+uploadSpeed); if (!uploadCmd.isEmpty()) { - System.out.println("[SPIFFS] python : "+pythonCmd); - System.out.println("[SPIFFS] uploader : "+uploadCmd); + System.out.println("[LittleFS] python : "+pythonCmd); + System.out.println("[LittleFS] uploader : "+uploadCmd); } System.out.println(); if (!uploadCmd.isEmpty()) { - sysExec(new String[]{pythonCmd, uploadCmd, "--chip", "esp8266", "--port", serialPort, "--baud", uploadSpeed, "write_flash", uploadAddress, imagePath, "--end"}); + sysExec(new String[]{pythonCmd, uploadCmd, "--chip", "esp8266", "--port", serialPort, "--baud", uploadSpeed, "write_flash", uploadAddress, imagePath}); } else { sysExec(new String[]{esptool.getAbsolutePath(), "-cd", resetMethod, "-cb", uploadSpeed, "-cp", serialPort, "-ca", uploadAddress, "-cf", imagePath}); }