The latest version of Modbus package (node-red-contrib-modbus) is not working. The Modbus-tcp package does work, but doesn’t do well with having multiple connections to multiple slaves.
Once you login to your EPIC via SSH:
Use the following command:
cd /home/dev/.node-red/node_modules
sudo npm install -g node-red-contrib-modbus@4.1.1
Enter your password, and it will install the previous working version.
Restart Node-Red (https://your.ip/manage/local/node-red), Disable, Enable
Now you have a working version of the modbus client.
Over 4 years later, and the forum topic is still relevant, so I figure I would keep this thread going.
Last week I updated EPIC #1 to 3.5.1-b.85 which includes Node-RED v3.0.2 & Node.js version v14.20.0. I use node-red-contrib-modbus and after updating the EPIC firmware, I went ahead and updated this node via the manage palette menu and it updated to 5.26.0. So far, so good…
Then yesterday, I updated EPIC #2 to to 3.5.1-b.85 which includes Node-RED v3.0.2 & Node.js version v14.20.0. Update went fine, so I went into Node-RED to update node-red-contrib-modbus from 5.23.1 to 5.26.0 via the manage palette, but it does not work. Below is the log, where it indicates nodeJS >= 16.0.0 is required (at least I think that’s what it says).
2023-11-28T13:46:26.741Z Install : node-red-contrib-modbus 5.26.0
2023-11-28T13:46:27.082Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-modbus@5.26.0
2023-11-28T13:46:49.271Z [err] npm
2023-11-28T13:46:49.272Z [err] WARN deprecated vm2@3.9.19: The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.
2023-11-28T13:46:55.532Z [err] npm
2023-11-28T13:46:55.533Z [err]
2023-11-28T13:46:55.534Z [err] ERR!
2023-11-28T13:46:55.534Z [err]
2023-11-28T13:46:55.535Z [err] code
2023-11-28T13:46:55.536Z [err] ENOTSUP
2023-11-28T13:46:55.620Z [err] npm
2023-11-28T13:46:55.620Z [err] ERR! notsup Unsupported engine for serialport@12.0.0: wanted: {"node":">=16.0.0"} (current: {"node":"14.20.0","npm":"6.14.17"})
2023-11-28T13:46:55.620Z [err] npm
2023-11-28T13:46:55.621Z [err] ERR! notsup Not compatible with your version of node/npm: serialport@12.0.0
2023-11-28T13:46:55.621Z [err] npm
2023-11-28T13:46:55.621Z [err] ERR! notsup Not compatible with your version of node/npm: serialport@12.0.0
2023-11-28T13:46:55.621Z [err] npm
2023-11-28T13:46:55.621Z [err] ERR! notsup Required: {"node":">=16.0.0"}
2023-11-28T13:46:55.621Z [err] npm
2023-11-28T13:46:55.622Z [err] ERR! notsup Actual: {"npm":"6.14.17","node":"14.20.0"}
2023-11-28T13:46:55.658Z [err]
2023-11-28T13:46:55.659Z [err] npm ERR! A complete log of this run can be found in:
2023-11-28T13:46:55.659Z [err] npm ERR! /home/dev/.npm/_logs/2023-11-28T13_46_55_640Z-debug.log
2023-11-28T13:46:55.713Z rc=1
…but that also did not work and gave me a log of errors, the most relevant of which seems to be:
[err] WARN install No prebuilt binaries found (target=14.20.0 runtime=node arch=arm libc= platform=linux)
What should I do to get over this hump? It seems installing Node.js v16 would fix everything, but strangely last week on EPIC #1, we were able to update node-red-contrib-modbus to 5.26.0.
Rebuilding is not the right thing to do here as you found.
Also we are working on getting to nodejs v 16 (but probably not since - sorry cant find the link with details - nodejs had some issues and had to ‘dump’ an entire release in there somewhere - so we are planing on jumping past 16 I seem to recall), but its going to be some time out.
Anyway, point is, updating nodejs is not going to be an option, so just use the groov Manage install specific version of a node tool to get back to where you need to be.
Thanks Ben. v5.23.0 of node-red-contrib-modbus is now working (it was not earlier, and rather than troubleshoot, I went straight to the upgrade button on the palette manager). It’s a fairly complex flow that scrapes data from several different slave ID’s, passes over any that are off, etc.
@grant1 I think it because the “serialport” updated to 12.0.0, and node-red-contrib-modbus will install this module also. That’s why few weeks before the EPIC can install 5.26.0, but not now. @Beno Is there any way to solve this ? We got the same issues, the EPIC which run at before is fine with 5.26.0, but not the new EPIC.
Hi Beno,
We use the groov Manage to install node-red-contrib-modbus 5.23.0, but the error log as below :
npm ERR! notsup Not compatible with your version of node/npm: serialport@12.0.0
npm ERR! notsup Not compatible with your version of node/npm: serialport@12.0.0
npm ERR! notsup Required: {“node”:“>=16.0.0”}
npm ERR! notsup Actual: {“npm”:“6.14.17”,“node”:“14.20.0”}
What is the reason that @grant1 can installed 5.23.0 in his EPIC but not mine ?
Thanks for your help.
This has turned into a bit of a rabbit hole.
Just know I have spent a few hours on it already today, @torchard and I are now working on it and will report back once we have some clarity.
Oddly enough, I successfully installed v5.0. In this case, I entered just ‘5’ as the version -and it took. My palette says the version is 5.23 and this was on an M2 RIO with firmware 3.5.0
UPDATE: Aug 2024.
This ‘single digit version trick’ only works for EPIC and RIO firmware less than ~3.4
For 3.6.0 you need to enter the full version of the Modbus node package: 5.30.0
Again, sorry for the delay on this one.
Last week we had our schedualed factory training class here at Opto, both Terry and I teach a few classes and it takes some time away from our desks to do that.
In short, whats happening is that the node-red-contrib-modbus node is made up of other nodes. (42 in total). Some of those nodes have a specific version of nodejs they need. In other words, the software authors of those nodes have updated those dependencies and it is higher than the nodejs version installed on EPIC / RIO.
In some cases, some of those nodes have not changed, but the nodes they depend on have changed.
I have been slowly working my way through the combination of all 42 nodes looking for the highest low version I could install with the nodejs v14 that we are using.
As you can imagine, it was taking some time and I needed to reinstall the EPIC firmware here and there and retrace my steps to ensure the version trail was ‘clean’ and working up to the point where it broke.
Thanks so much for the community stepping up in this issue.
I cant understand how simply putting the version ‘5’ to install is getting around all the versions, but it did.
I watched the live install log carefully and it was amazing to see the versions fall into place as per the notes I had.
I will be sending this ‘one weird trick’ to our support group and lead engineers.
Thanks @Beno, happy to help out. Without getting deep into the weeds on this, the resolution has to do with the fact that NodeRed has the ability to resolve dependent issues within a Node as long as the version is compatible specifically within the particular Node.js revision. In this case, v5 spans versions 2 and 3, as well as multiple Node.js revisions as well. I would assume the only reason that this actually worked was because the Node.js 14.2…16+ were fundamentally compatible, at least with regard to this modbus package.
TLDR: Awesome it worked, I wouldn’t expect it to every time.
Has a solution been found for this issue? I am currently attempting to install node-red-contrib-modbus while running node v 14.20 and npm v 6.14.17. The error received is ‘notsup Not Compatible with your version of node/npm: node-red-contrib-modbus@5.42.0’ and attempts to install older node versions have been unsuccessful. It appears to need node 18.5 or greater to install.
Yes, the work-around is two posts up.
My post shows that putting a ‘5’ in the install will install the most current old version.
99.9% of folks have got up and running with that version.
We are still working hard to release the new firmware by the end of the year that updates a lot of the libraries, including the version of nodeJS.
When attempting to install version 5 the error ’ An error occurred while installing the node package’ and the following log is generated.
[err] npm
[err]
[err] WARN
[err] registry
[err] Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ECONNREFUSED: request to https://registry.npmjs.org/node-red-contrib-modbus failed, reason: connect ECONNREFUSED 104.16.1.35:443
[err]
[err] npm
[err] WARN
[err]
[err] registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
[err]
[err] npm
[err] ERR!
[err] code
[err] ENOTSUP
[err]
[err] npm
[err] ERR! notsup
[err] Unsupported engine for node-red-contrib-modbus@5.42.0: wanted: {“node”:“>=18.5”} (current: {“node”:“14.20.0”,“npm”:“6.14.17”})
[err]
[err] npm
[err] ERR!
[err] notsup
[err] Not compatible with your version of node/npm: node-red-contrib-modbus@5.42.0
[err]
[err] npm
[err] ERR!
[err] notsup Not compatible with your version of node/npm: node-red-contrib-modbus@5.42.0
[err] npm
[err] ERR!
[err] notsup Required: {“node”:“>=18.5”}
[err]
[err] npm ERR! notsup Actual: {“npm”:“6.14.17”,“node”:“14.20.0”}
[err]
[err]
[err]
[err] npm
[err] ERR!
[err] A complete log of this run can be found in:
[err] npm
[err]
[err] ERR! /home/dev/.npm/_logs/2024-08-21T13_57_51_952Z-debug.log
[err]