# Python scripting with calculation and send data using MQTT

**URL:** <https://community.teltonika.lt/t/python-scripting-with-calculation-and-send-data-using-mqtt/5382>\
**Category:** Networking Solutions\
**Created:** [April 20, 2024, 10:57am UTC](https://community.teltonika.lt/t/python-scripting-with-calculation-and-send-data-using-mqtt/5382 "2024-04-20T10:57:08Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![AndzejJ](https://community.teltonika.lt/user_avatar/community.teltonika.lt/andzejj/32/30_2.png) [@AndzejJ](https://community.teltonika.lt/u/AndzejJ)\
**Post date:** [April 23, 2024, 6:32am UTC](https://community.teltonika.lt/t/python-scripting-with-calculation-and-send-data-using-mqtt/5382/3 "2024-04-23T06:32:15Z")

</div>

Hello,

Python3 is available on Teltonika Networks devices that have enough memory for it. RUT200 does not have much memory, so Python is likely not an option for this device.

However, you should be able to achieve your goals via shell scripting.

You can create a shell script where you can use [UBUS modbus calls](https://community.teltonika.lt/t/rut-955-trying-to-read-modbus-rs485-data-from-slave-device-using-pyserial/1688/5) to send Modbus requests to your Modbus servers. Then, you can proccess the response the way you need, and publish it to your MQTT broker via [Mosquitto](https://community.teltonika.lt/t/how-to-use-mqtt-from-cli-i-need-to-publish-from-cli/3717).

There’s quite a few posts on this forum that contain useful information for your case. For example, the following posts might be helpful:

> [@TRB245 Modbus RTU registers](https://community.teltonika.lt/t/trb245-modbus-rtu-registers/604):
>
> Hello, Im reading modbus registers from Lumel 92RE (as slave) by TRB245(master) via modbus RTU. The read register no. 4005 is 16bit integer number. I would like to send an sms alarm triggered by change in 7th bit of this register (0 or 1). Please help me.

> [@RUT241 - how to check if a client is connected on wifi?](https://community.teltonika.lt/t/rut241-how-to-check-if-a-client-is-connected-on-wifi/1506):
>
> Hello, I need some help. I have a RUT241 running on a remote place. The RUT241 connects to the Internet via 4G with a private APN. I have 4 “Smart WIfI relays” connected to the RUT241. All I want to do is to check if these “Smart WIfI relays” are connected to the RUT241, and if possible create some type of alarm in case any connection is lost (via MQTT, POST, GET, whatever would do). Does anyone have any idea how to do this?

> [@TRB 145 Modbus TCP Slave value send SMS every 24hr](https://community.teltonika.lt/t/trb-145-modbus-tcp-slave-value-send-sms-every-24hr/3052/5):
>
> How to add Message command Modbus register & Value, Time Stamp

Thus, I suggest using the search functionality to find relevant posts.

Kind Regards,

---

_[View the full topic](https://community.teltonika.lt/t/python-scripting-with-calculation-and-send-data-using-mqtt/5382)._
