From fbf352eff4e71576ba51b2735c1820a453fcea4f Mon Sep 17 00:00:00 2001 From: Georges Oates_Larsen Date: Wed, 9 Oct 2024 12:20:40 -0700 Subject: [PATCH 1/3] net: wifi: Fix conn_mgr binding Fix missing conn_mgr binding for Wi-Fi/nrf700x. Signed-off-by: Georges Oates_Larsen --- samples/net/mqtt/overlay-tls-nrf70.conf | 4 ++++ subsys/net/l2_wifi_if_conn/Kconfig | 1 + subsys/net/l2_wifi_if_conn/l2_wifi_conn.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/samples/net/mqtt/overlay-tls-nrf70.conf b/samples/net/mqtt/overlay-tls-nrf70.conf index cf71b6084289..448f52a917b3 100644 --- a/samples/net/mqtt/overlay-tls-nrf70.conf +++ b/samples/net/mqtt/overlay-tls-nrf70.conf @@ -29,3 +29,7 @@ CONFIG_NET_SOCKETS_SOCKOPT_TLS=y # TLS credentials CONFIG_TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE=y + +# Temporarily disable Wi-Fi conn_mgr integration; +# Memory allocations required for it will be adjusted in a later commit +CONFIG_L2_WIFI_CONNECTIVITY=n diff --git a/subsys/net/l2_wifi_if_conn/Kconfig b/subsys/net/l2_wifi_if_conn/Kconfig index e6df76fae7a4..137e561c497f 100644 --- a/subsys/net/l2_wifi_if_conn/Kconfig +++ b/subsys/net/l2_wifi_if_conn/Kconfig @@ -6,6 +6,7 @@ menuconfig L2_WIFI_CONNECTIVITY bool "L2 Wi-Fi Connectivity" depends on NET_CONNECTION_MANAGER + select NET_CONNECTION_MANAGER_CONNECTIVITY_WIFI_MGMT if L2_WIFI_CONNECTIVITY diff --git a/subsys/net/l2_wifi_if_conn/l2_wifi_conn.c b/subsys/net/l2_wifi_if_conn/l2_wifi_conn.c index 7a1a722ca222..c04692dfe6c1 100644 --- a/subsys/net/l2_wifi_if_conn/l2_wifi_conn.c +++ b/subsys/net/l2_wifi_if_conn/l2_wifi_conn.c @@ -182,4 +182,4 @@ static struct conn_mgr_conn_api l2_wifi_conn_api = { .init = net_l2_wifi_init, }; -CONN_MGR_CONN_DEFINE(L2_CONN_WLAN0, &l2_wifi_conn_api); +CONN_MGR_CONN_DEFINE(CONNECTIVITY_WIFI_MGMT, &l2_wifi_conn_api); From ce5f6ed23d46e583a496eb591e7719663272481f Mon Sep 17 00:00:00 2001 From: Georges Oates_Larsen Date: Wed, 16 Oct 2024 17:45:33 -0700 Subject: [PATCH 2/3] samples: mss: Fix Wi-Fi connectivity Various tweaks to fix Multi Service Sample Wi-Fi connectivity builds. IRIS-9847 Signed-off-by: Georges Oates_Larsen --- .../overlay_nrf700x_wifi_coap_no_lte.conf | 11 ++++++----- .../overlay_nrf700x_wifi_mqtt_no_lte.conf | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf index de7af63c66f7..39318ea61cac 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_coap_no_lte.conf @@ -44,7 +44,7 @@ CONFIG_TFM_PARTITION_PROTECTED_STORAGE=y ## Configure TFM Profile. The NOT_SET profile will enable all features. ## We then reduce some settings to save flash and RAM. CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_CRYPTO_CONC_OPER_NUM=1 +CONFIG_TFM_CRYPTO_CONC_OPER_NUM=4 CONFIG_TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED=n ## Configure TFM partitions @@ -62,7 +62,7 @@ CONFIG_WIFI_CREDENTIALS_SHELL=y CONFIG_TLS_CREDENTIALS_SHELL=y CONFIG_TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE=y # Increased stack size needed for wifi_cred auto_connect command -CONFIG_SHELL_STACK_SIZE=4500 +CONFIG_SHELL_STACK_SIZE=4850 # nRFCloud credentials can exceed 1024 bytes CONFIG_TLS_CREDENTIALS_SHELL_CRED_BUF_SIZE=3072 # Needed by the TLS credentials shell @@ -103,7 +103,7 @@ CONFIG_WIFI_NRF70_SKIP_LOCAL_ADMIN_MAC=y ## Enable Wi-Fi conn_mgr bindings CONFIG_L2_WIFI_CONNECTIVITY=y -CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=4096 +CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=4850 ## Enable WIFI_MGMT_EXT and WIFI_CREDENTIALS for simplified Wi-Fi connection setup CONFIG_WIFI_CREDENTIALS=y @@ -160,13 +160,13 @@ CONFIG_LOCATION_METHOD_WIFI=y CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=10 CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=10 # Add 256 bytes for each additional scanning result, assuming sane SSID lengths -CONFIG_HEAP_MEM_POOL_SIZE=138000 +CONFIG_HEAP_MEM_POOL_SIZE=153000 CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y ## Miscellaneous resource allocation tweaks needed to support Wi-Fi. CONFIG_MAIN_STACK_SIZE=2048 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 -CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=20 +CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=30 CONFIG_APPLICATION_THREAD_STACK_SIZE=3072 CONFIG_MESSAGE_THREAD_STACK_SIZE=3072 CONFIG_CONNECTION_THREAD_STACK_SIZE=4500 @@ -175,6 +175,7 @@ CONFIG_NET_TX_STACK_SIZE=2048 CONFIG_NET_RX_STACK_SIZE=2048 CONFIG_ZVFS_OPEN_MAX=16 CONFIG_NET_SOCKETS_POLL_MAX=8 +CONFIG_NET_MGMT_EVENT_STACK_SIZE=3700 # nRF Cloud: CoAP CONFIG_NRF_CLOUD_MQTT=n diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf index 5336af8c40ae..51d100f7e4ee 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_nrf700x_wifi_mqtt_no_lte.conf @@ -43,7 +43,7 @@ CONFIG_TFM_PARTITION_PROTECTED_STORAGE=y ## Configure TFM Profile. The NOT_SET profile will enable all features. ## We then reduce some settings to save flash and RAM. CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_CRYPTO_CONC_OPER_NUM=1 +CONFIG_TFM_CRYPTO_CONC_OPER_NUM=4 CONFIG_TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED=n ## Configure TFM partitions @@ -61,7 +61,7 @@ CONFIG_WIFI_CREDENTIALS_SHELL=y CONFIG_TLS_CREDENTIALS_SHELL=y CONFIG_TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE=y # Increased stack size needed for wifi_cred auto_connect command -CONFIG_SHELL_STACK_SIZE=4500 +CONFIG_SHELL_STACK_SIZE=4850 # nRFCloud credentials can exceed 1024 bytes CONFIG_TLS_CREDENTIALS_SHELL_CRED_BUF_SIZE=2048 # Needed by the TLS credentials shell @@ -102,7 +102,7 @@ CONFIG_WIFI_NRF70_SKIP_LOCAL_ADMIN_MAC=y ## Enable Wi-Fi conn_mgr bindings CONFIG_L2_WIFI_CONNECTIVITY=y -CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=4096 +CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=4850 ## Enable WIFI_MGMT_EXT and WIFI_CREDENTIALS for simplified Wi-Fi connection setup CONFIG_WIFI_CREDENTIALS=y @@ -158,7 +158,7 @@ CONFIG_LOCATION_METHOD_WIFI=y CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=10 CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=10 # Add 256 bytes for each additional scanning result, assuming sane SSID lengths -CONFIG_HEAP_MEM_POOL_SIZE=136000 +CONFIG_HEAP_MEM_POOL_SIZE=153000 CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y ## Miscellaneous resource allocation tweaks needed to support Wi-Fi. @@ -173,3 +173,5 @@ CONFIG_NET_TX_STACK_SIZE=2048 CONFIG_NET_RX_STACK_SIZE=2048 CONFIG_ZVFS_OPEN_MAX=16 CONFIG_NET_SOCKETS_POLL_MAX=8 +CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=30 +CONFIG_NET_MGMT_EVENT_STACK_SIZE=3700 From 243b912b1e68e20958c3aa346a84dd06ff1e00db Mon Sep 17 00:00:00 2001 From: Georges Oates_Larsen Date: Tue, 22 Oct 2024 16:58:15 -0700 Subject: [PATCH 3/3] samples: mss: Minor Tweaks A bugfix for PGPS on certain CoAP configurations, and a tweak to nrf_cloud library info logs. Signed-off-by: Georges Oates_Larsen --- samples/cellular/nrf_cloud_multi_service/overlay_coap.conf | 1 + subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf b/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf index cda456fa5991..2954beb3748c 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_coap.conf @@ -46,6 +46,7 @@ CONFIG_NET_SOCKETS_OFFLOAD_PRIORITY=40 CONFIG_COAP_CLIENT_BLOCK_SIZE=1024 CONFIG_COAP_CLIENT_STACK_SIZE=2048 CONFIG_COAP_CLIENT_THREAD_PRIORITY=0 +CONFIG_COAP_CLIENT_MAX_INSTANCES=3 # The extended options length must be increased to perform FOTA and P-GPS downloads over CoAP. CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=192 diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c index a2dffec55698..9c8a81294329 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_info.c @@ -146,11 +146,10 @@ int nrf_cloud_print_details(void) LOG_INF("Protocol: %s", protocol); LOG_INF("Download protocol: %s", download_protocol); LOG_INF("Sec tag: %d", nrf_cloud_sec_tag_get()); - LOG_INF("Host name: %s", host_name); - #if defined(CONFIG_NRF_CLOUD_COAP) - LOG_INF("-CoAP JWT: %d", nrf_cloud_sec_tag_coap_jwt_get()); + LOG_INF("CoAP JWT Sec tag: %d", nrf_cloud_sec_tag_coap_jwt_get()); #endif + LOG_INF("Host name: %s", host_name); #endif /* CONFIG_NRF_CLOUD_VERBOSE_DETAILS */