-
Notifications
You must be signed in to change notification settings - Fork 162
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
OTA over HTTPS (MEGH-6086) #339
base: master
Are you sure you want to change the base?
Conversation
… report functions for default OTA callback
- for checking if OTA validation is pending - for erasing OTA rollback flag from NVS
ESP_ERROR_CHECK(wifi_init_connect()); | ||
|
||
// Needs to be done after WiFi is connected. | ||
esp_rmaker_ota_https_enable(NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does https_enable needs to be done after Wi-Fi is connected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires internet connection for validating the OTA firmware. (see here)
|
||
/* Actual url will be 59 bytes. */ | ||
char ota_report_url[64]; | ||
snprintf(ota_report_url, 64, "%s/%s", NODE_API_ENDPOINT_BASE, NODE_API_ENDPOINT_SUFFIX_REPORT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You pre-calculate the required size for ota_report_url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required size remains the same everytime(as URL does not change) - 59 characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Please add a define for this.
@@ -83,6 +103,8 @@ typedef struct { | |||
char *priv; | |||
/** OTA Metadata. Applicable only for OTA using Topics. Will be received (if applicable) from the backend, along with the OTA URL */ | |||
char *metadata; | |||
/** The Function to be called for reporting OTA status. This can be used if needed to override transport of OTA*/ | |||
esp_rmaker_ota_report_fn_t report_fn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change if I'm not mistaken. Please, increase the component version and update in the dependencies accordingly.
Please add a line in the CHANGES.md as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the changelog.
I'm not familiar with versioning scheme for esp-rainmaker, can you suggest version to increment the component to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do increase the minor version in idf_component.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shreyash-b regarding #339 (comment) please increase the esp-rainmaker's compont minor version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I'm incorporating suggestions as additional commits, will squash/rebase once everything looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few other minor comments. LGTM.
Now it should be good |
Description
Checklist
Before submitting a Pull Request, please ensure the following: