-->
Page 1 of 2

Auto uploading to SPIFFS

PostPosted: Mon Feb 01, 2016 1:02 pm
by bjpirt
Hello,
Apologies if this is covered somewhere but after a fair bit of Googling I can't seem to find an answer.

I'm making a library which will have some files that will be served from SPIFFS - is there a way of having these put into the SPIFFS partition when I click "Program"?

At the moment it seems like I have to instruct the user to manually install the fs-plugin and then upload from there or alternatively convert the files to C byte structures and include them in the project and just not use SPIFFS at all.

It would be great if I could put them in an "spiffs" folder and they would get uploaded automatically!
Cheers,
Ben

Re: Auto uploading to SPIFFS

PostPosted: Mon Feb 01, 2016 1:11 pm
by WereCatf
There is a tool that simply replaces the contents of SPIFFS with the contents of the data-directory under your sketch. See https://github.com/esp8266/Arduino/blob ... ile-system

Re: Auto uploading to SPIFFS

PostPosted: Mon Feb 01, 2016 6:03 pm
by bjpirt
Yeah, that's the fs-plugin I was hoping to avoid. It's one of the tricky things with using the Arduino rather than your own project and Makefile; you give up some (all) of the control of the build process.

Re: Auto uploading to SPIFFS

PostPosted: Mon Feb 01, 2016 6:18 pm
by WereCatf
Personally, I have a sketch with a webserver running and simply upload files to SPIFFS over HTTP -- you can use a proper web-browser, you can script uploading of files from the command-line with CURL and so on. I don't like that tool because it replaces SPIFFS's contents and the way I do it doesn't. My way is also faster for uploading a couple of files as the tool uploads a full 3MB image every time whereas I tend to only upload a couple of kilobytes.