|
| 1 | +# |
| 2 | +# Copyright (c) 2025 Nordic Semiconductor |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause |
| 5 | +# |
| 6 | + |
| 7 | +menuconfig APP_CLOUD_MQTT |
| 8 | + bool "Cloud module" |
| 9 | + depends on MQTT_HELPER |
| 10 | + depends on HW_ID_LIBRARY |
| 11 | + |
| 12 | +if APP_CLOUD_MQTT |
| 13 | + |
| 14 | +config APP_CLOUD_MQTT_SEC_TAG |
| 15 | + int "MQTT security tag" |
| 16 | + default 888 |
| 17 | + help |
| 18 | + Security tag used to store the MQTT credentials in the modem using Modem Key Management API |
| 19 | + |
| 20 | +config APP_CLOUD_MQTT_SHELL |
| 21 | + bool "Enable cloud shell" |
| 22 | + default y if SHELL |
| 23 | + help |
| 24 | + Enable cloud shell commands. |
| 25 | + |
| 26 | +config APP_CLOUD_PAYLOAD_BUFFER_MAX_SIZE |
| 27 | + int "Payload maximum buffer size" |
| 28 | + default 128 |
| 29 | + help |
| 30 | + Maximum size of the buffer sent over the payload channel when sending RAW JSON messages |
| 31 | + to the cloud. |
| 32 | + |
| 33 | +config APP_CLOUD_SHADOW_RESPONSE_BUFFER_MAX_SIZE |
| 34 | + int "Payload maximum buffer size" |
| 35 | + default 512 |
| 36 | + help |
| 37 | + Maximum size of the buffer used to receive shadow responses from the cloud. |
| 38 | + |
| 39 | +config APP_CLOUD_BACKOFF_INITIAL_SECONDS |
| 40 | + int "Reconnection backoff time in seconds" |
| 41 | + default 60 |
| 42 | + help |
| 43 | + Time in between reconnection attempts to the MQTT server. |
| 44 | + The timer starts after the last failed attempt. |
| 45 | + |
| 46 | +choice APP_CLOUD_BACKOFF_TYPE |
| 47 | + prompt "Reconnection backoff type" |
| 48 | + default APP_CLOUD_BACKOFF_TYPE_LINEAR |
| 49 | + |
| 50 | +config APP_CLOUD_BACKOFF_TYPE_EXPONENTIAL |
| 51 | + bool "Exponential backoff" |
| 52 | + help |
| 53 | + Exponential backoff doubles the reconnection timeout after each failed attempt. |
| 54 | + The maximum reconnection timeout is defined by APP_CLOUD_BACKOFF_MAX_SECONDS. |
| 55 | + |
| 56 | +config APP_CLOUD_BACKOFF_TYPE_LINEAR |
| 57 | + bool "Linear backoff" |
| 58 | + help |
| 59 | + Linear backoff adds a fixed amount of time to the reconnection timeout after each failed attempt, |
| 60 | + as defined by APP_CLOUD_BACKOFF_LINEAR_INCREMENT_SECONDS. |
| 61 | + |
| 62 | +config APP_CLOUD_BACKOFF_TYPE_NONE |
| 63 | + bool "No backoff" |
| 64 | + help |
| 65 | + No backoff means that the reconnection timeout is constant at the value defined by |
| 66 | + APP_CLOUD_BACKOFF_INITIAL_SECONDS. |
| 67 | + |
| 68 | +endchoice |
| 69 | + |
| 70 | +config APP_CLOUD_BACKOFF_LINEAR_INCREMENT_SECONDS |
| 71 | + int "Reconnection backoff time increment" |
| 72 | + default 60 |
| 73 | + help |
| 74 | + Time added to the reconnection timeout after each failed attempt in seconds. |
| 75 | + The maximum reconnection timeout is defined by APP_CLOUD_BACKOFF_MAX_SECONDS. |
| 76 | + |
| 77 | +config APP_CLOUD_BACKOFF_MAX_SECONDS |
| 78 | + int "Maximum reconnection timeout" |
| 79 | + default 3600 |
| 80 | + help |
| 81 | + Maximum reconnection backoff value in seconds. |
| 82 | + |
| 83 | +config APP_CLOUD_THREAD_STACK_SIZE |
| 84 | + int "Thread stack size" |
| 85 | + default 3328 |
| 86 | + |
| 87 | +config APP_CLOUD_MESSAGE_QUEUE_SIZE |
| 88 | + int "Message queue size" |
| 89 | + default 5 |
| 90 | + help |
| 91 | + ZBus subscriber message queue size. |
| 92 | + |
| 93 | +config APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS |
| 94 | + int "Watchdog timeout" |
| 95 | + default 180 |
| 96 | + help |
| 97 | + Timeout in seconds for the cloud module watchdog. |
| 98 | + The timeout given in this option covers both: |
| 99 | + * Waiting for an incoming message in zbus_sub_wait_msg(). |
| 100 | + * Time spent processing the message, defined by |
| 101 | + CONFIG_APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS. |
| 102 | + Ensure that this value exceeds CONFIG_APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS. |
| 103 | + A small difference between the two can mean more frequent watchdog feeds, which increases |
| 104 | + power consumption. |
| 105 | + |
| 106 | + |
| 107 | +config APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS |
| 108 | + int "Maximum message processing time" |
| 109 | + default 120 |
| 110 | + help |
| 111 | + Maximum time allowed for processing a single message in the module's state machine. |
| 112 | + The value must be smaller than CONFIG_APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS. |
| 113 | + |
| 114 | +module = APP_CLOUD_MQTT |
| 115 | +module-str = Cloud MQTT |
| 116 | +source "subsys/logging/Kconfig.template.log_config" |
| 117 | + |
| 118 | +endif # APP_CLOUD_MQTT |
0 commit comments