Hello,
First read the value at the analog input.
So you must already activate the Modbus TCP Slave service.
https://wiki.teltonika-networks.com/view/RUT955_Modbus#Modbus_TCP
Chapter Modbus TCP Slave > Enable / Port 502 / Device ID 1
See the list of all parameters
>Section Get Parameter: Analog Input Value :
Register Number 142
Length 2
Datatype : 32 bits integer
Chapter Modbus TCP Master
> add a device / Name: MyRUT955 / Slave ID: 1 / IP: Your RUT IP address / Period 5s Timeout 1s
Request Configuration section
> add an instance
> Name: MyAnalog Value / Datatype: 32 bits Integers 1-2-3-4 (byte order)
> Function code 3 (Read)
> First Register : 142
> Number of registers : 2 (ie length)
> Enabled YES
>> Test to visualize your analog value
At this step, the RUT will read its own Modbus registers (here the value of the analog input) every 5s.
Chapter Modbus Data to Server
> Add an instance: Name Analog MQTT / Enable
> Configure how data should be sent
For example: {"ID":"%i", "TS":"%t", "ST":"%s", "VR":"%a"} will give {"ID": "1", "TS": "1603020476", "ST": "142", "VR": "5.000"} (= 5V)
Then configure the MQTT protocol, the broker to publish to, the topic (ie analogval) and the period to publish to (5s).
So every 5s, the RUT955 will publish on the topic analogval in MQTT on the chosen broker.
Option: You can publish to the Internal Broker.
To do this, you must already activate it. The Modbus Data Sender will then be able to publish to the broker hosted by your RUT955 (Broker IP: Your IP address, Port 1883).
https://wiki.teltonika-networks.com/view/RUT955_MQTT
This way, your application will be able to subscribe to the topic on which the Modbus Data Sender publishes