RUTX50 - Unresponsive Modbus server

Context
Hardware: RUTX50
Firmware: RUTX_R_00.07.05.4

Description
I’ve enabled Modbus TCP on my RUTX50. Here’s the print of my configs

Then my Modbus client periodically reads the registers and stores them for further analysis.

Problem
I can collect the desired data without any issues for a short period of time. However, after a while my client starts to receive errors like:

Error: Modbus exception 2: Illegal data address (register not supported by device)
Error: Modbus exception 4: Slave device failure (device reports internal error)

Expected Behavior
Not to receive the error and be able to collect the data.

Workaround
Periodically rebooting the device seems to help but after a while the error happens again.

Question
What’s the best way to isolate the source of the problem? How can I solve the issue?

@Janmiguel @AndzejJ sorry for tagging you but is there a way to see modbus_server internal logs? I would like to understand what’s going on. From what I can see the logread does not show this kind of info

The fact that service modbus_server restart does not solve the problem and only a full reboot brings back the modbus is really painful.

Can you provide more docs about the modbus_server? It does not accept -h to show the docs
image

Also, Can you give more info about the rs_modbus? What does it do?

@rashid @rob_dj can you give me any pointers to solve this?

Hello,

I tried doing a simple test based on your configuration, I run a Modbus client simulator which periodically collects certain data on a RUTX50 running the 7.05.4 firmware version and I never had any errors.

May I know first what Modbus parameters are you periodically collecting?

Since the availability of the data depends on certain scenarios such as having a mobile connection, etc.
For example, If I wanted to collect RSSI (mobile signal strength) without having to put a SIM card in it, I would have some errors since no data was available due to the lack of mobile connectivity. (as shown below)

Based on the first provided error in your case Error: Modbus exception 2: Illegal data address (register not supported by device)
→ It seems like there’s an error in the register address configuration on the Modbus client side.

For the Error: Modbus exception 4: Slave device failure (device reports internal error)
→ As I have mentioned above, this may be due to a collection of modbus parameters related to mobile connection or GPS.

Lastly, kindly download the troubleshoot file of the device and send it to me via private message for me to check further.
You can do this by navigating to System → Maintenance ->Troubleshoot, then scroll in the Troubleshoot section,

Best regards,
Rob

Hi @rob_dj

Thank you for quick response.

May I know first what Modbus parameters are you periodically collecting?

Here’s list of the stuff that I’m collecting:

bootTs: address -> 1
rssi: address -> 3
sysTempC: address -> 5
hostname: address -> 7
mobileCarrier: address -> 23
serial: address -> 39
macAddress: address -> 55
model: address -> 71
activeSimSlot: address -> 87
activeSimId: address -> 205
mobileNetworkRegistrationInfo: address -> 103
mobileNetworkType: address -> 119
wanIpAddress: address -> 139
latitude: address -> 143
longitude: address -> 145
gpsSatCnt: address -> 181
sim1MonthToDateRecvMb: address -> 193
sim1MonthToDateSentMb: address -> 195
sim2MonthToDateRecvMb: address -> 308
sim2MonthToDateSentMb: address -> 310
modemId: address -> 328
imsi: address -> 348
lanIpAddress: address -> 394

If I wanted to collect RSSI (mobile signal strength) without having to put a SIM card in it, I would have some errors since no data was available due to the lack of mobile connectivity.

Yep, this is kind of the idea. I want to continuously collect the data and, if something looks weird, take an appropriate action.

Question to you: Do you think that it’s correct to throw a Modbus exception 4 because of missing data? Why not return some constant value (e.g, -1) if there’s no RSSI? I mean, the -1 is much more informative than the exception. From the client point-of-view, exception implies that there was an internal error when in reality there was none, it’s just the SIM card that’s missing.


Error: Modbus exception 2: Illegal data address (register not supported by device)
→ It seems like there’s an error in the register address configuration on the Modbus client side.

Yep, that what I thought initially. However, the error disappears when I reboot the router.
What’s the proper way to restart the modbus_server? The service modbus_server restart does not work.

Also, can you explain what’s the rs_modbus? What does it do?

PS: will send you the troubleshoot files later

@rob_dj sorry for bothering you again but can you give me some pointers about how to properly restart the modbus_server ?

Also, I clicked on your profile but I can’t see any button that allows me to send a DM with the troubleshoot files:

@rob_dj can you help me out? Rebooting the router just to get modbus_server to start working again is painful

Hello AndMaz,

Apologies for the late reply.

For this one, this would require an RnD intervention so it would be better to communicate with your Sales Manager. Here’s a link which you can use to get the contact details: Teltonika Networks - LTE Routers, Gateways & Modems for IoT

To properly restart the modbus server service, you can use the command

/etc/init.d/modbus_server restart

Hope this helps.

Best regards,
Robert

For this one, this would require an RnD intervention so it would be better to communicate with your Sales Manager. Here’s a link which you can use to get the contact details: Teltonika Networks - LTE Routers, Gateways & Modems for IoT

Thank you. Will give it a try

/etc/init.d/modbus_server restart

Hi @rob_dj I’ve already tried that by calling service modbus_server restart but it does not solve the problem. Only a full reboot fixes things

Also, Can you give more info about the rs_modbus? What does it do?

Hello,

Can you confirm that /etc/init.d/modbus_server restart doesn’t fix the issue and reboot is still required?

For the rs_modbus, it is a different service on Teltonika devices use for serial utilities. ‘rs_modbus’ is for the Modbus TCP over Serial Gateway functionality. Therefore, to properly restart the Modbus TCP Server service, restart the ‘modbus_server’ instead of the rs_modbus.

Upon rechecking the Modbus parameters you were collecting, it seems like you were using the Register Address per parameter. Note that if you wanted to collect Modbus parameters from the Teltonika device, you need to use the Register Number instead (basically +1 from the Register Address)
Here’s a link for more details - RUTX50 Monitoring via Modbus - Teltonika Networks Wiki

Hope this will help resolve your issues.

Best regards,
Robert

Can you confirm that /etc/init.d/modbus_server restart doesn’t fix the issue and reboot is still required?

Ok. I’ll give it a try next time that it fails.

Upon rechecking the Modbus parameters you were collecting, it seems like you were using the Register Address per parameter. Note that if you wanted to collect Modbus parameters from the Teltonika device, you need to use the Register Number instead (basically +1 from the Register Address)
Here’s a link for more details - RUTX50 Monitoring via Modbus - Teltonika Networks Wiki

I guess that under the hood my modbus client does the +1 because the data that I’m getting is good.

BTW can you tag any firmware devs in here? I want to ask them to add the -h/--help option to the modbus_server. Also, would be good to hear their input on the static value instead of Error: Modbus exception 4: Slave device failure before bothering Sales Manager.

This topic was automatically closed after 15 days. New replies are no longer allowed.