-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve nRF Cloud library and sample user experience #17635
base: main
Are you sure you want to change the base?
Conversation
In modem_key_mgmt_read(), if *len parameter is too small to fit the certificate read, return -ENOMEM and set *len to the size needed. This is helpful to check the size of a certificate without actually needing the contents. Signed-off-by: Pete Skeggs <[email protected]>
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: a4eb03c19e54c97ebab74d4d6d693def4ceee205 more detailssdk-nrf:
Github labels
List of changed files detected by CI (14)
Outputs:ToolchainVersion: 9583beca34 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
@@ -493,7 +493,7 @@ int nrf_provisioning_schedule(void) | |||
/* To even the load on server side */ | |||
retry_s += spread_s; | |||
|
|||
LOG_DBG("Connecting in %llds", retry_s); | |||
LOG_INF("Checking for provisioning commands in %llds seconds", retry_s); |
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.
LOG_INF("Checking for provisioning commands in %llds seconds", retry_s); | |
LOG_DBG("Checking for provisioning commands in %llds seconds", retry_s); |
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.
Read the ticket
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 prefer this as INF
@@ -319,7 +319,7 @@ void nrf_cloud_log_enable(bool enable) | |||
logs_backend_enable(enable); | |||
#endif | |||
enabled = enable; | |||
LOG_DBG("enabled = %d", enabled); | |||
LOG_INF("Changing cloud logging enabled to:%d", enabled); |
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.
LOG_INF("Changing cloud logging enabled to:%d", enabled); | |
LOG_DBG("Changing cloud logging enabled to:%d", enabled); |
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 only logged when the user changes the level compared to what the firmware was built for. This will rarely be logged and is not an issue to be INF. It will improve the user experience so they can see that a change they requested actually happened, especially for our samples. Same for alerts.
@@ -305,7 +305,7 @@ int nrf_cloud_log_control_get(void) | |||
void nrf_cloud_log_level_set(int level) | |||
{ | |||
if (nrf_cloud_log_level != level) { | |||
LOG_DBG("Changing log level from:%d to:%d", nrf_cloud_log_level, level); | |||
LOG_INF("Changing cloud log level from:%d to:%d", nrf_cloud_log_level, level); |
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.
LOG_INF("Changing cloud log level from:%d to:%d", nrf_cloud_log_level, level); | |
LOG_DBG("Changing cloud log level from:%d to:%d", nrf_cloud_log_level, level); |
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.
instead of making the logs INF, i would prefer to add a new log module control: CONFIG_NRF_CLOUD_CREDENTIALS_LOG_LEVEL
and if you want extra logs in the sample, set the new control to DBG.
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.
same for the nrf_cloud_alert and nrf_cloud_log files
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.
request for changes mainly applies to the changes to MSS
samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c
Outdated
Show resolved
Hide resolved
@@ -493,7 +493,7 @@ int nrf_provisioning_schedule(void) | |||
/* To even the load on server side */ | |||
retry_s += spread_s; | |||
|
|||
LOG_DBG("Connecting in %llds", retry_s); | |||
LOG_INF("Checking for provisioning commands in %llds seconds", retry_s); |
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 prefer this as INF
Add two new Kconfig symbols to define thresholds for approximate size of the CoAP root CA and the size of combined CoAP + AWS root CAs. Retrieve size of configured sec_tag's root CA. Compare the size to the thresholds, display which root CA(s) are likely present, and use this to judge whether a cloud connection will likely succeed. If connection seems possible, proceed with connection as before. Jira: IRIS-9151 Signed-off-by: Pete Skeggs <[email protected]>
Indicate the units of time as well as the purpose for reconnecting. Log at the INF level. See ticket for reasoning. Jira: IRIS-9151 Signed-off-by: Pete Skeggs <[email protected]>
When the cloud (through the shadow) requests a change in the cloud-based logging level or the alert enable/disable flag, log at the INF level so it is always easy to see that the request was effective. See ticket for reasoning. Jira: IRIS-9151 Signed-off-by: Pete Skeggs <[email protected]>
Once device has connected to the cloud, slow down the provisioning check. Improve logging of shadow and FOTA polling intervals for CoAP. Make CoAP shadow and FOTA check intervals the same as the sensor update interval. Jira: IRIS-9151 Signed-off-by: Pete Skeggs <[email protected]>
Document changes. Signed-off-by: Pete Skeggs <[email protected]>
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
Outdated
Show resolved
Hide resolved
/* These flags are approximate and only useful for logging to help diagnose | ||
* possible provisioning mistakes. | ||
*/ | ||
cs->ca_combined = (cs->ca_size > CONFIG_NRF_CLOUD_COMBINED_CA_CERT_SIZE_THRESHOLD); |
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.
can the combined flag be removed?
if both coap and aws flags are set then that indicates it is combined.
if (size > combined_min) {
coap = 1
aws = 1
} else if (size <= coap_max) {
coap = 1
aws = 0
} else if (size > coap_max) {
coap = 0
aws = 1
}
if (!cs.ca_combined && !cs.ca_aws && cs.ca_coap) { | ||
/* There is a CA, but not large enough to be correct */ | ||
LOG_ERR("Cannot connect using MQTT or REST; " | ||
"AWS root CA certificate is missing but CoAP root CA is present."); |
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.
similar to the other "likely" log message change, maybe this should be something like:
LOG_WRN("Connection using MQTT or REST may fail as the size of the CA cert indicates it is a CoAP root CA");
same for below.
Co-authored-by: Pekka Niskanen <[email protected]> Co-authored-by: Justin Morton <[email protected]>
Per IRIS-9151, add detection of which root CA certs are likely to be present, and gate the connection
to the cloud based on what is required for the current connection type (CoAP, MQTT, or REST).
Indicate the FOTA, shadow, and provisioning update intervals more clearly and at INF levels.
Indicate when cloud logging level or alerts are changed by request of the cloud at the INF level.
Slow down provisioning check once the device connects to the cloud.
Jira: IRIS-9151