dceejay/electron-node-red

can't make flow work same as original node-red

Opened this issue · 8 comments

everything is ok, but I found connection problem when I run flow on electron-node-red. the flow can't keep reconnect alive, always shut down until you deploy it or restart the flow. But the same flow work well on original node-red platform (without use electron-node-red to pack). I am working on windows 10 system.
for example, if you plug net cable out when there are modbus (node-red-contrib-modbus version 5.14.0) are running, and a few seconds later you plug net cable in, but electron-node-red will not reconnect until you deploy it or restart it. But the original node-red platform (without use electron-node-red to pack) did reconnect and work very smoothly.
what's the reason of that? other function seems work good as original node-red platform.

plug in and plug out cable or hardware (e.g. PLC) power off and power on, electron-node-red do not handle that reconnect, it's important to keep this communication alive and automatically reconnect without manually operation.

the major problem is about node-red-contrib-modbus, whenever network breakdown, node-red-contrib-modbus will never auto reconnect until you manually deploy it or restart it.
But node-red-contrib-modbus work well and can always reconnect when it run on node-red platform (without packed by electron-node-red).

Sorry - but this project is just a starter for others to base their work on - it is not intended as a production environment. I don't know or use modbus so you will have to debug it yourself.

Thank you for your response, I will debug this problem and will feedback you if I can solve this problem, any hints for which part of code that I should concern?

well as you suggest I would look in the modbus node code to see how it detects disconnections and how it tries to recover.

One thought - are you building in the modbus node via your package.json file or adding the node later ?

yes, I have tried both, put modbus node in package.json like below:
"dependencies": {
"electron-is-dev": "^2.0.0",
"electron-store": "^7.0.3",
"express": "^4.17.1",
"node-red": "1.3.4",
"fs-extra": "^10.0.0",
"node-red-contrib-play-audio": "",
"node-red-contrib-modbus": "^5.14.0",
"node-red-node-rbe": "^0.5.0",
"node-red-contrib-web-worldmap": "
",
"node-red-dashboard": "",
"node-red-node-base64": "
",
"node-red-node-geofence": "",
"node-red-node-random": "
",
"node-red-node-smooth": "*"
},

And, also I use original electron-node-red without add my dependencies, and later install modbus node after packed successfully.

All the same, only reconnect one time, and do not try to connect after that. but same modbus setting always keep alive on original node-red platform.

can we set electron-node-red auto deploy or auto restart periodically?

As you suggested: "I would look in the modbus node code to see how it detects disconnections and how it tries to recover."
where are those modbus code location file after packed by electron-node-red, does electron still use node-red-contrib-modbus from :\Users\myuser.node-red\node_modules after packed? or can we set electron always use modbus from that path (as this is the original node-red platform to use modbus and work well)