Connecting Teltonika RUT200 with PLC & Publishing Data to MQTT

Hi everyone,

I am new to Teltonika and currently working on connecting my Teltonika RUT200 with a PLC to read data and publish it to an MQTT broker.

So far, I have tested Modbus TCP in both client and server modes using a simulator on my laptop, and it worked fine. Now, I want to take it a step further by:

Connecting the RUT200 to a real PLC via Modbus TCP
Publishing the PLC data to an MQTT broker
Can anyone guide me on how to set up this connection? Also, if there are any user manuals or documentation available for this process, please share the links.

Any help or suggestions would be greatly appreciated!

Thanks in advance!

Hello,

Thank you for reaching out!

For your use case, transferring Modbus TCP server data to an MQTT broker, there is a dedicated feature called MQTT Modbus Gateway.

You can find detailed information and a configuration example in our wiki guide, available here: Modbus TCP Client MQTT Gateway.

If you need further assistance or have any additional questions, feel free to reach out.

Best regards,

Thank you for your quick response.

I have followed the documentation, but since I am using ThingsBoard as an MQTT broker (community version), it does not allow subscribing to any topic.

Objective:

I want to connect a PLC/Modbus simulator to a Teltonika device via LAN and send this data to ThingsBoard via MQTT.

Approach 1: Connecting Teltonika via Modbus and Sending Data to ThingsBoard

Steps I have completed:

  1. Installed Modbus master (diagslave) on my PC (Linux).
  2. Created a TCP client on Teltonika with my PC’s IP address. The Teltonika TCP client successfully reads data from holding registers on the PC at 20-second intervals.
  3. Installed the Modbus TCP Master MQTT Gateway on Teltonika and created a device on ThingsBoard with authentication credentials.
  4. Configured the MQTT gateway with the ThingsBoard credentials. Since the default MQTT topic is v1/devices/me/telemetry, I set both the request and response topics accordingly.

Issue:
Despite this setup, I am not receiving data on ThingsBoard. Could you help me troubleshoot this?

Approach 2: Connecting Modbus to a PC Master and Sending Data to a Local MQTT Broker

Steps I have completed:

  1. Installed Modbus master (diagslave) on my PC (Linux).
  2. Created a TCP client on Teltonika with my PC’s IP address, successfully reading holding register values from the PC every 20 seconds.
  3. Configured the local MQTT broker (Mosquitto) on my PC. No authentication is required (allow_anonymous true is set in the broker config file).
  4. Attempted to publish and subscribe to the topic "request", but the register values are not being returned.

Commands Used:

mosquitto_sub -h 192.168.1.4 -t "request"
mosquitto_pub -h 192.168.1.4 -t "request" -m "0 65432 0 192.168.1.1 1 502 5 1 3 2 2"

(Note: My PC’s IP address is 192.168.1.4.)

Additional Information:

Result of publisher for topic request
image

Result of subscriber for topic request
image

Could you please help me identify what might be going wrong in both approaches?

Hello @Leekhil,

Thank you for clarifying your setup and the objective you are trying to achieve.

For monitoring Modbus server data with ThingsBoard MQTT, there is a dedicated wiki example available here: Monitoring with ThingsBoard IoT Platform

Please follow the guidelines provided in this example, and if you have any additional questions or need further assistance, feel free to reach out.

Best regards,

@Martynas
Thanks for the documentation.

I have followed all the steps from the article, but I am still unable to receive data on ThingsBoard. The only difference I noticed is that the article uses the Professional Edition, whereas I am using the Community Edition of ThingsBoard.

I have tried sending data to the server using both MQTT and HTTP, but neither approach was successful.

Does Teltonika generate any log files that I can check to identify what might be causing the issue?

Hey @Martynas

The issue was caused by the wireless connection.
I switched to a different Wi-Fi network, and now it’s working fine.

Thanks a lot!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.