I am able to read Modbus TCP data on Teltonika device via configured ‘Modbus TCP Master’. Then I send Modbus data to MQTT server via ‘Data to Server’ configuration and I am able to read all data on MQTT broker and then in my MQTT Client application. Here, I have some confusion about MQTT data structure of JSON Format. To read data as in JSON format I have set ‘%a’ in its format. But I received all the data of my Modbus tags in %a in data field only. How can I differentiate the data that comes from different register addresses?
Below are examples:
I have configured different Modbus Addresses to read its data. I am able to read all data of Modbus as configured. The First name APP411 data I received in [192,168,1,10] format, Level data is 171, Setpoints data like [70,20,250]
I have configured data to server for MQTT protocol. In JSON Format you can see I am reading all the Modbus tags value in “data” field with %a JSON format. Then I am getting data on MQTT Broker.
While I’m reading these values in MQTT client, There is confusion to read data with the same parameter.
In “data”:[192,168,1,10] & “data”: [70,20,250]
Then “data” at index [0] is 192 or 70 ? Then “data” at index [1] is 168 or 20 ? Then “data” at index [2] is 1 or 250 ?
How can I read these values? Can you please help me with that?