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. https://mikrotik.com/product/knot
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?
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.
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.