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

NodeJS 12 - not compatible #144

Closed
biancode opened this issue Jun 20, 2019 · 19 comments
Closed

NodeJS 12 - not compatible #144

biancode opened this issue Jun 20, 2019 · 19 comments
Assignees
Labels
feature request major-upgrade pull request welcome send your pull request and contribute to the project sponsors are welcome https://plus4nodered.com/ testing

Comments

@biancode
Copy link
Contributor

biancode commented Jun 20, 2019

I'm submitting a ... (check one with "x")

Feature

  • ( x) feature request

What is the motivation / use case for changing the behavior?

  • node-red version: ``
    v1.x

  • Node: (min. 6.x)
    node --version = 12

@biancode biancode self-assigned this Jun 20, 2019
@biancode biancode added feature request major-upgrade pull request welcome send your pull request and contribute to the project sponsors are welcome https://plus4nodered.com/ labels Jun 20, 2019
@racer77rus
Copy link

Looks like modbus node doesn't work with node-red 1.0.0. It shows "Active" state but without any output from the node. (node-red 1.0.0, nodeJS v10)

@vampywiz17
Copy link

Same with me. I try with Node-red 1.0.0 and Node JS v10

I get error if i start node-RED with console (i not remember the error message, i switch back to a previous version)

Somebody able to paste it?

@biancode
Copy link
Contributor Author

biancode commented Oct 3, 2019

@racer77rus and @vampywiz17 correct. I stopped contributing to Node-RED for now. I have to write my master thesis first.

@biancode
Copy link
Contributor Author

biancode commented Oct 5, 2019

Sponsors and interested collaborators are welcome https://contact.bianco-royal.com/

@trenty27
Copy link

trenty27 commented Oct 9, 2019

@vampywiz17

Same with me. I try with Node-red 1.0.0 and Node JS v10

I get error if i start node-RED with console (i not remember the error message, i switch back to a previous version)

Somebody able to paste it?

(node:27964) UnhandledPromiseRejectionWarning: TypeError: a is not a function at activateSending (/home/pi/.node-red/node_modules/node-red-contrib-modbus/modbus/maps/modbus-client.js:587:20) (node:27964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 719)

@biancode biancode pinned this issue Oct 9, 2019
@biancode biancode changed the title Node-RED v1.x and NodeJS 12 Node-RED v1.x and/or NodeJS 12 - not compatible Oct 9, 2019
@kpm-at-hfi
Copy link

I'm wondering if this issue title is slightly off; I think that node-red-contrib-modbus 4.1.3 has this UnhandledPromiseRejectionWarning when running in Node-RED >=1 on Node.js >=10 (not just 12 as the current title suggests).

Also, is it true that node-red-contrib-modbus 4.1.3 works fine in Node-RED <1 on Node.js >=10?

@FabioMolinaris
Copy link

FabioMolinaris commented Oct 30, 2019

@kpm-at-hfi yes, node-red-contrib-modbus works fine in Node-RED 0.20.8

I think the problem is related to the fact that Node-RED 1.0.x is fully asynchronous https://nodered.org/blog/2019/09/30/version-1-0-released#asynchronous-message-passing and is now necessary to andle promises https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

@kpm-at-hfi
Copy link

Thanks @fabiomoli ... yeah, I see now that Node-RED 0.20.8 + Node.js 10 + this module are fine. I've been kind of fixated on wanting to be on Node-RED 1.0, so wasn't thinking outside of that box.

FWIW I was able to get my company to sponsor a little bit relating to this issue... if others might be able to do that, there's a Sponsor link up top of this page. That might help. :)

@racer77rus
Copy link

It seems that the module works fine with nodejs 10 and node-red 1.0.2.

@kpm-at-hfi
Copy link

@racer77rus interedsting... what do you mean working? Are you able to communicate with modbus devices? Ethernet or serial?

FWIW, I'm definitely seeing the UnhandledPromiseRejectionWarning: TypeError: a is not a function at activateSending error reported above when I try to work with modbus serial, the cause likely being what @fabiomoli noted.

@kpm-at-hfi
Copy link

In the blog post that @fabiomoli noted above, there's an immediately depreciated runtimeSyncDelivery: true setting noted that does allow everything to work, meaning that it seems I can communicate over modbus serial using this module when running on Node-RED 1.0.2 using Node.js 10.

So that could be a short term fix for those who might need something now.

@trenty27
Copy link

trenty27 commented Oct 30, 2019

Good news. I upgraded my system to the following:
Node.js: 10.17.0
Node-RED: 1.0.2
and modbus seems to be back to a working state for me as well with 1.0.2 (I was on 1.0.1 before).

@kpm-at-hfi
Copy link

Upon reading @trenty27's comment, I redeployed the same code removing the runtimeSyncDelivery: true setting and it is working. I can't explain it.

  • Node-RED version: v1.0.2
  • Node.js version: v10.17.0
  • NPM 6.11.3
  • Linux 4.19.66-v7+ arm LE

This is a custom Docker build created using https://github.com/node-red/node-red-docker/tree/master/docker-custom

I'm flummoxed.

@biancode
Copy link
Contributor Author

All early release testers could help to test here. You could test with install cmd like:

into Node-RED
npm i https://github.com/BiancoRoyal/node-red-contrib-modbus/archive/5.0.1-alpha.0.tar.gz

or into Global NPM
npm i -g https://github.com/BiancoRoyal/node-red-contrib-modbus/archive/5.0.1-alpha.0.tar.gz

@biancode
Copy link
Contributor Author

biancode commented Dec 3, 2019

Node-RED v1.x since v5.1.0

@biancode
Copy link
Contributor Author

biancode commented Dec 8, 2019

next step to test more with v5.2.0

@biancode biancode changed the title Node-RED v1.x and/or NodeJS 12 - not compatible NodeJS 12 - not compatible Dec 8, 2019
@kpm-at-hfi
Copy link

Just a quick note that this has been working for me in initial testing. I'll be seeing this module in action more over the next two weeks and will let you know how it goes.

Thanks for working this, @biancode!

@RMutharaju
Copy link

RMutharaju commented Feb 12, 2020

Just a question, will there any further release for Modbus(v5.3.0?) to support Node.Js 12 and Node-RED 1.0.3. If yes, by when it is planned to be released?

currently, I see that Modbus v5.2.0 is not building with the above combination
refer: #176

@biancode
Copy link
Contributor Author

Please, test v5.4.0 and open a new issue information if the problem with Nodejs v12 or v13 is not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request major-upgrade pull request welcome send your pull request and contribute to the project sponsors are welcome https://plus4nodered.com/ testing
Projects
No open projects
Node-RED v1.x
  
Awaiting triage
Development

No branches or pull requests

7 participants