Skip to content

Commit 05d8eac

Browse files
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
1 parent 2187fca commit 05d8eac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ESP8266LittleFS.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private void createAndUpload(){
209209
File espota = new File(platform.getFolder()+"/tools");
210210
File esptool = new File(platform.getFolder()+"/tools");
211211
String serialPort = PreferencesData.get("serial.port");
212-
String pythonCmd = PreferencesData.get("runtime.os").contentEquals("windows") ? "python.exe" : "python";
212+
String pythonCmd = PreferencesData.get("runtime.os").contentEquals("windows") ? "python3.exe" : "python3";
213213
String uploadCmd = "";
214214

215215
//make sure the serial port or IP is defined
@@ -225,15 +225,15 @@ private void createAndUpload(){
225225
uploadCmd = uploadPyFile.getAbsolutePath();
226226
}
227227
// Find python.exe if present, don't fail if not found for backwards compat
228-
String[] paths = { platform.getFolder()+"/tools", platform.getFolder()+"/tools/python", PreferencesData.get("runtime.tools.python.path") };
228+
String[] paths = { platform.getFolder()+"/tools", platform.getFolder()+"/tools/python3", PreferencesData.get("runtime.tools.python3.path") };
229229
for (String s: paths) {
230230
File toolPyFile = new File(s, pythonCmd);
231231
if (toolPyFile.exists() && toolPyFile.isFile() && toolPyFile.canExecute()) {
232232
pythonCmd = toolPyFile.getAbsolutePath();
233233
break;
234234
}
235235
}
236-
// pythonCmd now points to either an installed exe with full path or just plain "python(.exe)"
236+
// pythonCmd now points to either an installed exe with full path or just plain "python3(.exe)"
237237

238238
//find espota if IP else find esptool
239239
if(serialPort.split("\\.").length == 4){
@@ -327,13 +327,13 @@ private void createAndUpload(){
327327
System.out.println("[LittleFS] port : "+serialPort);
328328
System.out.println("[LittleFS] speed : "+uploadSpeed);
329329
if (!uploadCmd.isEmpty()) {
330-
System.out.println("[SPIFFS] python : "+pythonCmd);
331-
System.out.println("[SPIFFS] uploader : "+uploadCmd);
330+
System.out.println("[LittleFS] python : "+pythonCmd);
331+
System.out.println("[LittleFS] uploader : "+uploadCmd);
332332
}
333333

334334
System.out.println();
335335
if (!uploadCmd.isEmpty()) {
336-
sysExec(new String[]{pythonCmd, uploadCmd, "--chip", "esp8266", "--port", serialPort, "--baud", uploadSpeed, "write_flash", uploadAddress, imagePath, "--end"});
336+
sysExec(new String[]{pythonCmd, uploadCmd, "--chip", "esp8266", "--port", serialPort, "--baud", uploadSpeed, "write_flash", uploadAddress, imagePath});
337337
} else {
338338
sysExec(new String[]{esptool.getAbsolutePath(), "-cd", resetMethod, "-cb", uploadSpeed, "-cp", serialPort, "-ca", uploadAddress, "-cf", imagePath});
339339
}

0 commit comments

Comments
 (0)