chmorgan / esphttpd-freertos

freertos example of libesphttpd for esp32 and esp8266
54 stars 13 forks source link

Improve flash-api #9

Closed phatpaul closed 5 years ago

phatpaul commented 5 years ago

I made some additions/improvements to the cgiFlash.c and improved the html/js GUI for managing partitions. I'm not bothering to support the older ESP8266 chip (I don't have one).

Tested on:

Note that these additions to the esphttpd-freertos repository depend on my additions to the libesphttpd repository. I'll create a pull-request for that one too.

The API is documented here: https://github.com/phatpaul/libesphttpd/blob/master/README-flash_api.md

A screenshot of the GUI. It's a bit ugly but it fits in with the other GUI pages in this example project. 2018-10-11 15_16_04-upgrade firmware

phatpaul commented 5 years ago

Forgot to mention I haven't implemented the "App Version" column in the partition info table.
Anyone have an idea how to retrieve some text from an app image to display here?

I'm thinking of declaring in the app a const char[] which is rooted at a fixed address. Then retrieve that string from a fixed offset in the app image partition and display it in this table. It's dirty and won't work on an app which doesn't declare that string.

chmorgan commented 5 years ago

@phatpaul if you did add that string to the image it might complicate building images for other users. Today it's as simple as passing in the .bin file built by the esp-idf toolchain. We would need to append a header to the file etc. Do the current .bin files have a header on them already? It would be possible to add support for another kind of binary file that has a header with a magic number. Then the code could check for this magic number and if so then validate the header and then maybe that header includes the string you'd like to display. Otherwise assume its a raw .bin file. Thoughts?

chmorgan commented 5 years ago

@phatpaul I think this looks ok. Let's wait until the other flash stuff lands on libesphttpd master before we merge this, and I think you'll want to avoid redirecting the urls in the readme file away from the canonical repository for now.

phatpaul commented 5 years ago

@chmorgan I'll redo this PR with a squashed commit on a new branch and undo any pointers I made to my own repo.

phatpaul commented 5 years ago

See #10 closing this one