# Using mqtt in tryton

**URL:** https://discuss.tryton.org/t/using-mqtt-in-tryton/4537
**Category:** Developer
**Created:** [August 16, 2021, 1:54pm UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537 "2021-08-16T13:54:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [August 16, 2021, 1:54pm UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537/1 "2021-08-16T13:54:19Z")

</div>

Hi,  
Anyone here have tried using mqtt in tryton?

I am trying to use mqtt for capturing some hardware information. However, there is problem that when sending mqtt signal, but the commit is not ending. So the signal sent was not up to date

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 16, 2021, 1:59pm UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537/2 "2021-08-16T13:59:21Z")

</div>

Please provide information and links about what you call “mqtt”.

---

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [August 16, 2021, 2:20pm UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537/3 "2021-08-16T14:20:26Z")

</div>

Hi @ced,

Sorry, mqtt ([https://mqtt.org/](https://mqtt.org/)) is protocol mostly for IOT. Currently, I used it to trigger remote printer for printing.

It is publish/subcribe like protocol.  
I am write a record to printer table and send the protocol for triggering. However, when send the protocol the record is not committed to get the empty result at printer side.

\*Side note: printer side I am using raspberry

---

<div class="post-metadata">

### Author: ![jeromarquez](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jeromarquez/32/452_2.png) [@jeromarquez](https://discuss.tryton.org/u/jeromarquez)
#### Post date: [August 17, 2021, 3:28am UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537/4 "2021-08-17T03:28:04Z")

</div>

We are also interested in this issue. We have some Arduinos taking info from machines (as temperature and speed) and we want to save it in Tryton DB. We were thinking about made another DB and “cross” the info but this is not the best desing I think.  
We will be following this post.  
Cheers!

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [August 17, 2021, 7:43am UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537/5 "2021-08-17T07:43:20Z")

</div>

I’m strugling to understand whats your issue exactly. I think you need to clarify.

> [@bala4901](#):
>
> However, there is problem that when sending mqtt signal, but the commit is not ending.

Which commit are you talking about? Tryton transaction commit or mqtt related one?

Could you share some sample code that you are using?

---

<div class="post-metadata">

### Author: ![edbo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@edbo](https://discuss.tryton.org/u/edbo)
#### Post date: [August 17, 2021, 9:20am UTC](https://discuss.tryton.org/t/using-mqtt-in-tryton/4537/6 "2021-08-17T09:20:10Z")

</div>

> [@jeromarquez](#):
>
> We have some Arduinos taking info from machines (as temperature and speed) and we want to save it in Tryton DB.

In this case you have to create something in between. For example you use RabbitMQ, your clients connect to RabbitMQ, then you have to create some workers who consume the data from your clients and put that into Tryton. The nice thing is that RabbitMQ is like a buffer and you can add several workers to process the messages and store them.

Back on topic, I don’t know the setup @bala4901 but I suppose there should be a MQTT server somewhere. So I think in this case you have to create a new datamanager which you are joining with the trigger transaction. The datamanager should take care of the MQTT connections and pushes the data. Take a look at the notification\_email module and specifically `SMTPDataManager` which resides in `trytond.sendmail`. If you are using RabbitMQ, your datamanager should be acting like a client and pushing the data to RabbitMQ. Your Raspberry Pi can also act like an client, but if you have installed RabbitMQ as a server, you can also use a worker.

Maybe the `trytond.bus` is also a possibility [Bus — Tryton server](https://docs.tryton.org/projects/server/en/latest/ref/bus.html)?
