glenn20 / micropython-esp32-ota

MIT License
34 stars 5 forks source link

OSError: [Errno 2] ENOENT #6

Closed fwebcc closed 1 month ago

fwebcc commented 2 months ago

import ota.status ota.status.status() Micropython v1.20.0 has booted from partition 'factory'. E (113010) esp_ota_ops: not found otadata Traceback (most recent call last): File "", line 1, in File "ota/status.py", line 117, in status File "ota/status.py", line 48, in boot_ota OSError: [Errno 2] ENOENT

glenn20 commented 1 month ago

Thanks for the bug report.

It would appear this is triggered by the fact micropython-esp32-ota is installed on a device which is not OTA-enabled. There is no otadata partition and the device is booting from the factory partition instead of the ota_0 or ota_1 partition. Also, note that the micropython version is pre-v1.21 (when OTA rollback support was included in all micropython builds).

While micropython-esp32-ota is not intended to be installed on such devices, it should behave more gracefully than this. I will investigate and post an update.

glenn20 commented 1 month ago

I have pushed an update (version 0.3) which prevents the exception if called on a firmware which does not provide OTA support. I will close the ticket, but if you continue to see the issue, feel free to reopen, or to post further comments.