Odroid-io crashes nodered

hello!

I am Running node-red 1.3.0-beta.1 with node.js V 12.11.1 on Odroid C2 on Kernel 5.14.19 .

I installed
npm install johnny-five

with no problems

then I installed

npm install odroid-io

with no problems either.

But as soon a node (in my case node-red-contrib-gio: gpio-in ) uses the "Odroid-io" plugin , node-red crashed with:

TypeError: Cannot read property 'index' of undefined
    at OdroidIO.normalize (/home/odroid/node_modules/odroid-io/lib/odroid-io.js:182:32)
    at OdroidIO.pinMode (/home/odroid/node_modules/odroid-io/lib/odroid-io.js:189:33)
    at iopluginNode.<anonymous> (/home/odroid/.node-red/node_modules/node-red-contrib-gpio/gpio.js:82:20)
    at iopluginNode.emit [as _emit] (events.js:210:5)
    at iopluginNode.Node.emit (/home/odroid/.nvm/versions/node/v12.11.1/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:181:20)
    at /home/odroid/.node-red/node_modules/node-red-contrib-gpio/lib/iopluginNode.js:38:16
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at processImmediate (internal/timers.js:412:9)
    at process.topLevelDomainCallback (domain.js:131:23)
**1 Mar 04:27:06 - [red] Uncaught Exception:
1 Mar 04:27:06 - TypeError: Cannot read property 'index' of undefined**
    at OdroidIO.normalize (/home/odroid/node_modules/odroid-io/lib/odroid-io.js:182:32)
    at OdroidIO.digitalRead (/home/odroid/node_modules/odroid-io/lib/odroid-io.js:225:23)
    at iopluginNode.<anonymous> (/home/odroid/.node-red/node_modules/node-red-contrib-gpio/gpio.js:83:14)
    at iopluginNode.emit [as _emit] (events.js:210:5)
    at iopluginNode.Node.emit (/home/odroid/.nvm/versions/node/v12.11.1/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:181:20)
    at /home/odroid/.node-red/node_modules/node-red-contrib-gpio/lib/iopluginNode.js:38:16
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at processImmediate (internal/timers.js:412:9)
    at process.topLevelDomainCallback (domain.js:131:23)

Does anyone know how to fix this?

  1. why are you running Node-RED 1.3.0-beta.1? The final v1.xx release is v1.3.7 so if you are going to use v1.xxx you should be on that release.

  2. I see you have opened an issue on the GitHub page for odroid-io. That is probably the best way to get an answer.

Hello!

tanks for your answer.
Yes I do - will.

But how to update best from 1.3.0-beta.1 to 1.37 ( and finally to nodered v2.xxx), please?

I just upgraded from node.js 12.11.1 tp 17.1.0.

now odroid-io not crashing nodered anymore but get the following: ??
weird:

error loading plugin odroid-io The module '/home/odroid/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 102. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

Why did you jump to node.js v17.1.0? I would go to v16 at the current point in time

That error is saying that odroid-io was compiled with a different version of Node.js. You could try compiling it but I'd still be looking to the author of the odroid-io node for help.

After a major version upgrade of nodejs you must go into the .node-red folder and run
npm rebuild
But as pointed out already, don't use V17, use an LTS version which is 16 (or 14 or 12).

I will try

I give up guys!

I tried everything:

I am on nodered 2.1.3 now and everything works stable, so far.

But then I install node-red-contrib-johnny5 (from palette) and the ioplugin:

odroid-io

with npm install odroid-io

which seems to be a prererequisite for the johnny5 - nodes.

Unfortunately there is neither for the johnny5 node nore @ hte odroid-io plug in ANY support at all:

Unfortunately due to my situation (odroid, Kernel 5) and the spec of the johnny5 node, there is no other alternative in terms of gpiod!

However, no matter which config I use - absolutely no luck.. I had the configs:

nvm 12.22.1
npm 6.14.15 (or 8.1.3)
nvm 14.18.1
npm 8.1.3
nvom 16.13.0
npm 8.1.3

no luck

I am kind of stuck having npm install or npm rebuild kicking out my node-red-contrib-johnny5 node as well as my odroid-io config node, du to several errors and incompatibilities!

please help.

I have huge project here where we switched from kernel 3.16.85 (gipio ion sysfs, wiringpi (Gordon's) all the way up to 5.13.14 (gpiod, but odroid --> no wiringpi support anymore, gpiod only for raspi) and now I need to get my GPIOs going again on node red!!

However,

I identified another posibility for gpio on odroid using gpiod:
https://forum.odroid.com/viewtopic.php?f=180&t=37543&p=338112#p338112

but:

droid@odroid:~/.node-red$ npm install node-red-contrib-lot --force
npm WARN using --force Recommended protections disabled.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /home/odroid/.node-red/node_modules/lot-gpio
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/odroid/.node-red/node_modules/lot-gpio/build'
npm ERR!   CC(target) Release/obj.target/nothing/node_modules/node-addon-api/src/nothing.o
npm ERR!   AR(target) Release/obj.target/node_modules/node-addon-api/src/nothing.a
npm ERR!   COPY Release/nothing.a
npm ERR!   CXX(target) Release/obj.target/lot/c_src/lot.o
npm ERR! lot.target.mk:119: recipe for target 'Release/obj.target/lot/c_src/lot.o' failed
npm ERR! make: Leaving directory '/home/odroid/.node-red/node_modules/lot-gpio/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@5.0.7
npm ERR! gyp info using node@12.11.1 | linux | arm64
npm ERR! gyp info find Python using Python version 2.7.17 found at "/usr/bin/python"
npm ERR! gyp info spawn /usr/bin/python
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/odroid/.node-red/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/odroid/.node-red/node_modules/lot-gpio/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/odroid/.node-red/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/odroid/.cache/node-gyp/12.11.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/odroid/.cache/node-gyp/12.11.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/odroid/.node-red/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/odroid/.cache/node-gyp/12.11.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/odroid/.node-red/node_modules/lot-gpio',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../c_src/lot.cpp:28:0:
npm ERR! ../c_src/GpioWrapper.h:28:10: fatal error: lot/Gpio.h: No such file or directory
npm ERR!  #include <lot/Gpio.h>
npm ERR!           ^~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [Release/obj.target/lot/c_src/lot.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/odroid/.node-red/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
npm ERR! gyp ERR! System Linux 5.14.16-arm64
npm ERR! gyp ERR! command "/home/odroid/.nvm/versions/node/v12.11.1/bin/node" "/home/odroid/.node-red/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/odroid/.node-red/node_modules/lot-gpio
npm ERR! gyp ERR! node -v v12.11.1
npm ERR! gyp ERR! node-gyp -v v5.0.7
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/odroid/.npm/_logs/2021-11-11T13_46_58_154Z-debug.log

My understanding of how node-red works in the background ends here.
Do you have any ideas about this failure?

I would open an issue on the node's GitHub issues page and see what the author of the node has to say.

github - new issue is disabled interestingly.

but: placed it here:
https://forum.odroid.com/viewtopic.php?f=180&t=37543

with kind regards.

however its really sad. no gpiod supprt on ARM64 boards for node-red.

I searched a lot - but no way.

Since Kernel 4.8 and since Gordon killed his support the Odroid Users plummeted in a Node-red GPIO(D)-hole, which is really hard to escape.

Throughout the pinning mess over all the different platforms it's absolutly understandable on one side that the developers give up on maintain node-red modules like "odroid-io" for the johnny-five" community or

"what-ever-contrib-pi-gpiod"

developers conectrate on Raspi leaving odroid behind but on the other hand thats sad. Thats sad, really sad.

However gpiomon is NOT working on modern kernels yet on Ondroid at all becuse the interrupt() was not set for the pins, but thats a whole lot a different story ......
(help gpio irq mainline kernel - ODROID)

However if some one (probably @Kolleary @Colin ) has an idea how to overcome this please HELP!

I have had a couple of Odroids myself (XU4 and N2) that I used earlier. At the time they arrived they performed very well in comparison with previous versions of the RPi. I remember there was special also in the OS and special when you had to keep them updated. So today they are retired, the XU4 is since long recycled. For me this was not a problem to move on to other devices since it was only for personal usage. For you, if you have a large customer project, I understand the problems are much worse

Your C2 is listed as obsolete/discontinued. It is of course not good news for you and it could cause huge problems if you have a large project as you say and later will run out of spare parts/replacements. Time to think about migrating to a newer platform? Or consider another topologi for your I/O controls, using separate boards instead