# Read COM1 Port Data

**URL:** <https://discourse.nodered.org/t/read-com1-port-data/39844>\
**Category:** General\
**Created:** [27 January 2021 08:34 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844 "2021-01-27T08:34:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaughan.mcd](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@vaughan.mcd](https://discourse.nodered.org/u/vaughan.mcd)\
**Post date:** [27 January 2021 08:34 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/1 "2021-01-27T08:34:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 January 2021 08:40 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/2 "2021-01-27T08:40:46Z")

</div>

> [@vaughan.mcd](#):
>
> I have Node-Red setup on docker because I could not get it to work on my windows system with Node.JS

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

[https://nodered.org/docs/getting-started/windows](https://nodered.org/docs/getting-started/windows)

---

<div class="post-metadata">

**Author:** ![vaughan.mcd](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@vaughan.mcd](https://discourse.nodered.org/u/vaughan.mcd)\
**Post date:** [27 January 2021 08:49 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/3 "2021-01-27T08:49:52Z")

</div>

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)

C:\Users\Admin\>

---

<div class="post-metadata">

**Author:** ![vaughan.mcd](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@vaughan.mcd](https://discourse.nodered.org/u/vaughan.mcd)\
**Post date:** [27 January 2021 09:06 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/4 "2021-01-27T09:06:05Z")

</div>

This is the errors I am getting when I install the Modbus package

```auto
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>

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 January 2021 09:19 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/5 "2021-01-27T09:19:12Z")

</div>

Do you have [build tools](https://nodered.org/docs/getting-started/windows#installing-nodejs-windows-build-tools) installed?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 January 2021 09:26 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/6 "2021-01-27T09:26:38Z")

</div>

Also, it looks like you have installed NODE V15 - this is not recommended. V14 works fine.

---

<div class="post-metadata">

**Author:** ![vaughan.mcd](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@vaughan.mcd](https://discourse.nodered.org/u/vaughan.mcd)\
**Post date:** [27 January 2021 09:27 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/7 "2021-01-27T09:27:33Z")

</div>

No but I have just added the tools now, Not sure how to use them?

I notice that the problem happens when I install Modbus package, When I delete the Node-Red folder in the user directory, Node red will restart again,

````auto

-----------------------------------------------------------
2021-01-27T09:23:47.622Z Install : node-red-contrib-modbus 5.13.3

2021-01-27T09:23:47.940Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-modbus@5.13.3
2021-01-27T09:23:49.342Z [err] 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)
2021-01-27T09:23:54.738Z [out] 
2021-01-27T09:23:54.738Z [out] > @serialport/bindings@8.0.8 install C:\Users\Admin\.node-red\node_modules\modbus-serial\node_modules\@serialport\bindings
2021-01-27T09:23:54.738Z [out] > prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2021-01-27T09:23:54.738Z [out] 
2021-01-27T09:23:55.345Z [err] prebuild-install WARN 
2021-01-27T09:23:55.345Z [err] install No prebuilt binaries found (target=15.6.0 runtime=node arch=x64 libc= platform=win32)
2021-01-27T09:23:55.354Z [out] 
2021-01-27T09:23:55.354Z [out] C:\Users\Admin\.node-red\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 ) 
2021-01-27T09:23:56.367Z [err] gyp: C:\Users\Admin\AppData\Local\node-gyp\Cache\15.6.0\common.gypi not found (cwd: C:\Users\Admin\.node-red\node_modules\modbus-serial\node_modules\@serialport\bindings) while reading includes of binding.gyp while trying to load binding.gyp
2021-01-27T09:23:56.371Z [err] gyp
2021-01-27T09:23:56.371Z [err] ERR! configure error 
2021-01-27T09:23:56.372Z [err] gyp 
2021-01-27T09:23:56.372Z [err] ERR! stack Error: `gyp` failed with exit code: 1
2021-01-27T09:23:56.372Z [err] gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
2021-01-27T09:23:56.372Z [err] gyp
2021-01-27T09:23:56.372Z [err] ERR! stack at ChildProcess.emit (node:events:379:20)
2021-01-27T09:23:56.372Z [err] gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:285:12)
2021-01-27T09:23:56.372Z [err] gyp ERR!
2021-01-27T09:23:56.372Z [err] System Windows_NT 10.0.19042
2021-01-27T09:23:56.372Z [err] 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"
2021-01-27T09:23:56.372Z [err] gyp ERR! cwd C:\Users\Admin\.node-red\node_modules\modbus-serial\node_modules\@serialport\bindings
2021-01-27T09:23:56.372Z [err] gyp ERR! node -v
2021-01-27T09:23:56.372Z [err] v15.6.0
2021-01-27T09:23:56.372Z [err] gyp ERR! node-gyp -v v5.1.0
2021-01-27T09:23:56.372Z [err] gyp 
2021-01-27T09:23:56.372Z [err] ERR! not ok 
2021-01-27T09:23:56.468Z [err] npm ERR! code ELIFECYCLE
2021-01-27T09:23:56.468Z [err] npm ERR! errno 1
2021-01-27T09:23:56.479Z [err] npm ERR! @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
2021-01-27T09:23:56.479Z [err] npm ERR! Exit status 1
2021-01-27T09:23:56.479Z [err] npm ERR! 
2021-01-27T09:23:56.479Z [err] npm ERR! Failed at the @serialport/bindings@8.0.8 install script.
2021-01-27T09:23:56.479Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-01-27T09:23:56.497Z [err] 
2021-01-27T09:23:56.497Z [err] npm
2021-01-27T09:23:56.497Z [err] ERR! A complete log of this run can be found in:
2021-01-27T09:23:56.497Z [err] npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2021-01-27T09_23_56_481Z-debug.log
2021-01-27T09:23:56.511Z rc=1```
````

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 January 2021 09:28 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/8 "2021-01-27T09:28:39Z")

</div>

I would strongly recommend starting over.

1. install node V14
2. install build tools
3. install node-red
4. install modbus node

---

<div class="post-metadata">

**Author:** ![vaughan.mcd](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@vaughan.mcd](https://discourse.nodered.org/u/vaughan.mcd)\
**Post date:** [27 January 2021 09:34 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/9 "2021-01-27T09:34:26Z")

</div>

Ok will try that, How do I install a specific version

this was how I reinstalled Node-Red last time

```auto
npm install -g --unsafe-perm node-red

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 January 2021 09:36 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/10 "2021-01-27T09:36:34Z")

</div>

> [@vaughan.mcd](#):
>
> How do I install a specific version

Of Nodejs? You download the V14 instead of V15.

For npm, you would add `@x.y.z` e.g. `npm install mynode@1.2.3`

---

<div class="post-metadata">

**Author:** ![vaughan.mcd](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@vaughan.mcd](https://discourse.nodered.org/u/vaughan.mcd)\
**Post date:** [27 January 2021 09:52 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/11 "2021-01-27T09:52:39Z")

</div>

That was it , All working now, and I can see the com port,  
Thank You

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 February 2021 09:53 UTC](https://discourse.nodered.org/t/read-com1-port-data/39844/12 "2021-02-10T09:53:32Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
