Community discussions

MikroTik App
just joined
Topic Author
Posts: 1
Joined: Thu Jan 20, 2022 12:09 pm

IOT Knot Config. Modbus RTU to Mqtt

Thu Jan 20, 2022 12:29 pm

Hello I am unfortunately still new in the field of MikroTik and therefore do not know me so well. I own a MikroTic IOT Knot Gateway.
My intentions are as follows.

I want to read data via Modbus RTU from a device and then send it directly and automated via Mqtt, so publish. Conversely, I would also like to receive values via Mqtt, i.e. make a subscribtion to a broker. And then send these received values from Mqtt automated via Modbus RTU to the device. Is this possible with this device?
I have also attached a schematic how I mean it.
Is it also possible to do this via Modbus TCP? So in principle instead of Modbus RTU to Mqtt directly Modbus TCP to Mqtt?

Or is it only possible as in the description of the product? Modbus RTU to Modbus TCP Server and Bluetooth to Mqtt. Where Mqtt as I can see from the description can only publish?

Thanks for your Help.
You do not have the required permissions to view the files attached to this post.
User avatar
Long time Member
Long time Member
Posts: 611
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: IOT Knot Config. Modbus RTU to Mqtt

Fri Jan 21, 2022 6:08 am

I don't have a KNOT, but the IoT package AFAIK doesn't subscribing, just publishing.

They do allow scheduled scripts via /system/scheduler to "poll" something via HTTPS (using /tool/fetch in ROS)... BUT that's not the same as a subscribe from MQTT that be tied to Mikrotik script code.
MikroTik Support
MikroTik Support
Posts: 15
Joined: Wed May 26, 2021 12:00 pm

Re: IOT Knot Config. Modbus RTU to Mqtt

Fri Jan 21, 2022 9:08 am

Currently, only MQTT publish is supported (MQTT subscriber is not).

MODBUS allows KNOT to act as a TCP bridge and read data from Modbus-supported devices connected to a 2-pin terminal block on the board. Modbus clients (slaves) can access the data from the Modbus server (master - KNOT) using the 502/TCP port.

Function code (3) registers can be "read" through CLI: ... ngRouterOS
Meaning, that only function code (3) replies can be shown in RouterOS CLI and can be scripted to be "MQTT" published. Other data (other registers) can not be.

Who is online

Users browsing this forum: Panbambaryla and 22 guests