ID to place in CONNECT packet. Must be unique across all devices/clients. If an ID is already in use, the other client will be disconnected.
Server name to connect to
Server port to connect to
Socket options
Optional
use_If true, connect to MQTT over websockets
Optional
clean_Whether or not to start a clean session with each reconnect.
If True, the server will forget all subscriptions with each reconnect.
Set False to request that the server resume an existing session
or start a new session that may be resumed after a connection loss.
The session_present
bool in the connection callback informs
whether an existing session was successfully resumed.
If an existing session is resumed, the server remembers previous subscriptions
and sends messages (with QoS1 or higher) that were published while the client was offline.
Optional
keep_The keep alive value, in seconds, to send in CONNECT packet. A PING will automatically be sent at this interval. The server will assume the connection is lost if no PING is received after 1.5X this value. This duration must be longer than ping_timeout.
Optional
ping_Milliseconds to wait for ping response before client assumes
the connection is invalid and attempts to reconnect.
This duration must be shorter than keep_alive_secs.
Alternatively, TCP keep-alive via :attr:SocketOptions.keep_alive
may accomplish this in a more efficient (low-power) scenario,
but keep-alive options may not work the same way on every platform and OS version.
Optional
protocol_Milliseconds to wait for the response to the operation requires response by protocol. Set to zero to disable timeout. Otherwise, the operation will fail if no response is received within this amount of time after the packet is written to the socket. It applied to PUBLISH (QoS>0) and UNSUBSCRIBE now.
Optional
reconnect_Minimum seconds to wait between reconnect attempts. Must be <= reconnect_max_sec. Wait starts at min and doubles with each attempt until max is reached.
Optional
reconnect_Maximum seconds to wait between reconnect attempts. Must be >= reconnect_min_sec. Wait starts at min and doubles with each attempt until max is reached.
Optional
willWill to send with CONNECT packet. The will is published by the server when its connection to the client is unexpectedly lost.
Optional
usernameUsername to connect with
Optional
passwordPassword to connect with
Optional
tls_TLS context for secure socket connections. If None is provided, then an unencrypted connection is used.
Optional
proxy_Optional proxy options
Optional
websocket_Optional function to transform websocket handshake request. If provided, function is called each time a websocket connection is attempted. The function may modify the HTTP request before it is sent to the server.
Optional
error_code: numberGenerated using TypeDoc
Configuration options for an MQTT connection