Hi folks,
I have a system running on a PI 4B.
It talks to a couple of PLC's and 4 energy meters via Modbus TCP.
One of the meters is RTU, remote, as in over the public network, and connected by a Waveshare RS485 to Ethernet Converter.
Each FlexGetter node is set to que, and is triggered from a common inject, every second. with a small delay, each being different.
The remote one is also rate limited at i message every 2 seconds.
All looks good and I get data at the rate I expect easily. However about once a day the node handling the remote meter will change its status to initializing and then hang untill the flow is redeployed.
I have searched for an explanation and even disconnected the meter to see if that triggers the behavior, which isn't the case. Obviously I get a timeout but reconnecting the meter causes the node to resume, as you would expect.
I haven't been able to force this error no matter what silly settings I give things.
Firstly, any thoughts?
Secondly... Is there a way to catch the aberrant state and re-initilise the node?
I am catching the timeout state so already have a trigger of sorts.
I ideally want to give the node a kick, disable and then enable perhaps, rather than redeploying the whole flow.
Looking at the GitHGub and WIKI hasnt suggested a way to force the node to do anything beyond 'normal' operating commands.
Its the last getter in the flow, indicator turns yellow. (Sorry no screenshot)
[
{
"id": "7d4912f24a34f873",
"type": "function",
"z": "992ceee39b1a55a8",
"name": "function 6",
"func": "msg.payload = \n{\n fc: 4, \n unitid: 1,\n address: 0, \n quantity: 82\n} \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 540,
"y": 780,
"wires": [
[
"d6e7dafb70def598"
]
]
},
{
"id": "91941e4e12b3ee90",
"type": "delay",
"z": "992ceee39b1a55a8",
"name": "",
"pauseType": "rate",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "2",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"allowrate": false,
"outputs": 1,
"x": 360,
"y": 780,
"wires": [
[
"7d4912f24a34f873"
]
]
},
{
"id": "d6e7dafb70def598",
"type": "modbus-flex-getter",
"z": "992ceee39b1a55a8",
"name": "",
"showStatusActivities": true,
"showErrors": true,
"showWarnings": true,
"logIOActivities": false,
"server": "e1e943701a8f8af9",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": true,
"keepMsgProperties": false,
"delayOnStart": false,
"startDelayTime": "",
"x": 750,
"y": 780,
"wires": [
[
"2b4a1bc3a513cb31",
"4108fa9da29e0088"
],
[]
]
},
{
"id": "2b4a1bc3a513cb31",
"type": "switch",
"z": "992ceee39b1a55a8",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "nempty"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 550,
"y": 900,
"wires": [
[
"c439a05051bcd3cf"
]
]
},
{
"id": "c439a05051bcd3cf",
"type": "buffer-parser",
"z": "992ceee39b1a55a8",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "floatle",
"name": "voltage",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "floatle",
"name": "current",
"offset": 12,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "floatle",
"name": "power",
"offset": 24,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "floatle",
"name": "frequency",
"offset": 140,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "uint16le",
"name": "importkwh",
"offset": 144,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "uint16le",
"name": "exportkwh",
"offset": 148,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "swap32",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "keyvalue",
"resultTypeType": "return",
"multipleResult": false,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 850,
"y": 920,
"wires": [
[
"941e502fd3f5a7b3"
]
]
},
{
"id": "4108fa9da29e0088",
"type": "switch",
"z": "992ceee39b1a55a8",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "empty"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 690,
"y": 980,
"wires": [
[
"644a223c73571ffe"
]
]
},
{
"id": "644a223c73571ffe",
"type": "change",
"z": "992ceee39b1a55a8",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 880,
"y": 980,
"wires": [
[
"424328c862fe62d7"
]
]
},
{
"id": "941e502fd3f5a7b3",
"type": "function",
"z": "992ceee39b1a55a8",
"name": "power",
"func": "msg.payload = (Math.round(msg.payload.power / 100)/10)*-1;\n//msg.payload = -10;\nmsg.topic = \"power\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1070,
"y": 920,
"wires": [
[
"424328c862fe62d7"
]
]
},
{
"id": "424328c862fe62d7",
"type": "change",
"z": "992ceee39b1a55a8",
"name": "",
"rules": [
{
"t": "set",
"p": "HSE_KW_OBYC",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1340,
"y": 980,
"wires": [
[
"a7d23aca8a7be989"
]
]
},
{
"id": "a7d23aca8a7be989",
"type": "ui_gauge",
"z": "992ceee39b1a55a8",
"name": "",
"group": "30801dbae6e257d8",
"order": 13,
"width": 3,
"height": 3,
"gtype": "gage",
"title": "OBYC House",
"label": "kW",
"format": "{{value| number:2}}",
"min": 0,
"max": "-30",
"colors": [
"#00b500",
"#00b500",
"#00b500"
],
"seg1": "",
"seg2": "",
"diff": false,
"className": "",
"x": 1600,
"y": 980,
"wires": []
},
{
"id": "baf6f0e59f634044",
"type": "delay",
"z": "992ceee39b1a55a8",
"name": "",
"pauseType": "delay",
"timeout": "300",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 350,
"y": 900,
"wires": [
[
"91941e4e12b3ee90"
]
]
},
{
"id": "e1e943701a8f8af9",
"type": "modbus-client",
"name": "OBYC Meter",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"failureLogEnabled": true,
"tcpHost": "xxxxxxxx.ourhydrosite.com",
"tcpPort": "xxxx",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "0x3A",
"unit_id": "1",
"commandDelay": "10",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true,
"showWarnings": true,
"showLogs": true
},
{
"id": "30801dbae6e257d8",
"type": "ui_group",
"name": "Cwm Pennant & Ty'n Y Cablyd House",
"tab": "647eed3084182c30",
"order": 3,
"disp": true,
"width": "11",
"collapse": false,
"className": ""
},
{
"id": "647eed3084182c30",
"type": "ui_tab",
"name": "Cwm Pennant Estate - Energy",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]