-
-
Notifications
You must be signed in to change notification settings - Fork 414
Closed
Milestone
Description
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
- Windows 10
- arduino-cli@0.2.2
This bug can't be reproduced on Linux/MacOS.
Steps to reproduce
- Create and save sketch in the sketchbook directory.
- 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
- 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?
- First of all, you can see a wrong path separator in the path: "...sketchbook\my_sketch**/**my_sketch.esp8266..."
- 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:
- Just remove properties from the filename (
my_sketch.esp8266.esp8266.wifi_slot.bin
). - Add a special flag to
upload
command.
knopki, nkrkv, evgenykochetkov, acosinwork and embhobbbcmaglie
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
Select code repository
Activity
embhobbb commentedon Oct 14, 2018
i am also facing same problem.
brusherru commentedon Oct 19, 2018
@embhobbb place thumb up in this case.
Probably, it will help the developers to measure how important this task is ;)
embhobbb commentedon Oct 21, 2018
@brusherru Did you get any solution yet?
cmaglie commentedon Oct 26, 2018
Ok it seems that the problem is the path of the compiled
sketch.bin
that is too long. Some improvements that comes to mind:remove the "options" part from the filename and call the file just
my_sketch.esp8266.esp8266.wifi_slot.bin
instead ofmy_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
.make the
upload
command become "compile+upload". This would mimic the IDE behavior and it will make the cli tolerant to cores that do not define a property to export the compiled binary.add options to specify file name like
arduino-cli compile --output myname.bin
andarduino-cli upload --input myname.bin
I'd implement 1) to begin with, but also 2) and 3) may be part of the next alpha as well.
Do not use FQBN "configs" part in saving .hex or .bin from compile
cmaglie commentedon Oct 29, 2018
@brusherru @embhobbb would you like to try this build?
#79 (comment)
I've implemented 1. and 3. of my previous post.
brusherru commentedon Oct 30, 2018
@cmaglie it works! 👏
Do not use FQBN "configs" part in saving .hex or .bin from compile
Do not use FQBN "configs" part in saving .hex or .bin from compile
Merge pull request #64 from arduino-libraries/multi-value-properties
Merge pull request #64 from arduino/per1234/incorrect-extras-folder-name