📦 Archived documentation: r1 (committed 2026-07-24) View current documentation →

mqtt.disconnect()

mqtt.disconnect()

Disconnects from the MQTT broker; call before the script exits.

Make sure the client is disconnected before the script exits.

Example

mqtt.disconnect();