MQTT Modbus Gateway JSON format

Hello,

I successfully configured MQTT Modbus gateway and I can send/receive data to Serial device using MQTT broker. There are currently 2 types to send/receive messages:

ASCII - this is working as expected using the format I found on documentation.
JSON - I could not find the required format on documentation

image

Please provide an example of JSON object that can be used.

Hello,

Here’s an example of a JSON message that can be used for the MQTT Modbus gateway:

mosquitto_pub -h <MQTT broker IP address> -p 1883 -m '{"cookie": 65432,"type": 0,"host": "192.168.1.1","port": 502,"timeout": 1,"server_id": 1,"function": 3,"register_number": 1,"register_count": 1}' -t request

In this example, the "host" IP should be replaced with your Modbus Serial Server’s (slave’s) IP address.

Best regards,

Thank you!

You’re welcome!

Feel free to reach out if you need further assistance or have additional questions.

Best Regards,