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

Read current partitions #164

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Conversation

tyeth
Copy link

@tyeth tyeth commented Nov 30, 2024

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.

@brianignacio5
Copy link
Collaborator

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.

@tyeth tyeth force-pushed the readCurrentPartitions branch from 9a142ad to e25415f Compare December 10, 2024 14:10
@Jason2866
Copy link
Contributor

Jason2866 commented Dec 20, 2024

@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 ;-)

@tyeth
Copy link
Author

tyeth commented Dec 20, 2024

@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

@Jason2866
Copy link
Contributor

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

@Jason2866
Copy link
Contributor

Jason2866 commented Dec 20, 2024

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

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.

3 participants