|
| 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_HOSTNAME |
| 15 | + string "MQTT broker hostname" |
| 16 | + default "mqtt.nordicsemi.academy" |
| 17 | + help |
| 18 | + Hostname of the MQTT broker to connect to. |
| 19 | + |
| 20 | +config APP_CLOD_MQTT_TOPIC_SIZE_MAX |
| 21 | + int "MQTT topic size" |
| 22 | + default 64 |
| 23 | + help |
| 24 | + Maximum size of the MQTT topics used for publishing and subscribing to messages. |
| 25 | + |
| 26 | +config APP_CLOUD_MQTT_PUB_TOPIC |
| 27 | + string "MQTT publish topic" |
| 28 | + default "att-pub-topic" |
| 29 | + help |
| 30 | + Topic used for publishing messages to the MQTT broker. |
| 31 | + |
| 32 | +config APP_CLOUD_MQTT_SUB_TOPIC |
| 33 | + string "MQTT subscribe topic" |
| 34 | + default "att-sub-topic" |
| 35 | + help |
| 36 | + Topic used for subscribing to messages from the MQTT broker. |
| 37 | + |
| 38 | +config APP_CLOUD_MQTT_SEC_TAG |
| 39 | + int "MQTT security tag" |
| 40 | + default 888 |
| 41 | + help |
| 42 | + Security tag used to store the MQTT credentials in the modem using Modem Key Management API |
| 43 | + |
| 44 | +config APP_CLOUD_MQTT_SHELL |
| 45 | + bool "Enable cloud shell" |
| 46 | + default y if SHELL |
| 47 | + help |
| 48 | + Enable cloud shell commands. |
| 49 | + |
| 50 | +config APP_CLOUD_PAYLOAD_BUFFER_MAX_SIZE |
| 51 | + int "Payload maximum buffer size" |
| 52 | + default 128 |
| 53 | + help |
| 54 | + Maximum size of the buffer sent over the payload channel when sending RAW JSON messages |
| 55 | + to the cloud. |
| 56 | + |
| 57 | +config APP_CLOUD_SHADOW_RESPONSE_BUFFER_MAX_SIZE |
| 58 | + int "Payload maximum buffer size" |
| 59 | + default 512 |
| 60 | + help |
| 61 | + Maximum size of the buffer used to receive shadow responses from the cloud. |
| 62 | + |
| 63 | +config APP_CLOUD_BACKOFF_INITIAL_SECONDS |
| 64 | + int "Reconnection backoff time in seconds" |
| 65 | + default 60 |
| 66 | + help |
| 67 | + Time in between reconnection attempts to the MQTT server. |
| 68 | + The timer starts after the last failed attempt. |
| 69 | + |
| 70 | +choice APP_CLOUD_BACKOFF_TYPE |
| 71 | + prompt "Reconnection backoff type" |
| 72 | + default APP_CLOUD_BACKOFF_TYPE_LINEAR |
| 73 | + |
| 74 | +config APP_CLOUD_BACKOFF_TYPE_EXPONENTIAL |
| 75 | + bool "Exponential backoff" |
| 76 | + help |
| 77 | + Exponential backoff doubles the reconnection timeout after each failed attempt. |
| 78 | + The maximum reconnection timeout is defined by APP_CLOUD_BACKOFF_MAX_SECONDS. |
| 79 | + |
| 80 | +config APP_CLOUD_BACKOFF_TYPE_LINEAR |
| 81 | + bool "Linear backoff" |
| 82 | + help |
| 83 | + Linear backoff adds a fixed amount of time to the reconnection timeout after each failed attempt, |
| 84 | + as defined by APP_CLOUD_BACKOFF_LINEAR_INCREMENT_SECONDS. |
| 85 | + |
| 86 | +config APP_CLOUD_BACKOFF_TYPE_NONE |
| 87 | + bool "No backoff" |
| 88 | + help |
| 89 | + No backoff means that the reconnection timeout is constant at the value defined by |
| 90 | + APP_CLOUD_BACKOFF_INITIAL_SECONDS. |
| 91 | + |
| 92 | +endchoice |
| 93 | + |
| 94 | +config APP_CLOUD_BACKOFF_LINEAR_INCREMENT_SECONDS |
| 95 | + int "Reconnection backoff time increment" |
| 96 | + default 60 |
| 97 | + help |
| 98 | + Time added to the reconnection timeout after each failed attempt in seconds. |
| 99 | + The maximum reconnection timeout is defined by APP_CLOUD_BACKOFF_MAX_SECONDS. |
| 100 | + |
| 101 | +config APP_CLOUD_BACKOFF_MAX_SECONDS |
| 102 | + int "Maximum reconnection timeout" |
| 103 | + default 3600 |
| 104 | + help |
| 105 | + Maximum reconnection backoff value in seconds. |
| 106 | + |
| 107 | +config APP_CLOUD_THREAD_STACK_SIZE |
| 108 | + int "Thread stack size" |
| 109 | + default 3328 |
| 110 | + |
| 111 | +config APP_CLOUD_MESSAGE_QUEUE_SIZE |
| 112 | + int "Message queue size" |
| 113 | + default 5 |
| 114 | + help |
| 115 | + ZBus subscriber message queue size. |
| 116 | + |
| 117 | +config APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS |
| 118 | + int "Watchdog timeout" |
| 119 | + default 180 |
| 120 | + help |
| 121 | + Timeout in seconds for the cloud module watchdog. |
| 122 | + The timeout given in this option covers both: |
| 123 | + * Waiting for an incoming message in zbus_sub_wait_msg(). |
| 124 | + * Time spent processing the message, defined by |
| 125 | + CONFIG_APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS. |
| 126 | + Ensure that this value exceeds CONFIG_APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS. |
| 127 | + A small difference between the two can mean more frequent watchdog feeds, which increases |
| 128 | + power consumption. |
| 129 | + |
| 130 | + |
| 131 | +config APP_CLOUD_MSG_PROCESSING_TIMEOUT_SECONDS |
| 132 | + int "Maximum message processing time" |
| 133 | + default 120 |
| 134 | + help |
| 135 | + Maximum time allowed for processing a single message in the module's state machine. |
| 136 | + The value must be smaller than CONFIG_APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS. |
| 137 | + |
| 138 | +module = APP_CLOUD_MQTT |
| 139 | +module-str = Cloud MQTT |
| 140 | +source "subsys/logging/Kconfig.template.log_config" |
| 141 | + |
| 142 | +endif # APP_CLOUD_MQTT |
0 commit comments