Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Modbus TCP fails to reconnect automatically #1592

Open
Tpro4391 opened this issue Nov 11, 2024 · 1 comment
Open

[BUG] Modbus TCP fails to reconnect automatically #1592

Tpro4391 opened this issue Nov 11, 2024 · 1 comment
Assignees
Labels
bug can be closed If bug fixed or feature is implemented

Comments

@Tpro4391
Copy link

Describe the bug

  1. Configure modbus tcp to PLC, read register value ok
  2. Turn off PLC (simulate connection loss)
  3. Turn on PLC again (connect back)
  4. Check ioT Gateway reports connection error, cannot reconnect:
    to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:13 tb-gateway-scada | 2024-11-11 03:59:13 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:15 tb-gateway-scada | 2024-11-11 03:59:15 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:17 tb-gateway-scada | 2024-11-11 03:59:17 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:19 tb-gateway-scada | 2024-11-11 03:59:19 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:21 tb-gateway-scada | 2024-11-11 03:59:21 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:23 tb-gateway-scada | 2024-11-11 03:59:23 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:25 tb-gateway-scada | 2024-11-11 03:59:25 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused
    2024-11-11 10:59:27 tb-gateway-scada | 2024-11-11 03:59:27 - |ERROR| - [tcp.py] - tcp - connect - 187 - Connection to (192.168.31.240, 502) failed: [Errno 111] Connection refused

Connector name (If bug in the some connector):
Modbus TCP

Error traceback (If available):

'deviceName'
Traceback (most recent call last):
  File "<input>", line 2, in <module>
KeyError: 'deviceName'

Versions (please complete the following information):

  • OS: Docker Windows
  • Thingsboard IoT Gateway version 3.6
  • Python version[e.g. 3.7]
@imbeacon
Copy link
Member

Hi @Tpro4391,

Thank you for your interest in ThingsBoard IoT Gateway.
The gateway contains parameter waitAfterFailedAttemptsMs, for Modbus connector, it means that the gateway will recreate a connection, only after this amount of time, when all retries of connection to current master were failed, in current version of the gateway, it cannot be less than 5 minutes, and it will retry to connect in 5 minutes, we will change this limit to 30 seconds in 3.7 version.

@imbeacon imbeacon added the can be closed If bug fixed or feature is implemented label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can be closed If bug fixed or feature is implemented
Projects
None yet
Development

No branches or pull requests

3 participants