question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modbus fails if in between http request and response

See original GitHub issue

Problem

  • (x ) bug report

Not sure if this is a problem with node red, or with this package, so, feel free to close it, if it is a node red problem.

Current behavior I have a http in node, which gets a request, transforms this to a payload modbus-getter understands and then want to pass the modbus response on as the http-response.

Node now fails with

"TypeError: Cannot set property listening of #<Server> which has only a getter"

Which seems to be related to the fact, that both http-in and modbus-getter set the msg.req object.

I see, that modbus sends out the message, and receives an answer, but when sending out the message, it fails. If the input comes from an inject node, there is no problem.

Minimal reproduction of the problem with instructions modbus_problem

Create a flow like in the image (issue does not allow json upload). Inject node is working. HTTP get is not.

Transform function:

msg.payload = Object.assign({}, msg.req.params);
return msg;

Your Environment

Please tell us about your environment:

  • Description of the connecting Modbus system:

    • Name : a somehow working python script, but not the issue here.
  • node-red-contrib-modbus version: v5.8.0 21bb78a Modified the finally statement to work with Node-8

  • Node: (min. 10.x) node --version = v8.16.1 (I know, it is not supported, but I hope, that is not the problem here)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gumulkacommented, May 15, 2020

My bad, did not install 5.11, but 5.8 again… Did a messup in git. It is now working with 5.11.0 Thank you

0reactions
gumulkacommented, May 15, 2020

Okay, I updated to newest master code, used the example flow provided by your package and just changed the modbus-serial connection to my own.

TypeError: Cannot set property listening of #<Server> which has only a getter    at _clone (/usr/lib/node/node-red/node_modules/clone/clone.js:162:16)    at _clone (/usr/lib/node/node-red/node_modules/clone/clone.js:162:18)    at _clone (/usr/lib/node/node-red/node_modules/clone/clone.js:162:18)    at _clone (/usr/lib/node/node-red/node_modules/clone/clone.js:162:18)    at _clone (/usr/lib/node/node-red/node_modules/clone/clone.js:162:18)    at clone (/usr/lib/node/node-red/node_modules/clone/clone.js:202:10)    at Object.cloneMessage (/usr/lib/node/node-red/node_modules/@node-red/util/lib/util.js:91:17)    at Object.node (/usr/lib/node/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:410:61)    at BREAK (/usr/lib/node/node-red/node_modules/node-red-contrib-modbus/modbus/maps/modbus-getter.js:58:11)    at /usr/lib/node/node-red/node_modules/node-red-contrib-modbus/modbus/maps/core/core/modbus-client-core.js:66:11
Read more comments on GitHub >

github_iconTop Results From Across the Web

Modbus request/response timing - Control.com
If the device peels the requests one by one from the TCP buffer, then it works fine & the PLC is not technically...
Read more >
Exception Codes | Simply Modbus Software
1. The request is successfully processed by the slave and a valid response is sent. · 2. The request is not received by...
Read more >
Modbus rtu over tcp read failure - Inductive Automation Forum
Hi all, I got a problem with modbus rtu over tcp protocal to read some energy device. A 485 to tcp servert port...
Read more >
Modbus Protocol
Protocol Description. MODBUS© Protocol is a messaging structure, widely used to establish master-slave communication between intelligent devices.
Read more >
Modbus port is not getting responded when there is an http ...
The remote web server does not respond after it receives a URL consisting of a long string of '%' characters (refer Nessus Plugin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found