SIEMENS IOT 2000 - Node - Red ("simatic_iot2000", node)

I thought you said the node was not available any more.

Yeah the node is not available but in node-red library.
The node node-red-contrib-iot2000-gpio it's a custom node so to install it i have to move the folder where the node is, to the node_modules folder. This node works in other IOT 2k that i have.

When i try to install it using comands and with the folder of the node node-red-contrib-iot20000-gpio inside .node-red/node_modules my cmd show me this:

> PS C:\Users\Manuel\.node-red\node_modules> npm i .\node-red-contrib-iot2000-gpio\
> npm WARN tarball tarball data for node-red-contrib-iot2000-gpio@file:node-red-contrib-iot2000-gpio (null) seems to be corrupted. Trying again.
> npm WARN tarball tarball data for node-red-contrib-iot2000-gpio@file:node-red-contrib-iot2000-gpio (null) seems to be corrupted. Trying again.
> npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
> npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
> npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
> npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
> npm ERR! code ENOENT
> npm ERR! syscall open
> npm ERR! path C:\Users\Manuel\.node-red\node_modules\node-red-contrib-iot2000-gpio/package.json
> npm ERR! errno -4058
> npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Manuel\.node-red\node_modules\node-red-contrib-iot2000-gpio\package.json'
> npm ERR! enoent This is related to npm not being able to find a file.
> npm ERR! enoent
> 
> npm ERR! A complete log of this run can be found in:
> npm ERR!     C:\Users\Manuel\AppData\Local\npm-cache\_logs\2022-10-06T09_41_38_161Z-debug-0.log
> PS C:\Users\Manuel\.node-red\node_modules> npm i -g .\node-red-contrib-iot2000-gpio\
> 
> up to date, audited 3 packages in 1s
> 
> found 0 vulnerabilities
> PS C:\Users\Manuel\.node-red\node_modules>

When i move it to the folder /.node-red/node_modules, it's installed and appears like i show you in the photo before this messages, but not let me use it.
If i run the comand node-red inside C:\Users\User\.node-red, it's appear a line that says:
6 Oct 11:52:44 - [info] Waiting for missing types to be registered:
6 Oct 11:52:44 - [info] - iot2000-gpio-din

PS C:\Users\User\.node-red> node-red
6 Oct 11:52:40 - [info] 

Welcome to Node-RED
===================

6 Oct 11:52:40 - [info] Node-RED version: v0.16.2
6 Oct 11:52:40 - [info] Node.js  version: v16.15.0
6 Oct 11:52:40 - [info] Windows_NT 10.0.22000 x64 LE
6 Oct 11:52:43 - [info] Loading palette nodes
6 Oct 11:52:44 - [warn] ------------------------------------------------------
6 Oct 11:52:44 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
6 Oct 11:52:44 - [warn] [tail] Not currently supported on Windows.
6 Oct 11:52:44 - [warn] [iot2000-gpio-din] Error: \\?\C:\Users\Manuel\.node-red\node_modules\mraa\mraa.node is not a valid Win32 application.
\\?\C:\Users\Manuel\.node-red\node_modules\mraa\mraa.node
6 Oct 11:52:44 - [warn] [iot2000-gpio-userled] Error: \\?\C:\Users\Manuel\.node-red\node_modules\mraa\mraa.node is not a valid Win32 application.
\\?\C:\Users\Manuel\.node-red\node_modules\mraa\mraa.node
6 Oct 11:52:44 - [warn] ------------------------------------------------------
6 Oct 11:52:44 - [info] Settings file  : \Users\Manuel\.node-red\settings.js
6 Oct 11:52:44 - [info] User directory : \Users\Manuel\.node-red
6 Oct 11:52:44 - [info] Flows file     : \Users\Manuel\.node-red\flows_DESKTOP-7PT0EQL.json
6 Oct 11:52:44 - [info] Server now running at http://127.0.0.1:1880/
6 Oct 11:52:44 - [info] Waiting for missing types to be registered:
6 Oct 11:52:44 - [info]  - iot2000-gpio-din
(node:22640) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)

I know that this usually happens with customs nodes but i don't know how to solve it.

You could try the method I suggested (which is not what you have done). To save you looking back I will repeat it here below, but first remove it from wherever you have currently put it. Also before you do it run, from the .node-red folder
npm list node-red-contrib-iot2000-gpio
and
npm list -g node-red-contrib-iot2000-gpio
If either of those show anything then ask here what to do.

This is what I suggested previously to install it.
If you look, on the working one, in the folder .node-red/node_modules you should find a folder with the name of the installed node. node-red-contrib-iot2000-gpio. If you copy that complete folder from the working one to a new folder on the new one, but not inside the .node-red folder, then go into the .node-red folder and run
npm install /path/to/node-red-contrib-iot2000-gpio [Note: do not use -g]
then it should install it from there. Restart node-red, refresh the browser window and it should be available in the palette. Don't delete the folder you copied it to, that needs to stay there.

Sorry i didn't know what you were meaning in the other message, my bad.

When i use de comand npm list node-red-contrib-iot2000-gpio, this shows me:

C:\Users\User\.node-red>npm list node-red-contrib-iot2000-gpio
.node-red@ C:\Users\User\.node-red
`-- node-red-contrib-iot2000-gpio@1.0.0 -> .\..\GoodWorkOEE\node-red-contrib-iot2000-gpio


C:\Users\User\.node-red>npm list -g node-red-contrib-iot2000-gpio
C:\Users\User\AppData\Roaming\npm
`-- node-red-contrib-iot2000-gpio@1.0.0 -> .\..\..\..\GoodWorkOEE\node-red-contrib-iot2000-gpio


C:\Users\User\.node-red>

In the working one, i found the node /usr/lib/node_modules/ not in /.node-red/node_modules.

When I install it like you say the cmd shows me this:

C:\Users\User\.node-red>npm install C:\Users\User\GoodWorkOEE\node-red-contrib-iot2000-gpio
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

added 1 package, and audited 344 packages in 4s

3 packages are looking for funding
  run `npm fund` for details

20 vulnerabilities (1 low, 3 moderate, 15 high, 1 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

C:\Users\Manuel\.node-red>

This is the log when i start it:

C:\Users\Manuel\.node-red>node-red
6 Oct 14:31:18 - [info]

Welcome to Node-RED
===================

6 Oct 14:31:18 - [info] Node-RED version: v0.16.2
6 Oct 14:31:18 - [info] Node.js  version: v16.15.0
6 Oct 14:31:18 - [info] Windows_NT 10.0.22000 x64 LE
6 Oct 14:31:19 - [info] Loading palette nodes
6 Oct 14:31:20 - [warn] ------------------------------------------------------
6 Oct 14:31:20 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
6 Oct 14:31:20 - [warn] [tail] Not currently supported on Windows.
6 Oct 14:31:20 - [warn] [iot2000-gpio-din] Error: Cannot find module 'mraa'
Require stack:
- C:\Users\User\GoodWorkOEE\node-red-contrib-iot2000-gpio\iot2000-gpio-din.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\nodes\registry\loader.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\nodes\registry\index.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\nodes\index.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\index.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\red.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red.js
6 Oct 14:31:20 - [warn] [iot2000-gpio-userled] Error: Cannot find module 'mraa'
Require stack:
- C:\Users\User\GoodWorkOEE\node-red-contrib-iot2000-gpio\iot2000-gpio-userled.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\nodes\registry\loader.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\nodes\registry\index.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\nodes\index.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\runtime\index.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red\red.js
- C:\Users\User\AppData\Roaming\npm\node_modules\node-red\red.js
6 Oct 14:31:20 - [warn] ------------------------------------------------------
6 Oct 14:31:20 - [info] Settings file  : \Users\User\.node-red\settings.js
6 Oct 14:31:20 - [info] User directory : \Users\User\.node-red
6 Oct 14:31:20 - [info] Flows file     : \Users\User\.node-red\flows_DESKTOP-7PT0EQL.json
6 Oct 14:31:20 - [info] Waiting for missing types to be registered:
6 Oct 14:31:20 - [info]  - iot2000-gpio-din
6 Oct 14:31:20 - [info] Server now running at http://127.0.0.1:1880/

Start by removing the versions you have previously installed. In the .node-red folder run
npm remove node-red-contrib-iot2000-gpio
and
npm remove -g node-red-contrib-iot2000-gpio
Then run the two npm list commands again and make sure they are gone.
Then run the install again as you did before. It may not help but it may do so.

I did both remove comands:

C:\Users\Manuel\.node-red>npm remove node-red-contrib-iot2000-gpio
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

up to date, audited 345 packages in 11s

3 packages are looking for funding
  run `npm fund` for details

21 vulnerabilities (1 low, 5 moderate, 14 high, 1 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

C:\Users\User\.node-red>npm remove -g node-red-contrib-iot2000-gpio

removed 1 package, and audited 1 package in 300ms

found 0 vulnerabilities

I repeat the npm list commands:

C:\Users\User\.node-red>npm list node-red-contrib-iot2000-gpio
.node-red@ C:\Users\Manuel\.node-red
`-- (empty)


C:\Users\User\.node-red>npm list -g node-red-contrib-iot2000-gpio
C:\Users\User\AppData\Roaming\npm
`-- (empty)


C:\Users\Manuel\.node-red>

And then, i did the install commands like you said, installing the node from a folder out of .node-red.
This shows:

C:\Users\Manuel\.node-red>npm install C:\Users\Manuel\GoodWorkOEE\node-red-contrib-iot2000-gpio
npm WARN deprecated bcrypt@3.0.8: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

added 1 package, and audited 345 packages in 2s

3 packages are looking for funding
  run `npm fund` for details

21 vulnerabilities (1 low, 5 moderate, 14 high, 1 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

C:\Users\Manuel\.node-red>

So if you restart node-red and refresh the browser is it now working?

Hi Colin!

Doing that it wasn't working for me but after trying so many things, i found one that helps me at least shows me the node and let me use it that int's insç

image

When i said this:

I started looking for a solution using that, because that usually happens with custom nodes. In the .js code you must change the line module.exports = function(RED) (with "s" the word export) for module.export = function(RED) (with out "s" the word export). I did that and let me use it at least appears in my node-red and i can configure it, i need to try it in the IOT 2000 and in the SD but in my PC i can use it.

Link: Waiting for missing types to be registered - #13 by peret2000

Thank you so much for you help and taking your time trying to help me, i got a lot of knowledges beacause of you!! I'll write here again when i used it if it works.

I think the 'correct' fix might have been to go into the folder node-red-contrib-iot2000-gpio where you copied the node to and run
npm install
which should install the additional dependencies required there. Then restart node-red again.

Hi Colin!

I've got the node "node-red-contrib-iot2000-gpio". I'm working in the new IOT right now, i moved the node in the /usr/lib/node/node-red/node_modules/

It appears but when i go to "localhost:1880" i see this:

Its' like the node appears but i see this error

"

Flows stopped due to missing node types.

  • iot2000-gpio-din

"

I'm trying to put something in the movement sensor but in the log doesn't appear anything in the "debug"

That is not something I suggested.

Have you tried following my suggestions?

Hi @ManuGW!
Can you provide the code of the flow please?
Thank you!

Hi Colin!

Sorry to bother you again

So the thing is inside the IOT,when you install the nodes i if you enter npm install xxxxx then the node is installed at the actual folder (show with pwd):

/home/root

if you enter npm -g install xxxxx then the node is installed always globally in this folder:

/usr/lib/node_modules

So i need to install it in /.node-red/node_modules by using:

  • a new folder for the node (out of /.node-red)
  • this command npm install /path/to/node-red-contrib-iot2000-gpio in ./node-red
  • then restart node-red

And this error that "the node is missing" it will be dissapear?

I didn't realise the device has a non-standard node-red setup. How did you install the node on the working system, and where did it put the code?

The code i edited it with notepad the .js file.
I have the nodes in /usr/ib/node_modules/ which is known as the global folders for the nodes, i installed them moving the folder of the node to that one.

[EDIT]: When i try to install it in the folder /home/root/.node-red/node_modules it appears this error:

root@iot2000:~/.node-red# npm install /home/root/nodos/node-red-contrib-iot2000-                                                                                                                                                             gpio
node: WARN: Check failed in ../deps/v8/src/deoptimizer.cc:1981 - ignoringalTree
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellane                                                                                                                                                             ous Warning EAI_AGAIN: request to https://registry.npmjs.org/bindings failed, re                                                                                                                                                             ason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm WARN registry Using stale package data from https://registry.npmjs.org/ due                                                                                                                                                              to a request error during revalidation.
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/@serialport%2fbinding-abstract fa                                                                                                                                                             iled, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/root/.npm/_logs/2022-10-10T12_15_34_460Z-debug.log

So on the original system that worked, you did not install from npm?

I don't know how that was done, i didn't do it was an ex coworker. So i'm trying to do it now but without documentation how it was done.

Before running npm install /home/root/nodos/node-red-contrib-... did you go into /home/root/nodos and run
npm install
Just that, do not specify the node name.

Oh that's true i skipped that i will try

I did it and appear errors too

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/root/nodos/package.json'
npm WARN nodos No description
npm WARN nodos No repository field.
npm WARN nodos No README data
npm WARN nodos No license field.

up to date in 24.512s
root@iot2000:~/nodos# npm install^C
root@iot2000:~/nodos# cd ..
root@iot2000:~# cd .node-red/

root@iot2000:~/.node-red# npm install /home/root/nodos/node-red-contrib-iot2000-gpio
node: WARN: Check failed in ../deps/v8/src/deoptimizer.cc:1981 - ignoringalTree
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to https://registry.npmjs.org/bindings failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/@serialport%2fbinding-abstract failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/root/.npm/_logs/2022-10-10T13_51_29_868Z-debug.log
root@iot2000:~/.node-red# ^C
root@iot2000:~/.node-red#