pylab_ml.common.mqtt_client.mqtt_init

class mqtt_init(*args, **kwargs)[source]

Bases: object

Initialise the mqtt connection and provide functions for the communication.

__init__(typ='control', logger=None)[source]

Initialise the class mqtt_init.

typ = ‘instrument’ for instruments

= ‘control’ for guis or extern controlling (default)

Methods

__init__([typ, logger])

Initialise the class mqtt_init.

clearpublish(attr)

Remove retained publish message from broker.

close()

Disconnect from broker.

init([broker, port, message_client, ...])

Normally call from plugin semi-control, you have not to call this function, if you use semi-control.

mqtt_add(instrument[, hostname])

Add first callback to get mqtt-commands from control, and append instrument to instruments-list.

mqtt_disconnect([instrument, hostname])

Remove instrument from the instruments-list, if instruments-list is empty than remove callback.

mqtt_receive(topic, msg)

publish(attr, value[, qos, retain])

Send message to broker.

clearpublish(attr)[source]

Remove retained publish message from broker.

close()[source]

Disconnect from broker.

init(broker='127.0.0.1', port=1883, message_client=None, username='', userpasswd='', qos=0, retain=False)[source]

Normally call from plugin semi-control, you have not to call this function, if you use semi-control.

message_client = None if client the instrument, like e.q. smu, digital-multimeter or thermostreamer.

= e.q. ‘DT1604092’ if control and you want connect from an extern computer to DT1604092 (but is not checked until now!!)

mqtt_add(instrument, hostname=None)[source]

Add first callback to get mqtt-commands from control, and append instrument to instruments-list.

Returns:

None.

mqtt_disconnect(instrument=None, hostname=None)[source]

Remove instrument from the instruments-list, if instruments-list is empty than remove callback.

Returns:

None.

publish(attr, value, qos=None, retain=None)[source]

Send message to broker.