Skip to content

"Esptool: No such file or directory" error when uploading code to ESP8266 board #980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
FlynnMarlie opened this issue Jul 30, 2024 · 2 comments · Fixed by #986
Closed
3 tasks done

"Esptool: No such file or directory" error when uploading code to ESP8266 board #980

FlynnMarlie opened this issue Jul 30, 2024 · 2 comments · Fixed by #986
Assignees
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system os: macos Specific to macOS operating system topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Milestone

Comments

@FlynnMarlie
Copy link

FlynnMarlie commented Jul 30, 2024

Describe the problem

The latest release (1.6.0) of the Cloud agent causes uploading any sketch to an ESP8266 board to fail:

Used platform   Version Path                                                            
esp8266:esp8266 2.5.0   /home/builder/.arduino15/packages/esp8266/hardware/esp8266/2.5.0

Flashing with command:{runtime.tools.esptool.path}/esptool -vv -cd nodemcu -cb 115200 -cp /dev/cu.usbserial-02856F96 -ca 0x00000 -cf /var/folders/sx/07hx_hp11nz50sf4ljwylj080000gn/T/arduino-create-agent189194775/new_sketch_1722490854405.bin
Start command: fork/exec {runtime.tools.esptool.path}/esptool: no such file or directory
error 1

We navigated to the "esptool" folder in the .arduino-create directory, but found that this folder is empty. After attempting to place the files it was looking for in the directory manually, it seemed as if the files were getting deleted when the agent attempts to flash the attached device.

We were able flash to the device and upload the new code by first quitting the agent that was running, then installing the previous version of the agent (version 1.5.0) and then running it. It then allowed us to upload the new code successfully. Going back to version 1.5.0 worked as long as the device didn't restart and the browser wasn't refreshed as a restart or browser refresh caused it to download and use version 1.6.0 again and the issue would happen again.

Here is a screenshot of how the error was displayed in the console:

image

To reproduce

To reproduce the issue, simply create a new sketch in Arduino Create (https://create.arduino.cc/editor).

Next, connect an ESP8266 board to the computer and attempt to upload any code to it. The error should show then.

Expected behavior

It is possible to upload to ESP8266 boards from Arduino Cloud.

Arduino Create Agent version

1.6.0

Operating system

  • macOS
  • Linux

Operating system version

  • macOS: All operating system versions seems to be affected
  • Ubuntu 22.04

Browser

Chrome

Browser version

All browser versions seems to be affected

Additional context

Uploading code to an ESP8266 board from Arduino Cloud using a Windows computer works fine.


Uploading code to non-ESP8266 boards (including ESP32-based boards) works fine even on Linux and macOS machines.

Additional reports

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@FlynnMarlie FlynnMarlie added the type: imperfection Perceived defect in any part of project label Jul 30, 2024
@per1234 per1234 added topic: code Related to content of the project itself os: linux Specific to Linux operating system os: macos Specific to macOS operating system labels Aug 2, 2024
@per1234 per1234 changed the title "Esptool: No such file or directory" error when uploading code to ESP8266 board on a Mac "Esptool: No such file or directory" error when uploading code to ESP8266 board Aug 2, 2024
@umbynos
Copy link
Contributor

umbynos commented Aug 5, 2024

The problem has been introduced in 1.6.0 (in #953, to be specific in 887b22b):

Running the same curl request:

curl 'http://127.0.0.1:8991/v2/pkgs/tools/installed' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Content-Type: text/plain;charset=UTF-8' -H 'Origin: https://app.arduino.cc' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'Priority: u=4' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"checksum":"SHA-256:bded1dca953377838b6086a9bcd40a1dc5286ba5f69f2372c22a1d1819baad24","name":"esptool","packager":"esp8266","signature":"852b58871419ce5e5633ecfaa72c0f0fa890ceb51164b362b8133bc0e3e003a21cec48935b8cdc078f4031219cbf17fb7edd9d7c9ca8ed85492911c9ca6353c9aa4691eb91fda99563a6bd49aeca0d9981fb05ec76e45c6024f8a6822862ad1e34ddc652fbbf4fa909887a255d4f087398ec386577efcec523c21203be3d10fc9e9b0f990a7536875a77dc2bc5cbffea7734b62238e31719111b718bacccebffc9be689545540e81d23b81caa66214376f58a0d6a45cf7efc5d3af62ab932b371628162fffe403906f41d5534921e5be081c5ac2ecc9db5caec03a105cc44b00ce19a95ad079843501eb8182e0717ce327867380c0e39d2b48698547fc1d0d66","url":"https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.esptool-f80ae31.tar.gz","version":"2.5.0-3-20ed2b9"}'

with 1.6.0 ⬇️

{"name":"fault","id":"8jjT_VHw","message":"Create file /home/umberto/.arduino-create/esp8266/esptool/2.5.0-3-20ed2b9/esptool: open /home/umberto/.arduino-create/esp8266/esptool/2.5.0-3-20ed2b9/esptool: is a directory","temporary":false,"timeout":false,"fault":true}

with 1.5.0

{"status":"ok"}

@Xayton Xayton added this to the 1.6.1 milestone Aug 5, 2024
@Xayton
Copy link
Contributor

Xayton commented Aug 5, 2024

We discovered this is a regression caused by some changes in 1.6.0 and by a peculiar structure of the esptool packages. The package has a root folder "esptool" with the same name of the file contained in it ("esptool").

@Xayton Xayton self-assigned this Aug 5, 2024
@umbynos umbynos linked a pull request Aug 5, 2024 that will close this issue
2 tasks
umbynos added a commit that referenced this issue Aug 5, 2024
* fix link

* drop test on old tool not used anymore, and introduce again `arduino-fwuploader`

* add tests to install esptool to verify #980

* implement properly rename function to fix extraction issue with esptool

* fix test

* Update v2/pkgs/tools_test.go

Co-authored-by: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com>

---------

Co-authored-by: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system os: macos Specific to macOS operating system topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants