Skip to content
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

Allow Filesystem update via ESP8266HTTPUpdateServer #3732

Merged
merged 34 commits into from
Sep 20, 2019
Merged

Allow Filesystem update via ESP8266HTTPUpdateServer #3732

merged 34 commits into from
Sep 20, 2019

Conversation

caverna
Copy link
Contributor

@caverna caverna commented Oct 17, 2017

This is a fix for #3234 from @sandeen
The original description is:

This adds capability to update the SPIFFS image via the same mechanism as firmware in the ESP8266HTTPUpdateServer.

It does not provide any dependency or linkage between firmware and spiffs image updating; they are each taken on their own, each followed by a reboot.

(I wrote this before seeing the other PR #2701 for similar functionality; I like this a bit better, because it uses the available SPIFFS size, and does not hide magic numbers (U_SPIFFS) in the html...)

(It also cleans up a stray \n from commit ace0622)

We'd really like to see this functionality in the library for the OpenEVSE wifi project

This is my first try at this, mostly cribbing from the ESP8266httpUpdate version of the updater - happy to fix up anything as needed.

Thanks,
-Eric

sandeen and others added 4 commits May 11, 2017 16:50
This adds capability to update the SPIFFS image via
the same mechansism as firmware in the 
ESP8266HTTPUpdateServer.

It does not provide any dependency or linkage between
firmware and spiffs image updating; they are each taken
on their own, each followed by a reboot.

(I wrote this before seeing the other PR for similar
functionality; I like this a bit better, becaue it uses
the available SPIFFS size, and does not hide magic numbers
(U_SPIFFS) in the html...)

(It also cleans up a stray \n from commit ace0622)
# Conflicts:
#	libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer.cpp
@caverna
Copy link
Contributor Author

caverna commented Oct 18, 2017

I'm using this feature for a while and it works great!

@caverna
Copy link
Contributor Author

caverna commented Oct 21, 2017

I think it deserves a little more explanation here...
I don't use ArduinoIDE, in fact I do use VisualStudio together to VMicro addon http://www.visualmicro.com/ (because I'm a C# programmer and I don't want to be switching IDEs).
From this addon, I'm able to generate both sketch and SPIFFS easily.
The original ESP8266HTTPUpdateServer class works fine for sketch binary, but I hadn't no other way to push SPIFF besides the serial (and I was limited to use only 256KB sketch).
That's why this PR is so important to me, because I'm free to use the whole 1MB of ESP (and I'm pretty sure that, if I upgrade it to a 4MB flash, it will work flawless)

@caverna
Copy link
Contributor Author

caverna commented Nov 5, 2017

@devyte , would you mind to look into this PR?

@caverna
Copy link
Contributor Author

caverna commented Dec 21, 2017

Hi @igrr
Would you mind to look into this PR?

@caverna
Copy link
Contributor Author

caverna commented Feb 15, 2018

Just for curiosity, does this PR have no importance at all?

@devyte
Copy link
Collaborator

devyte commented Feb 16, 2018

@caverna it's important, I may include this in my own application. We're just prioritizing stability for 2.4.1 and likely 2.5.0 as well, which means complex enhancements like this one get pushed back a little. Please be patient, we'll get there.

@caverna
Copy link
Contributor Author

caverna commented Sep 12, 2019

Ok, the library has changed a lot...
How can I get now the start and the size of the SPIFF?

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 12, 2019

It was _SPIFFS_start, it is now _FS_start (and _end, _page and _block, #5511)

@caverna
Copy link
Contributor Author

caverna commented Sep 17, 2019

Hi @d-a-v !
I did check Travis results but I have no clue how to fix it (error messages doesn't help).

@devyte
Copy link
Collaborator

devyte commented Sep 17, 2019

Symbols _Fs_end and _Fs_start aren't defined.

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 17, 2019

They are declared in flash_hal.h

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea, thanks for updating it to the new core!

@caverna
Copy link
Contributor Author

caverna commented Sep 17, 2019

@earlephilhower sorry, I typed your user wrong in comments... :-)

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, thanks.

@caverna
Copy link
Contributor Author

caverna commented Sep 17, 2019

@d-a-v please let me know if it's necessary to rename internal variables and/or html parameter name.

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 17, 2019

@caverna Yes it seems @earlephilhower is right and names could be more generic
"spiffs" -> "filesystem" in ESP8266HTTPUpdateServer-impl.h around L30 and L95,

@d-a-v d-a-v removed the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Sep 17, 2019
@d-a-v d-a-v changed the title Allow SPIFFS update via ESP8266HTTPUpdateServer Allow Filesystem update via ESP8266HTTPUpdateServer Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants