RS485 don´t reconnect after failure

Hi, I got a big problem, till a few days ago I used a RPi4 to query 3 EASTRON SDM72v2 with a DSD TECH SH-U11F, this works for years without problems.
Now I changed the RPi4 to a RPi2 - fresh install - same flow.
Every few - 12h I get a failure, I think this was the same on RPi4, but on the RPi2 Node-Red doesn´t reconnect after the failure.

It looks like this:


grafik

On RPi4 I get this error sometimes too, but it didn't matter at all - it just reconnected after 5s and it continued. (completely irrelevant)

Does anyone have an idea why the RPi2 doesn't want to reconnect ?
I have to restart or plug out/in USB.
I tested all USB Ports from RPi2 and changed the DSD Tech with my other one (querys a SDM630) - the error moves along.

the only one which is new: Node-JS 20 instead of 18.

flow:

[
    {
        "id": "fe9c25b2603b8f3f",
        "type": "inject",
        "z": "112d382639b7cc28",
        "name": "alle 2s",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "2",
        "crontab": "",
        "once": false,
        "onceDelay": "10",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 140,
        "y": 60,
        "wires": [
            [
                "7a8e8b7482913bd8",
                "2844c4c58b7e4729"
            ]
        ]
    },
    {
        "id": "8a5957b7b2f7ec03",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0006 - 0035",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "2",
        "dataType": "InputRegister",
        "adr": "0006",
        "quantity": "30",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 460,
        "wires": [
            [
                "f20df6cb188e76a4"
            ],
            [
                "b267ca8a8b7f6dcb"
            ]
        ]
    },
    {
        "id": "b267ca8a8b7f6dcb",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0052 - 0053",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "2",
        "dataType": "InputRegister",
        "adr": "0052",
        "quantity": "2",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 520,
        "wires": [
            [
                "e58032fe783749bd"
            ],
            [
                "268716dd0510b280"
            ]
        ]
    },
    {
        "id": "268716dd0510b280",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0060 - 0063",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "2",
        "dataType": "InputRegister",
        "adr": "0060",
        "quantity": "4",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 580,
        "wires": [
            [
                "a4cf714520032bd0"
            ],
            [
                "c7d78de48b6972f0"
            ]
        ]
    },
    {
        "id": "c7d78de48b6972f0",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0070 - 0075",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "2",
        "dataType": "InputRegister",
        "adr": "0070",
        "quantity": "6",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 640,
        "wires": [
            [
                "2ae4692b297de57f"
            ],
            [
                "3a7729b29e4a9e67"
            ]
        ]
    },
    {
        "id": "3a7729b29e4a9e67",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0224 - 0225",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "2",
        "dataType": "InputRegister",
        "adr": "0224",
        "quantity": "2",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 700,
        "wires": [
            [
                "19f9bcad6ccfb90d"
            ],
            [
                "44049c9369ec07d6"
            ]
        ]
    },
    {
        "id": "5716f5f635efd906",
        "type": "comment",
        "z": "112d382639b7cc28",
        "name": "ID2 Wärmepumpe",
        "info": "",
        "x": 170,
        "y": 420,
        "wires": []
    },
    {
        "id": "b9a429ba348a3d94",
        "type": "comment",
        "z": "112d382639b7cc28",
        "name": "ID3 PV-Erzeugung",
        "info": "",
        "x": 170,
        "y": 780,
        "wires": []
    },
    {
        "id": "219a2f38e1290dc1",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0052 - 0053",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "3",
        "dataType": "InputRegister",
        "adr": "0052",
        "quantity": "2",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 880,
        "wires": [
            [
                "b0d2e266bd07228e"
            ],
            [
                "bb8ffd892da9597a"
            ]
        ]
    },
    {
        "id": "bb8ffd892da9597a",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0060 - 0063",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "3",
        "dataType": "InputRegister",
        "adr": "0060",
        "quantity": "4",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 940,
        "wires": [
            [
                "cddffc4f7547293c"
            ],
            [
                "ef109eceec75d7b3"
            ]
        ]
    },
    {
        "id": "ef109eceec75d7b3",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0070 - 0075",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "3",
        "dataType": "InputRegister",
        "adr": "0070",
        "quantity": "6",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 1000,
        "wires": [
            [
                "dd2c48ebe743a6db"
            ],
            [
                "4de1cd7200f7a98d"
            ]
        ]
    },
    {
        "id": "44049c9369ec07d6",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0006 - 0035",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "3",
        "dataType": "InputRegister",
        "adr": "0006",
        "quantity": "30",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 820,
        "wires": [
            [
                "74a43fce665f37f7"
            ],
            [
                "219a2f38e1290dc1"
            ]
        ]
    },
    {
        "id": "2844c4c58b7e4729",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0006 - 0035",
        "showStatusActivities": true,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "InputRegister",
        "adr": "0006",
        "quantity": "30",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 100,
        "wires": [
            [
                "ac1cea62248307c0"
            ],
            [
                "15b9f2ce6c23e859"
            ]
        ]
    },
    {
        "id": "15b9f2ce6c23e859",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0052 - 0053",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "InputRegister",
        "adr": "0052",
        "quantity": "2",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 160,
        "wires": [
            [
                "547a95a8fa761ce4"
            ],
            [
                "385f6eb8bf7fc2fb"
            ]
        ]
    },
    {
        "id": "385f6eb8bf7fc2fb",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0060 - 0063",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "InputRegister",
        "adr": "0060",
        "quantity": "4",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 220,
        "wires": [
            [
                "2f25dd3b2d0c1467"
            ],
            [
                "b37015d4bf776d74"
            ]
        ]
    },
    {
        "id": "b37015d4bf776d74",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0070 - 0075",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "InputRegister",
        "adr": "0070",
        "quantity": "6",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 280,
        "wires": [
            [
                "45c1c62ce6779015"
            ],
            [
                "c2e327bbc7e4e03d"
            ]
        ]
    },
    {
        "id": "c2e327bbc7e4e03d",
        "type": "modbus-getter",
        "z": "112d382639b7cc28",
        "name": "0224 - 0225",
        "showStatusActivities": false,
        "showErrors": true,
        "showWarnings": true,
        "logIOActivities": false,
        "unitid": "1",
        "dataType": "InputRegister",
        "adr": "0224",
        "quantity": "2",
        "server": "bb0f2e018eb97236",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 150,
        "y": 340,
        "wires": [
            [
                "cf19175fce13241f"
            ],
            [
                "8a5957b7b2f7ec03"
            ]
        ]
    },
    {
        "id": "bb0f2e018eb97236",
        "type": "modbus-client",
        "name": "SDM72",
        "clienttype": "serial",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": false,
        "tcpHost": "127.0.0.1",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/SDM72",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "19200",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "10",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "50",
        "clientTimeout": "3000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "5000",
        "parallelUnitIdsAllowed": false
    }
]

Installed new with Node-JS 18 - same.

This isn't an answer, but more to clear any confusion for others who may have the same problem, and read this post.

This isn't "Node RED" not re-connecting - Nodes developed for Node RED, handle their own connection, and Node RED does not get involved.

With that said, I can only assume its something on the Pi2, not advising the Node you are using know, its available again (note: I do not use any of the nodes you use).

Have you raised this with the Node Author? - it could be a known problem with the Pi2 - the Pi2 power delivery plant can be strained quite easily, and may not recover sufficiently compared to more recent versions of the Pi :man_shrugging:

What do you see in syslog when it fails?

the same as Node-Red Debug:

Oct 8 20:22:15 raspberrypi2 Node-RED[1605]: 8 Oct 20:22:15 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging

Oct 8 20:22:15 raspberrypi2 Node-RED[1605]: 8 Oct 20:22:15 - [error] [modbus-getter:0060 - 0063] Error: Timed out

the modbus getter can´t initialize the RS485 USB - I have to say

Check there is nothing relevant in the time before that, possibly related the serial port.

Also make sure your OS is up to date by running
sudo apt update && sudo apt full-upgrade
Make sure there are no errors from that.
What version of OS are you running on the two Pis?

Make sure there are no errors from that.
What version of OS are you running on the two Pis?

always the newest, no errors.

I extended the modbus wires over some network cables to another RPi3 - here it works like on the RPi4, sometimes modbus failures, but it reconnects immediately.
syslog shows several failures tonight:

Oct 10 00:14:40 nibepi Node-RED[417]: 10 Oct 00:14:40 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:14:40 nibepi Node-RED[417]: 10 Oct 00:14:40 - [error] [modbus-getter:0224 - 0225] Error: Timed out
Oct 10 00:14:40 nibepi Node-RED[417]: 10 Oct 00:14:40 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:14:40 nibepi Node-RED[417]: 10 Oct 00:14:40 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:14:54 nibepi Node-RED[417]: 10 Oct 00:14:54 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:14:54 nibepi Node-RED[417]: 10 Oct 00:14:54 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:14:54 nibepi Node-RED[417]: 10 Oct 00:14:54 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:14:54 nibepi Node-RED[417]: 10 Oct 00:14:54 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:15:08 nibepi Node-RED[417]: 10 Oct 00:15:08 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:08 nibepi Node-RED[417]: 10 Oct 00:15:08 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:15:08 nibepi Node-RED[417]: 10 Oct 00:15:08 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:08 nibepi Node-RED[417]: 10 Oct 00:15:08 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:15:22 nibepi Node-RED[417]: 10 Oct 00:15:22 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:22 nibepi Node-RED[417]: 10 Oct 00:15:22 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:15:22 nibepi Node-RED[417]: 10 Oct 00:15:22 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:22 nibepi Node-RED[417]: 10 Oct 00:15:22 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:15:36 nibepi Node-RED[417]: 10 Oct 00:15:36 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:36 nibepi Node-RED[417]: 10 Oct 00:15:36 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:15:36 nibepi Node-RED[417]: 10 Oct 00:15:36 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:36 nibepi Node-RED[417]: 10 Oct 00:15:36 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:15:45 nibepi dhcpcd[637]: eth0: Router Advertisement from fe80::5e49:79ff:fe2d:6f87
Oct 10 00:15:50 nibepi Node-RED[417]: 10 Oct 00:15:50 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:50 nibepi Node-RED[417]: 10 Oct 00:15:50 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:15:50 nibepi Node-RED[417]: 10 Oct 00:15:50 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:15:50 nibepi Node-RED[417]: 10 Oct 00:15:50 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:16:04 nibepi Node-RED[417]: 10 Oct 00:16:04 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:04 nibepi Node-RED[417]: 10 Oct 00:16:04 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:16:04 nibepi Node-RED[417]: 10 Oct 00:16:04 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:04 nibepi Node-RED[417]: 10 Oct 00:16:04 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:16:18 nibepi Node-RED[417]: 10 Oct 00:16:18 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:18 nibepi Node-RED[417]: 10 Oct 00:16:18 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:16:18 nibepi Node-RED[417]: 10 Oct 00:16:18 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:18 nibepi Node-RED[417]: 10 Oct 00:16:18 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:16:32 nibepi Node-RED[417]: 10 Oct 00:16:32 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:32 nibepi Node-RED[417]: 10 Oct 00:16:32 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:16:32 nibepi Node-RED[417]: 10 Oct 00:16:32 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:32 nibepi Node-RED[417]: 10 Oct 00:16:32 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:16:46 nibepi Node-RED[417]: 10 Oct 00:16:46 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:46 nibepi Node-RED[417]: 10 Oct 00:16:46 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:16:46 nibepi Node-RED[417]: 10 Oct 00:16:46 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:16:46 nibepi Node-RED[417]: 10 Oct 00:16:46 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:16:46 nibepi dhcpcd[637]: eth0: Router Advertisement from xxx
Oct 10 00:17:00 nibepi Node-RED[417]: 10 Oct 00:17:00 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:17:00 nibepi Node-RED[417]: 10 Oct 00:17:00 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:17:00 nibepi Node-RED[417]: 10 Oct 00:17:00 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:17:00 nibepi Node-RED[417]: 10 Oct 00:17:00 - [error] [modbus-getter:0000 - 0035] Error: Timed out
Oct 10 00:17:01 nibepi CRON[15259]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 10 00:17:14 nibepi Node-RED[417]: 10 Oct 00:17:14 - [warn] [modbus-getter:0006 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:17:14 nibepi Node-RED[417]: 10 Oct 00:17:14 - [error] [modbus-getter:0006 - 0035] Error: Timed out
Oct 10 00:17:14 nibepi Node-RED[417]: 10 Oct 00:17:14 - [warn] [modbus-getter:0000 - 0035] Modbus Failure On State sending Get More About It By Logging
Oct 10 00:17:14 nibepi Node-RED[417]: 10 Oct 00:17:14 - [error] [modbus-getter:0000 - 0035] Error: Timed out

after this no failures, so I saved a whole RPi2 in my garage.

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