glenn20 / micropython-esp32-ota

MIT License
39 stars 10 forks source link

`ota.status.status()` missing support for `nfs_keys` subtype #7

Open hasanen opened 3 weeks ago

hasanen commented 3 weeks ago

Hey

started to test this library as it looks useful and perfect for our use case.

In our partition table we have partition with subtype nvs_keys and this makes `ota.status.status() break

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ota/status.py", line 138, in status
  File "ota/status.py", line 84, in partition_table_print
KeyError: 4

I did some testing at it seems that changing following https://github.com/glenn20/micropython-esp32-ota/blob/3c87b425edee75e2ff4cfe77e096bfdc8ee3e25d/mip/ota/status.py#L75

to

{0: "ota", 1: "phy", 2: "nvs", 4: "nvs_keys", 129: "fat"},

Solves the issue.

I can do PR, but I'm not sure what is the build process of building corresponding .mpy file.

asherevan commented 5 days ago

From the micropython directory, you should be able to use this command (replacing FILENAME with the python file you would like to convert)

./tools/mpy-tool.py -f FILENAME

Let me know if that works!

glenn20 commented 4 days ago

Sorry for the slow response on this issue. I've been on holiday for the last 3 weeks. Your fix looks good, though it was not intended that the app crash on unidentified partition types. I'll fix that as well and post an update.