So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Sushant Naik
#76606 Hi,
this is sushant,
i have a project need in which i have to download bin file in SPIFFS memory.

Project part has Main project BIN and SPIFFS memory bin for images. i have webserver implemented on ESP8266, and images of webserver part are stored in SPIFFS.

when i download the BIN from ESP flash downloader only PROJECT part is downloaded image section is empty.

i used the following link
upload-image-png-jpeg-to-esp8266-web-page example for image upload in webserver application.

from following code u can see that above link also upload BIN file in memory section 0x300000.
Code: Select all[SPIFFS] upload : C:\Users\sushant\AppData\Local\Temp\buildfabb234f1134a62f969bd7e5c22e1aed.spiffs/project1_180617.spiffs.bin
[SPIFFS] reset  : nodemcu
[SPIFFS] port   : COM3
[SPIFFS] speed  : 115200
[SPIFFS] address: 0x300000

Uploading 1028096 bytes from C:\Users\<username>\AppData\Local\Temp\buildfabb234f1134a62f969bd7e5c22e1aed.spiffs/project1_180617.spiffs.bin to flash at 0x00300000


I dont wanna use arduino IDE everytime to upload BIN file (project1_180617.spiffs.bin ) for images and Code.

i need easy solution like ESP flash downloader.

would like to know any help in this area.

if need any more information please let me know.
User avatar
By btidey
#76607 If you want to update data files in SPIFFS independently of the code used then the easiest way is to include fsbrowser functionality into your sketch. This then allows you to browse SPIFFS, upload and delete files directly from a browser.

https://github.com/esp8266/Arduino/tree ... /FSBrowser gives the base example.

I normally add on a minimal file uploader into the sketch as well as this makes it easier to get going by uploading the few files that FSBrowser needs.

Code: Select allvoid handleMinimalUpload() {
  char temp[700];

  snprintf ( temp, 700,
    "<!DOCTYPE html>\
    <html>\
      <head>\
        <title>ESP8266 Upload</title>\
        <meta charset=\"utf-8\">\
        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\
        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\
      </head>\
      <body>\
        <form action=\"/edit\" method=\"post\" enctype=\"multipart/form-data\">\
          <input type=\"file\" name=\"data\">\
          <input type=\"text\" name=\"path\" value=\"/\">\
          <button>Upload</button>\
         </form>\
      </body>\
    </html>"
  );
  server.send ( 200, "text/html", temp );
}


with a

server.on("/upload", handleMinimalUpload);
in setup