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
1,156 views 23 comments
by
Hi,

I have a problem with Modbus communication. This works for a while and suddenly it breaks off as if the TRB140 would go into standby! If I start this new everything works again for a certain time. The firmware is up to date.

1 Answer

0 votes
by anonymous

Hello,

Can you provide a little more information about your issue? Can you draw and provide a simple topology of your system, how everything is connected, via what interfaces, what IP addresses and gateways the devices has? Also, do you run TRB140 as Modbus TCP slave and you are monitoring TRB140 via Modbus, or you have configured TRB140 as Modbus TCP Master and TRB is pulling Modbus Data from slave device and here the issue is? TRB stops pulling Modbus data from slave device and the reboot helps to solve this issue?

Can you please PM me with the troubleshoot file (System -> Administration -> Troubleshoot) when issue persist?

Let me know.

by

Hi!

Did you observe the memory consumption and number of open file descriptors after each read/write, and it didn't increase?

I have another timeslot tonight when I will reproduce it. Unfortunately the device is still in use in a pump-house 350km away, so no local access at the moment. I will try to get hold of another device to test with.

I'm not sure I can get the troubleshoot file though, since the UI is half-broken even after killing and restarting some services, but I will try.

For reference, here is the small C application I have been using to reproduce it:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <modbus/modbus.h>

int main(int argc, char *argv[]) {
  modbus_t *mb;
  int reg_addr = 0;
  uint16_t reg_val = 0;
  int reg_count = 0;

  if (argc != 4) {
    printf("Usage: %s <hostname> <register> <read_count>\n", argv[0]);
    return -1;
  }

  reg_addr = atoi(argv[2]);
  reg_count = atoi(argv[3]);

  int i;
  for (i=0; i<reg_count; i++) {
      mb = modbus_new_tcp(argv[1], 502);
      modbus_set_slave(mb, 1);
      modbus_connect(mb);
      modbus_read_registers(mb, reg_addr, 1, &reg_val);
      modbus_close(mb);
      modbus_free(mb);
      sleep(1);
  }

  return 0;
}
by anonymous
Thank you for the information, I will try consulting with RnD to see what we cansuggest as a solution.
by anonymous

Attached TEST Firmware release is for this particular issue.
Please check if this specific function works properly now.
Since this is a TEST version of the Firmware, designed to address specific issues, use it only with a handful of devices; you should not use it for your whole fleet.
Once we receive positive feedback from you – these changes will be included into next Master Firmware release version.
Note: without final confirmation that the issue has been resolved these changes will not be included into Master Firmware version, hence shall not be included from the Factory.

by anonymous
Thank you for the quick fix!

The TEST firmware works well as far as I can tell. I tested with both read and writes without any increase in neither number of file descriptors or memory usage. Good work!

When is the next Master Firmware planned to be released?
by anonymous

Hello,

Thank you for the feedback, the master firmware is still undergoing development and testing phase so it is hard to tell when exactly it will be released. I recommend keeping an eye on here: https://wiki.teltonika-networks.com/view/TRB141_Firmware_Downloads

For the latest available firmware version.