I am having trouble getting Node-Red to read data from com1
I have Node-Red setup on docker because I could not get it to work on my windows system with Node.JS
Node-Red
1.2.7
node-red-contrib-modbus
5.13.3
I am trying to create a basic Modbus to MQTT translator.
When I have a Modbus Read node linked to a debug node nothing happens because Modbus Read node says reconnecting all the time, not active? Is this because node red can read from the host machines com1 port?
How do I allow nod red to access com1?
I have a Modbus app on desktop that can read the device on com1.
Setting up on windows is quite simple and will reduce the complexity. If you dont need docker (or you are not up to speed on docker), its best to avoid it (IMO)
The official instructions have never failed to work for me on windows...
I'm happy to setup node.js and yes it was simple , But I had a error and the server would not start.
Is there a way to just reinstall node-red under nod.js?
27 Jan 21:46:36 - [info] Starting flows
27 Jan 21:46:36 - [info] Started flows
27 Jan 21:46:37 - [red] Uncaught Exception:
27 Jan 21:46:37 - Error: Could not locate the bindings file. Tried:
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\build\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\build\Debug\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\build\Release\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\out\Debug\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\Debug\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\out\Release\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\Release\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\build\default\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\compiled\15.6.0\win32\x64\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\addon-build\release\install-root\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\addon-build\debug\install-root\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\addon-build\default\install-root\bindings.node
→ C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\lib\binding\node-v88-win32-x64\bindings.node
at bindings (C:\Users\Admin.node-red\node_modules\bindings\bindings.js:126:9)
at Object. (C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\lib\win32.js:1:36)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object. (C:\Users\Admin.node-red\node_modules\modbus-serial\node_modules@serialport\bindings\lib\index.js:6:22)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
This is the errors I am getting when I install the Modbus package
C:\Users\Admin>npm install -g node-red-contrib-modbus
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
> @serialport/bindings@8.0.8 install C:\Users\Admin\AppData\Roaming\npm\node_modules\node-red-contrib-modbus\node_modules\modbus-serial\node_modules\@serialport\bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=15.6.0 runtime=node arch=x64 libc= platform=win32)
C:\Users\Admin\AppData\Roaming\npm\node_modules\node-red-contrib-modbus\node_modules\modbus-serial\node_modules\@serialport\bindings>if not defined npm_config_node_gyp (node "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp: C:\Users\Admin\AppData\Local\node-gyp\Cache\15.6.0\common.gypi not found (cwd: C:\Users\Admin\AppData\Roaming\npm\node_modules\node-red-contrib-modbus\node_modules\modbus-serial\node_modules\@serialport\bindings) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (node:events:379:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:285:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Admin\AppData\Roaming\npm\node_modules\node-red-contrib-modbus\node_modules\modbus-serial\node_modules\@serialport\bindings
gyp ERR! node -v v15.6.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2021-01-27T09_03_38_509Z-debug.log
C:\Users\Admin>