esptool-js icon indicating copy to clipboard operation
esptool-js copied to clipboard

Read current partition scheme / table, download individual partitions or all/some flash.

Open tyeth opened this issue 1 year ago • 5 comments

I'm looking for feedback, I've added the partition reader to esptool-js, along with the ability to download flash data.

Test it here: https://tyeth.github.io/read-partitions-esptool-js/

Ideally I want to have a littlefs and fatfs data explorer incorporated too, but I'm a little ways off (down the rabbit hole of filemanagers, although the fatfs/littlefs stuff should be okay). I mainly want this for easy editing of secrets in littlefs devices, along with dropping files into the file system with relative ease (without installing anything).

I would really appreciate any suggestion of open source easy to use file manager type components or whatever (typescript/javascript/wasm), along with feedback on whether you think the esptool-js should include the partition/flash reading functionality, and potentially file manager (reading file systems from partition / img / bin and editing the contents through a file explorer).

Before submitting this properly I'd clean up the code along with css / todo comments.

tyeth avatar Nov 30 '24 20:11 tyeth

Hi @tyeth thank you for your PR. Will take a look when I have some time.

Regarding the file manager, I wanted to implement it too for the esp-idf vscode extension but the issue is to get the file tree from binaries when you don't really know what is in the image. Required work is a bit out of my scope but I will poke some people about it.

brianignacio5 avatar Dec 06 '24 08:12 brianignacio5

@tyeth May it helps. Here it is a Platformio Python script which does similar what your PR does for esptool.js. It downloads the LittleFS partition image and extracts the files from the image. https://github.com/arendst/Tasmota/blob/development/pio-tools/custom_target.py

For working correctly to extract the files I had to compile the mklittlefs tool myself. The provided from Platformio registry does not work... The mklittlefs source and released binarys are here https://github.com/Jason2866/mklittlefs_esp32

P.S I was deep in the rabbit hole ;-)

Jason2866 avatar Dec 20 '24 17:12 Jason2866

@Jason2866 thanks so much! Was looking if the Adafruit pure js littlefs version we use to generate partitions could be used for reading (or fixed up to add missing functions). Then I got distracted in this beautiful wasm littlefs simulator, then realised I'd been neglecting my main tasks hehe, hopefully I'll revisit over the holidays

tyeth avatar Dec 20 '24 18:12 tyeth

@tyeth Just tested your tool online. Well done. Love it!

Jason2866 avatar Dec 20 '24 18:12 Jason2866

There is a Python LittleFS implementation https://github.com/jrast/littlefs-python may this is easier to port

Jason2866 avatar Dec 20 '24 20:12 Jason2866