FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
578 views 8 comments
by anonymous
I am using the following config.: Modbus Master to Data to server to MQTT, and using Mosquitto MQTT public test broker, and QOS 2, but keep receiving the msg twice.

To receive the msg. (Subscribe) i am using Node Red and MQTT Explorer and both are giving the same result, msg received twice in every cycle (60 sec).

I want to receive the msg once, how can this be configured?

1 Answer

0 votes
by anonymous

Hello,

I would like you to add screenshots where it would be visible that message is received twice.

Also, attach the troubleshoot file. Replicate you configuration, then access router's WebUI, go to System -> Administration -> Troubleshoot section and download troubleshoot file from there.

Best regards,

by anonymous
I edited and added them all in the main msg
by anonymous
Hello,

Both, screenshots and Data to server configuration, show, that QoS for Meter_03 is set to 0. Have you tried value 2 specifically for this device's Data to server instance?

Best regards,
by anonymous
Hi,

Yes, i tried Qos 0, Qos 1 and Qos 2 for the the data to server, even tried different configuration in with node-red and MQTT explorer, still the same. I even tried resetting the TRB 145 to factory settings and reconfigured it, tried the latest firmware update, another thing i tried is trying different brokers, still the same.

Is there a way to monitor what data is sent from the TRB145 through the data to server, maybe i can then monitor what messages are being sent, then i can identify the reason this is happening.
by anonymous

Hello,

Sorry for the delayed response.

Could you verify that only one instance per the same device/first register is enabled?
In the troubleshoot file I can see that device I1 has four instances with the same first registers, and two of them are enabled. The same goes for V31I2, and most likely more. If only one instance per device/first register is visible in the UI, would it be possible to perform a factory reset on the router?

If not, it's also possible to clear the duplicates from the file manually. This would involve using WinSCP to access the file /etc/config/modbus_serial_master and manually removing the duplicates. This could also be done via shell using VI editor, however, that will be more time-consuming.

Let me know if the issue persists!

Best regards,

DaumantasG

by anonymous
Hi,

I tried what you advised and still receiving duplicate messages, so I did the following:

1. Rest the device.

2. Updated the firmware.

Note: this have been tried in 3 TRB145 devices.

So I installed TCPdump In order to confirm if the source of the issue is my broker or from the data being transmitted, and attached is the following for your reference:

1. TCPdum MQTT message using Wireshark, I attached sample 1 message, but this is repeated for all messages.

2. Troubleshooting file.

3. Modbus_data_sender config file.

4. Modbus_master file.

You can see it very clearly from the TCPdump sample test file that the message does have lots of duplicates, and I need your support to resolve it.

In addition, I want to clarify for another thing, if compare the time stamp from the slave device time against the time stamp for the same message  in the TCPdump pcab file there is a difference of 11 seconds and it is almost the same difference in all messages. I attached a screenshot from both in one pic for reference.

Is this related to the Modbus master poll timing or is there any reason like setting that we can adjust.

Best Regards,
by anonymous
Hello,

It seems like the files were not attached, please double-check that. You can also send them to me via a private message if they cannot be uploaded to the original post.

Best regards,
DaumantasG
by anonymous

Hi DaumantasG,

I am not sure why the files were not attached, and i am unable to attached still.

On a side note, I found out the reason for this duplication of message data, it was to due to modbus scan time was 10 sec, while MQTT send time was 60 Sec. when i made both of them the same time i am now receiving message without duplicate.

by anonymous
Hello,

  

In theory, you should receive more messages (6 to be exact), as Data to Server contains a temporary database, and it stores all of the requests before they're all sent out.

Anyway, glad you found the issue.

  

Best regards,
DaumantasG