Configuration options for an MQTT connection
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.
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 mesages (with QoS1 or higher) that were published while the client was offline.
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
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 timeout.
Password to connect with
Server port to connect to
Optional proxy options
Optional socket options
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:
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.
TLS context for secure socket connections. If None is provided, then an unencrypted connection is used.
If true, connect to MQTT over websockets
Username to connect with
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.
Will to send with CONNECT packet. The will is published by the server when its connection to the client is unexpectedly lost.
Generated using TypeDoc