Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By tlaren
#90916 I have a project that I want to be able to update the firmware and FS.
I have the firmware update working but do not know how to create the proper bin format for the LittleFS update.
I tried pointing to files that I want there but I get an error about the format.

Thanks in advance.
Tim
User avatar
By tlaren
#91132 Well no replies:
If someone wants to know...

First create a folder named data within your sketch directory. Put the files you want to upload in that folder.
Next install the Tools extension for LittleFS to the Arduino IDE. This is the latest version as of this post:
https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.5.0/ESP8266FS-0.5.0.zip
Unzip this in your "tools' directory. Reboot the IDE and there should be an extra option under the Tools menu "ESP8266 LittleFS Data uploader".
With the Serial Monitor closed, click this menu option and your data will be uploaded.
You will see progress in the bottom window.
LittleFS is very useful and works great.

Have fun...
Tim
User avatar
By jankop
#91139 Here is original: https://www.fancon.cz/esp8266-humi-server-klient/arduino-humi-server-client.html#otafile

Translation:
How to upgrade a file system via OTA
1/28/2021
I've been looking for advice for a long time on how to upload a file to a file system via OTA, as I mentioned above. But I always broke down LittleFS (SPIFFS).
But now I read that I can't upload files directly, but first I have to convert the whole file system to * .bin. There is a special tool for this, which does not work more than it works. But I found in that scary jungle of the internet (They should cancel it ...) a gem, advice on gold.

To upgrade via a serial line, you always need tools (downloaded from github.com), which I have already installed in the Arduino IDE. If I have data for SPIFFS stored in the project in the data directory where it must be located, then just run the ESP8266 LittleFS Data Upload tool over the open project. He is trying to record via a serial line, but since the ESP8266 is not connected, it crashes. Before his death, however, he writes where he created the file system in the * .bin format.

For a project named HUMI3_LOOP, it looks something like this:
[LittleFS] upload: C: \ Users \ Pavel \ AppData \ Local \ Temp \ arduino_build_732033 / HUMI3_LOOP.mklittlefs.bin

And then you just need to extract the HUMI3_LOOP.mklittlefs.bin file from this location and upload it via OTA with the FileSystem entry. In order to be able to easily transfer the file to the client, the settings in your ESP8266 http server must not be missing.

For favicon.ico it is this line:
server.serveStatic ("/ favicon.ico", LittleFS, "favicon.ico");

That line of code tells the server to reach the file system when a client requests a favicon.ico file and send the requested file directly to the client. Amazing with its simplicity. If the file is not found, then the client's 404 File not found is returned. Beautifully transparent and it even works. Only in this work does the accuracy of the name and the size of the letters matter.

But when I first successfully uploaded favicon.ico via OTA, a tiny icon didn't appear in Chrome. I deleted the cache and who knows what else. Eventually I ran Edge and lo and behold, the icon was. Chrome remembered that he hadn't received a favicon from a source before, and then didn't ask for it again. But after a while he could tell.

You can also easily get a file from the ESP8266 http server file system, including favicon.ico, by simply querying IP-ESP8266 / favicon.ico and having it on the screen. It's amazing when I uploaded a nice JPG image via OTA and the browser could view it directly from that mischievous cockroach. Please note the tiny blue favicon at the top left. The image itself is full screen, but I have reduced the size of the browser window to see what and how.
If you know all this and you knew how to do it, then you should have told me ... :-)