arduino-esp32fs-plugin
arduino-esp32fs-plugin copied to clipboard
Got "SPIFFS Error: esptool not found" on Linux
Hello there,
I've been hunting high and low, but I can't find a solution for this issue. I have all the tools updated and I can launch esptool from the terminal (which is in /home/***/.local/bin/esptool.py), but when I try to upload the FS on the ESP i doesn't work.
I tried to create a link with the command ln -s /home/***/.local/bin/esptool.py /home/***/.arduino15/packages/esp32/hardware/esp32/3.1.1/tools/ and it seems to find it, but it complains about "suppress" method attribute not present.
I'm going nuts...
Ubuntu Linux 20.04 Arduino IDE 1.8.15 Python 3.8
no one knows?same Error, ESP32C2
I've switched to Arduino IDE 2 using thi other plugin:
https://github.com/earlephilhower/arduino-littlefs-upload
esptool can be installed through most package managers. eg on ubuntu: sudo apt install esptool
Not ideal, this tool should probably reference the arduino board provided one, but it's a workaround I'm using right now.
I ran into the same problem.
This is what I use: Arduino IDE 1.8.19, esp32 Board 3.3.0, python3, Linux Mint. There are several reasons for this issue, the esp32fs.jar doesn't match the current versions of the ESP32 core software. The tool expects a .py file, and the command line parameters changed for the new esptool (my version is 5.0.0).
I solved this issue with 2 steps:
- create a sym link in /usr/bin for python, pointing to your current python version:
cd /usr/bin; sudo link -s python3.12 python - create a file esptool.py in ~/.arduino15/packages/esp32/tools/esptool_py/5.0.0 as follows:
import subprocess import sys args = sys.argv; args.pop(0); subprocess.run(['~/.arduino15/packages/esp32/tools/esptool_py/5.0.0/esptool', args[4], args[5], 'write-flash', args[18], args[19] ]);
Hope this helps.
2. create a file esptool.py in ~/.arduino15/packages/esp32/tools/esptool_py/5.0.0 as follows:
import subprocess import sys args = sys.argv; args.pop(0); subprocess.run(['~/.arduino15/packages/esp32/tools/esptool_py/5.0.0/esptool', args[4], args[5], 'write-flash', args[18], args[19] ]);Hope this helps.
Doesn't work:
~/.arduino15/packages/esp32/tools/esptool_py/5.0.dev1$ import subprocess import sys args = sys.argv; args.pop(0); subprocess.run(['~/.arduino15/packages/esp32/tools/esptool_py/5.0.0/esptool', args[4], args[5], 'write-flash', args[18], args[19] ]);
bash: Syntaxfehler beim unerwarteten Wort »0«
esptool can be installed through most package managers. eg on ubuntu: sudo apt install esptool
Not ideal, this tool should probably reference the arduino board provided one, but it's a workaround I'm using right now.
Not working for me either.
Any other ideas?
Ok, i understand now that i hat to paste it in a created esptool.py file. Still it doesn't work but i dont have the error at hand (some arg mismatch i think). I switched to Windows and there everything worked fine.
On my manjaro linux i created file esptool.py in ~/.arduino15/packages/esp32/tools/esptool_py/5.1.0 with next code: `#!/usr/bin/env python3 import os import subprocess import sys
def main(): base_dir = os.path.dirname(os.path.abspath(file)) candidates = [ os.path.join(base_dir, "esptool"), # binary (Linux/macOS) os.path.join(base_dir, "esptool.py"), # Python script (if present) os.path.join(base_dir, "esptool.exe"), # Windows ] tool = None for c in candidates: if os.path.isfile(c): tool = c break if not tool: print(f"[esptool-wrapper] Tool 'esptool' not found in: {base_dir}", file=sys.stderr) print(f"[esptool-wrapper] Tried: {', '.join(os.path.basename(c) for c in candidates)}", file=sys.stderr) sys.exit(1) # If Python script found, run with current interpreter; otherwise run the binary directly if tool.endswith(".py"): cmd = [sys.executable, tool] + sys.argv[1:] else: cmd = [tool] + sys.argv[1:] try: result = subprocess.run(cmd) sys.exit(result.returncode) except FileNotFoundError: print(f"[esptool-wrapper] Cannot execute: {tool}", file=sys.stderr) print("[esptool-wrapper] Ensure the file exists and is executable (chmod +x).", file=sys.stderr) sys.exit(1) except PermissionError: print(f"[esptool-wrapper] Permission denied when executing: {tool}", file=sys.stderr) print("[esptool-wrapper] Grant execute permission: chmod +x esptool", file=sys.stderr) sys.exit(1) if name == "main": main() ` And after this - „ESP32 Sketch Data Upload” works perfect for me.