diff --git a/mqtt/config.sample.ini b/mqtt/config.sample.ini index 9612d748b..b28cb0a6a 100644 --- a/mqtt/config.sample.ini +++ b/mqtt/config.sample.ini @@ -9,13 +9,12 @@ password = gzsthtz@126.com [mqtt] # MQTT Broker connection details -host = 1.12.37.24 +host = 43.143.225.150 port = 1883 +username = odoo +password = odoo123 client_id = OdooMqttConnector -# A comma-separated list of topics to subscribe to for replies. -# You can list multiple topics here. -reply_topics = [app] # How often to poll Odoo for new messages, in seconds. diff --git a/mqtt/main.py b/mqtt/main.py index a90643b47..ffab82a06 100644 --- a/mqtt/main.py +++ b/mqtt/main.py @@ -50,7 +50,9 @@ async def main(): # 2. Connect to MQTT and run tasks async with aiomqtt.Client( hostname=mqtt_cfg['host'], - port=int(mqtt_cfg['port']) + port=int(mqtt_cfg['port']), + username=mqtt_cfg['username'], + password=mqtt_cfg['password'] ) as client: logger.info(f"Connected to MQTT broker at {mqtt_cfg['host']}:{mqtt_cfg['port']}")