mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-28 21:48:05 +08:00
260 lines
6.8 KiB
Plaintext
260 lines
6.8 KiB
Plaintext
menu "MQTT"
|
|
|
|
choice MQTT_LIBRARY_CHOOSE
|
|
prompt "Choose MQTT library"
|
|
default MQTT_USING_IBM
|
|
help
|
|
Choose the MQTT library which you want to use.
|
|
|
|
Currently we support ESP-MQTT and IBM-MQTT(paho).
|
|
|
|
config MQTT_USING_ESP
|
|
bool "ESP-MQTT(Recommended)"
|
|
config MQTT_USING_IBM
|
|
bool "IBM-MQTT(not recommended and will be removed at v4.0)"
|
|
endchoice
|
|
|
|
menu "IBM-MQTT(paho)"
|
|
depends on MQTT_USING_IBM
|
|
|
|
choice MQTT_VERSION
|
|
prompt "MQTT version"
|
|
default V3_1
|
|
help
|
|
Current supported MQTT version.
|
|
|
|
config V3_1
|
|
bool "V3.1"
|
|
config V3_1_1
|
|
bool "V3.1.1"
|
|
endchoice
|
|
|
|
config DEFAULT_MQTT_VERSION
|
|
int
|
|
default 3 if V3_1
|
|
default 4 if V3_1_1
|
|
|
|
config MQTT_CLIENT_ID
|
|
string "MQTT client ID"
|
|
default "espressif_sample"
|
|
help
|
|
MQTT client ID for MQTT broker to identify ESP device.
|
|
|
|
config MQTT_KEEP_ALIVE
|
|
int "MQTT keep-alive(seconds)"
|
|
default 30
|
|
help
|
|
MQTT keep alive interval, Recommended value: 30s - 60s.
|
|
The last MQTT packet timestamp will be recorded,
|
|
a PING request will be sent if (current_timestamp - last_mqtt_packet_timestamp) > MQTT_KEEP_ALIVE.
|
|
|
|
config MQTT_USERNAME
|
|
string "MQTT username"
|
|
default "espressif"
|
|
help
|
|
Username used for logging to MQTT broker.
|
|
Generally, you should use a valid MQTT_USERNAME if MQTT broker does not allow an anonymous login.
|
|
|
|
config MQTT_PASSWORD
|
|
string "MQTT password"
|
|
default "admin"
|
|
help
|
|
Password used for logging to MQTT broker.
|
|
Generally, you should use a valid MQTT_PASSWORD if MQTT broker does not allow an anonymous login.
|
|
|
|
choice MQTT_SESSION
|
|
prompt "MQTT Session"
|
|
default CLEAN_SESSION
|
|
help
|
|
Clean session to start a new session.
|
|
If clean-seesion is set, it will discard any previous session and start a new one.
|
|
If keep-session is set, it will store session state and the communication can resume.
|
|
|
|
config CLEAN_SESSION
|
|
bool "Clean Session"
|
|
config KEEP_SESSION
|
|
bool "Keep Session"
|
|
endchoice
|
|
|
|
config DEFAULT_MQTT_SESSION
|
|
int
|
|
default 0 if KEEP_SESSION
|
|
default 1 if CLEAN_SESSION
|
|
|
|
choice MQTT_SECURITY
|
|
prompt "MQTT over TCP/SSL/TLS feature"
|
|
default NO_TLS
|
|
help
|
|
MQTT over TCP/SSL/TLS.
|
|
MQTT_SECURITY=0: MQTT over TCP
|
|
MQTT_SECURITY=1: MQTT over TLS with no verify
|
|
MQTT_SECURITY=2: MQTT over TLS with verify peer
|
|
MQTT_SECURITY=3: MQTT over TLS with verify client
|
|
|
|
config NO_TLS
|
|
bool "TCP"
|
|
config TLS_VERIFY_NONE
|
|
bool "TLS Verify None"
|
|
config TLS_VERIFY_PEER
|
|
bool "TLS Verify Peer"
|
|
config TLS_VERIFY_CLIENT
|
|
bool "TLS Verify Client"
|
|
endchoice
|
|
|
|
config DEFAULT_MQTT_SECURITY
|
|
int
|
|
default 0 if NO_TLS
|
|
default 1 if TLS_VERIFY_NONE
|
|
default 2 if TLS_VERIFY_PEER
|
|
default 3 if TLS_VERIFY_CLIENT
|
|
|
|
config MQTT_SEND_BUFFER
|
|
int "MQTT send buffer"
|
|
default 2048
|
|
help
|
|
Recommended value: 1460 - 2048.
|
|
Buffer used for sending MQTT messages, including MQTT header, MQTT topic, payload and etc.
|
|
|
|
config MQTT_RECV_BUFFER
|
|
int "MQTT recv buffer"
|
|
default 2048
|
|
help
|
|
Recommended value: 1460 - 2048.
|
|
Buffer used for receiving MQTT messages, including MQTT header, MQTT topic, payload and etc.
|
|
|
|
config MQTT_SEND_CYCLE
|
|
int "MQTT send cycle(ms)"
|
|
default 30000
|
|
help
|
|
Recommended value: 30000 - 60000.
|
|
MQTT send interval in every cycle.
|
|
A MQTT packet should be sent out in MQTT_SEND_CYCLE,
|
|
will block for MQTT_SEND_CYCLE if weak network, and return timeout.
|
|
|
|
config MQTT_RECV_CYCLE
|
|
int "MQTT recv cycle(ms)"
|
|
default 0
|
|
help
|
|
Recommended value: 0ms - 500ms.
|
|
MQTT receive interval in every cycle.
|
|
a MQTT packet should be received in MQTT_RECV_CYCLE,
|
|
will block for MQTT_RECV_CYCLE if weak network , and return timeout.
|
|
|
|
config MQTT_PING_TIMEOUT
|
|
int "MQTT ping timeout(ms)"
|
|
default 3000
|
|
help
|
|
Recommended value: 3000ms - 10000ms.
|
|
MQTT ping timeout.
|
|
When MQTT_KEEP_ALIVE expired, it will start sending ping request.
|
|
If the ESP device does not receive any ping response within MQTT_PING_TIMEOUT,
|
|
it will terminate the MQTT connection.
|
|
|
|
endmenu # IBM-MQTT(paho)
|
|
|
|
menu "ESP-MQTT"
|
|
depends on MQTT_USING_ESP
|
|
|
|
config MQTT_PROTOCOL_311
|
|
bool "Enable MQTT protocol 3.1.1"
|
|
default y
|
|
help
|
|
If not, this library will use MQTT protocol 3.1
|
|
|
|
config MQTT_TRANSPORT_SSL
|
|
bool "Enable MQTT over SSL"
|
|
default y
|
|
help
|
|
Enable MQTT transport over SSL with mbedtls
|
|
|
|
config MQTT_TRANSPORT_WEBSOCKET
|
|
bool "Enable MQTT over Websocket"
|
|
default y
|
|
help
|
|
Enable MQTT transport over Websocket.
|
|
|
|
config MQTT_TRANSPORT_WEBSOCKET_SECURE
|
|
bool "Enable MQTT over Websocket Secure"
|
|
default y
|
|
depends on MQTT_TRANSPORT_WEBSOCKET
|
|
depends on MQTT_TRANSPORT_SSL
|
|
help
|
|
Enable MQTT transport over Websocket Secure.
|
|
|
|
config MQTT_USE_CUSTOM_CONFIG
|
|
bool "MQTT Using custom configurations"
|
|
default n
|
|
help
|
|
Custom MQTT configurations.
|
|
|
|
config MQTT_TCP_DEFAULT_PORT
|
|
int "Default MQTT over TCP port"
|
|
default 1883
|
|
depends on MQTT_USE_CUSTOM_CONFIG
|
|
help
|
|
Default MQTT over TCP port
|
|
|
|
config MQTT_SSL_DEFAULT_PORT
|
|
int "Default MQTT over SSL port"
|
|
default 8883
|
|
depends on MQTT_USE_CUSTOM_CONFIG
|
|
depends on MQTT_TRANSPORT_SSL
|
|
help
|
|
Default MQTT over SSL port
|
|
|
|
config MQTT_WS_DEFAULT_PORT
|
|
int "Default MQTT over Websocket port"
|
|
default 80
|
|
depends on MQTT_USE_CUSTOM_CONFIG
|
|
depends on MQTT_TRANSPORT_WEBSOCKET
|
|
help
|
|
Default MQTT over Websocket port
|
|
|
|
config MQTT_WSS_DEFAULT_PORT
|
|
int "Default MQTT over Websocket Secure port"
|
|
default 443
|
|
depends on MQTT_USE_CUSTOM_CONFIG
|
|
depends on MQTT_TRANSPORT_WEBSOCKET
|
|
depends on MQTT_TRANSPORT_WEBSOCKET_SECURE
|
|
help
|
|
Default MQTT over Websocket Secure port
|
|
|
|
config MQTT_BUFFER_SIZE
|
|
int "Default MQTT Buffer Size"
|
|
default 1024
|
|
depends on MQTT_USE_CUSTOM_CONFIG
|
|
help
|
|
This buffer size using for both transmit and receive
|
|
|
|
config MQTT_TASK_STACK_SIZE
|
|
int "MQTT task stack size"
|
|
default 6144
|
|
depends on MQTT_USE_CUSTOM_CONFIG
|
|
help
|
|
MQTT task stack size
|
|
|
|
config MQTT_TASK_CORE_SELECTION_ENABLED
|
|
bool "Enable MQTT task core selection"
|
|
default false
|
|
help
|
|
This will enable core selection
|
|
|
|
choice MQTT_TASK_CORE_SELECTION
|
|
depends on MQTT_TASK_CORE_SELECTION_ENABLED
|
|
prompt "Core to use ?"
|
|
config MQTT_USE_CORE_0
|
|
bool "Core 0"
|
|
config MQTT_USE_CORE_1
|
|
bool "Core 1"
|
|
endchoice
|
|
|
|
config MQTT_CUSTOM_OUTBOX
|
|
bool "Enable custom outbox implementation"
|
|
default n
|
|
help
|
|
Set to true if a specific implementation of message outbox is needed (e.g. persistant outbox in NVM or similar).
|
|
|
|
endmenu # ESP-MQTT
|
|
|
|
endmenu
|