A generic MQTT I/O sketch