Skip to content

Can't upload compiled code on esp8266 #64

Closed
@brusherru

Description

@brusherru

I want to upload code on esp8266 (wifi_slot).
I already applied patch from #35 and it works, so I can compile code, but I can't upload it...

Env

This bug can't be reproduced on Linux/MacOS.

Steps to reproduce

  1. Create and save sketch in the sketchbook directory.
  2. Compile it for the esp8266:esp8266:wifi_slot using properties in the FQBN (Why not --build-properties see below):
    arduino-cli --fqbn esp8266:esp8266:wifi_slot:CpuFrequency=80,Vtable=flash,FlashFreq=40,FlashMode=qio,FlashSize=1M0,LwIPVariant=v2mss536,Debug=Disabled,DebugLevel=None,FlashErase=none,UploadSpeed=921600 compile C:\Users\the-awesome-bob\arduino-projects\my-sketchbook\my_sketch
  3. Upload it:
    arduino-cli --fqbn esp8266:esp8266:wifi_slot:CpuFrequency=80,Vtable=flash,FlashFreq=40,FlashMode=qio,FlashSize=1M0,LwIPVariant=v2mss536,Debug=Disabled,DebugLevel=None,FlashErase=none,UploadSpeed=921600 --port COM5 upload C:\Users\the-awesome-bob\arduino-projects\my-sketchbook\my_sketch

Expected behavior

It uploaded and works fine.

Actual behavior

Arduino-cli exits with error:

No new serial port detected.
error: stat C:\Users\the-awesome-bob\arduino-projects\my-sketchbook\my_sketch/my_sketch.esp8266.esp8266.wifi_slot.CpuFrequency=80,Vtable=flash,FlashFreq=40,FlashMode=qio,FlashSize=1M0,LwIPVariant=v2mss536,Debug=Disabled,DebugLevel=None,FlashErase=none,UploadSpeed=921600.bin failed: No such file or directory
Error: exit status 2
Error during upload.

When I replace the path with UNC path \\localhost\c$\Users\... it exits with:

Compiled sketch not found. Please compile first.

Why not --build-properties

upload command does not have a special flag to specify upload properties. So it can't upload sketch even if you successfully compiled it with --build-properties.

Why it happens?

  1. First of all, you can see a wrong path separator in the path: "...sketchbook\my_sketch**/**my_sketch.esp8266..."
  2. The full path is longer than 260 symbols, so maybe this is the problem on Windows.
    This hypothesis is confirmed by next manipulations: I mounted a virtual drive to the folder (subst Z: C:\Users\the-awesome-bob\arduino-projects\my-sketchbook\) and then tell uploader the shorter path to my sketch: Z:\my_sketch — it uploads!

How to fix it

I propose two ways to fix it:

  1. Just remove properties from the filename (my_sketch.esp8266.esp8266.wifi_slot.bin).
  2. Add a special flag to upload command.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions