|
SimpleOTA client v1.1.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
|
One lifecycle event, valid only during the event_cb call. More...
#include <simpleota.h>
Data Fields | |
| simpleota_event_id_t | id |
| What happened. | |
| const char * | reason |
| A reason token (e.g. | |
| uint32_t | build_number |
| The build the event is about, 0 when none. | |
| size_t | bytes_done |
| DOWNLOAD_PROGRESS only. | |
| size_t | bytes_total |
| DOWNLOAD_PROGRESS, and UPDATE_AVAILABLE (the offer's size); 0 when unknown. | |
One lifecycle event, valid only during the event_cb call.
reason for SIMPLEOTA_EVENT_UPDATE_FAILED, which the dashboard shows too:
downgrade_refused: the offered build is not above the running one.insecure_url: the download URL is not https://.signature_invalid: a required signature is missing or wrong.https_begin_failed: the download connection could not be opened.http_status_<N>: the download returned HTTP N, or a fourth redirect.redirect_not_https, redirect_malformed: a download redirect led to plain HTTP, or had no usable Location.update_begin_failed: no second OTA slot, or the image is too big.image_mismatch: the download's first bytes are not a firmware image for this chip; nothing was written. Since API 1.1.update_write_failed: a flash write failed.stream_error, download_stalled, short_read: the download broke, stopped sending (reported one to two CONFIG_SIMPLEOTA_HTTP_TIMEOUT_MS after its last byte), or was not the offer's size (without one, its Content-Length).checksum_mismatch: the download did not match its SHA-256.update_end_failed: the image failed ESP-IDF's check, or the boot slot could not be switched.state_save_failed: the trial record could not be saved.reason for SIMPLEOTA_EVENT_ROLLING_BACK: confirm_timeout, or the reset that ended the trial: panic, int_wdt, task_wdt, watchdog, brownout, power_on, deep_sleep or reset.
For SIMPLEOTA_EVENT_CHECK_DONE it is the server's status, such as up_to_date, which the platform defines.
| const char* simpleota_event_t::reason |
A reason token (e.g.
"checksum_mismatch"), the server's status for CHECK_DONE, or NULL.