-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
"Integrated handling for filesystem and gzipped Binaries" (Restart with fresh Fork) #8338
Conversation
As agreed in my old (now closed) PR #8266, I had remade it by starting with a fresh fork of esp8266/Arduino. @d-a-v Can You please review this ? |
Sorry for taking so long to check on your work, I'm just not used to using filesystems flashing (I prefer to use network protocols and download files on first run). I have been trying the "alpha" release on a dummy linux account that I use for testing. Edit This is also true with xtensa-gcc path.
Their path shouldn't be guessed (it's actually |
This assumes that these tools are located below "{runtime.platform.path}/tools". The message You see is a bit confusing, because the second parameter that should indicate the path were the tool was searched was chosen wrong. But as long as You had done the "Initialize the submodules", the code will resolve the path to the FS-tool correctly...
This will require:
OK, I had implemented these changes and will commit them hereafter |
Sorry, Commit text is wrong it should have been "Improved..." not "Aproved..." |
@d-a-v |
#6690 is mine, is more than 2 years old, and hasn't received any public comment since 9 months. Please be patient, we don't have more free time than you do. |
@d-a-v That sound like You haven't enough manpower. May I help anywhere ? |
ATENTION: This is tested on Linux only! See below for open questions/prerequisites.
Currently there are some manual steps necessary to prepare the files necessary for OTA updates (especially for ESP8266HTTPUpdateServer)
The steps are:
Compile the sketch
Export the generated sketch-binary
Generate the filesystem
Export the fs-binary
Generate gzipped versions of binaries
Generate signed versions of gzipped binaries
Which of the above steps are necessary depends on the sketch (does it use a fs?) and the kind of OTA chosen (signed binaries necessary?) or preferred usage (use of gzipped binaries for faster upload?).
There are some problems/inconveniences:
2. The signed sketch-binary is not exported when using "Export compiled Binary".
(This point will be solved with my Pull-Request #8255)
3. & 4. AFAIK, the only “integrated” way to generate the fs is using one of the tools:
“arduino-esp8266littlefs-plugin” or “arduino-esp8266fs-plugin”.
Both tools are designed to create & upload the fs, but not export them.
So if preparing the files for an OTA when no board is connected, you have to:
ignore errors shown because upload is not possible
find & navigate to the “build.path” and copy the fs-binary manually
& 6. AFAIK, there is no “integrated” way to perform these steps.
This Pull-Request will integrate all of the above steps into the “compile and/or upload” action of Arduino.
This is done by adding 3 new entries (“Upload”, "Filesystem" and "Export") to the tools-menu.
These entries are presented just like any other options for esp8266 (“Upload speed” ... “Non-32-Bit Access”) and placed right after the last.
Below is the text that is already integrated into "doc/filesystem.rst"
--- schnipp ---
Menu-Entry “Upload” lets You choose between:
This Menu controls which parts are uploaded when "Sketch->Upload" (Ctrl-U)
is selected from the Arduino Menu.
Menu-Entry “Filesystem” lets You choose between:
This Menu controls which Fs will be created when "Sketch->Compile" (Ctrl-R)
is selected from the Arduino Menu. The Fs will always be created inside the
"export" dir (see below).
Menu-Entry “Export” lets You choose between:
This Menu controls export & generation of (extra) Sketch-Binaries.
The "export" dir
................
After a (successful) compile, the files will be exported to a subdir
“bin/{variant}” of Your sketch directory
(“{variant}” replaced with the name of the board as shown behind
“Tools -> Board:”).
Signed variants of all Binaries are generated similar to the
“automatic signing” done for normal sketch binary.
As valid for the "old" tools mentioned below, it is nessesary to place
files you want to be inside the generated file system into a directory
named
data
inside Your sketch directory.--- schnapp ---
Open questions/prerequisites:
As stated above I had tested this on Linux only.
Hopefully some cant test it under windows..
tkinter should be available.
if it is not, and creating of fs is requested AND the data dir is empty, I didn't know how to ask the user: “Are you sure you want to create an empty ... image?”.
So in this case a message is given and the fs will not be created.
(So its not a real problem if tkinter isn't installed)
An additional question for developers:
As mentioned inside function main of “postbuild.py”, there is a strange behavior of the arg "{build.path}" supplied via “platform.txt”. If someone can explain me why this “string” behave as described in the comments, I would be happy ;-)