(self, broker=None,
                                 port=1883,
                                 user=None,
                                 passwd=None,
                                 brokerFeedback='/roomba/feedback',
                                 brokerCommand='/roomba/command',
                                 brokerSetting='/roomba/setting')
return self.mqttc
setup local mqtt connection to broker for feedback,
        commands and settings
setup local mqtt connection to broker for feedback,
        commands and settings
setup local mqtt connection to broker for feedback commands and settings
def _setup_mqtt_client(self, broker=None,
                                 port=1883,
                                 user=None,
                                 passwd=None,
                                 brokerFeedback='/roomba/feedback',
                                 brokerCommand='/roomba/command',
                                 brokerSetting='/roomba/setting'):
        '''
        setup local mqtt connection to broker for feedback,
        commands and settings
        '''
        try:
            # connect to broker
            self.mqttc = mqtt.Client()
            # Assign event callbacks
            self.mqttc.on_message = self.broker_on_message
            self.mqttc.on_connect = self.broker_on_connect
            self.mqttc.on_disconnect = self.broker_on_disconnect
            if user and passwd:
                self.mqttc.username_pw_set(user, passwd)
            self.mqttc.connect(broker, port, 60)
            self.brokerFeedback = self.set_mqtt_topic(brokerFeedback)
            self.brokerCommand = self.set_mqtt_topic(brokerCommand, True)
            self.brokerSetting = self.set_mqtt_topic(brokerSetting, True)
            self.mqttc.loop_start()
            self.local_mqtt = True
        except socket.error:
            self.log.error("Unable to connect to MQTT Broker")
            self.mqttc = None
        return self.mqttc
def _setup_mqtt_client ( self , broker = None , port = 1883 , user = None , passwd = None , brokerFeedback = '/roomba/feedback' , brokerCommand = '/roomba/command' , brokerSetting = '/roomba/setting' ) : try : # connect to broker self . mqttc = mqtt . Client ( ) # Assign event callbacks self . mqttc . on_message = self . broker_on_message self . mqttc . on_connect = self . broker_on_connect self . mqttc . on_disconnect = self . broker_on_disconnect if user and passwd : self . mqttc . username_pw_set ( user , passwd ) self . mqttc . connect ( broker , port , 60 ) self . brokerFeedback = self . set_mqtt_topic ( brokerFeedback ) self . brokerCommand = self . set_mqtt_topic ( brokerCommand , True ) self . brokerSetting = self . set_mqtt_topic ( brokerSetting , True ) self . mqttc . loop_start ( ) self . local_mqtt = True except socket . error : self . log . error ( "Unable to connect to MQTT Broker" ) self . mqttc = None return self . mqttc