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

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

Open
jasonlee9900 opened this issue May 12, 2021 · 8 comments
Open

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

jasonlee9900 opened this issue May 12, 2021 · 8 comments

Comments

@jasonlee9900
Copy link

jasonlee9900 commented May 12, 2021

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.

@jasonlee9900
Copy link
Author

jasonlee9900 commented May 12, 2021

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.

@jasonlee9900
Copy link
Author

jasonlee9900 commented May 12, 2021

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).

@dceejay
Copy link
Owner

dceejay commented May 13, 2021

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.

@jasonlee9900
Copy link
Author

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?

@dceejay
Copy link
Owner

dceejay commented May 15, 2021

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

@dceejay
Copy link
Owner

dceejay commented May 16, 2021

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

@jasonlee9900
Copy link
Author

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?

@jasonlee9900
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants