# Losant MQTT Broker

**URL:** <https://forums.losant.com/t/losant-mqtt-broker/4363>\
**Category:** Help\
**Tags:** mqtt, dashboard, workflow, device\
**Created:** [February 19, 2022, 11:15am UTC](https://forums.losant.com/t/losant-mqtt-broker/4363 "2022-02-19T11:15:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagarjuna\_Reddy](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@Nagarjuna\_Reddy](https://forums.losant.com/u/Nagarjuna_Reddy)\
**Post date:** [February 19, 2022, 11:15am UTC](https://forums.losant.com/t/losant-mqtt-broker/4363/1 "2022-02-19T11:15:40Z")

</div>

how do i connect and publish data from ubuntu to losant using MQTT with python?  
i was tried using the sample code but it’s not working for us

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/1f6d4d0aa071f08328b3f52f3f5c026eedb5f120.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/b/bd3ca34df30bd3cf7675d52f927756c8c3526208.png)

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [February 21, 2022, 2:31pm UTC](https://forums.losant.com/t/losant-mqtt-broker/4363/2 "2022-02-21T14:31:43Z")

</div>

I don’t see anywhere in your screenshot where you are publishing a message on a [custom MQTT topic](https://docs.losant.com/mqtt/overview/#custom-topics), which is what would cause the [MQTT Trigger](https://docs.losant.com/workflows/triggers/mqtt/) to fire, assuming it is configured to listen to the Losant Broker on the topic you published on.

I do see that you are sending a random number as state for the “temperature” attribute on your device. Per your [device’s connection log](https://docs.losant.com/devices/overview/#connection-log), is it connecting to the Losant broker? Do you see those state reports in your [Recent Device States](https://docs.losant.com/devices/overview/#recent-device-states) tab?
