New to nodered and first problem

Hi all,

very new to nodered; I am using it with this contribution to control my HomeAutomation SW (running on a MacMini);
I did the same setup with nodejs 12.14.1 and nodered 1.0.3 and on a machine is working fine, on a second one I have different error; when using that contribution, after I created an indigo-controller I try to get the device list, I get this error

getting devices
(node:14305) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'requestAsync' of undefined
    at /Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:128:31
    at Generator.next (<anonymous>)
    at /Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:3:12)
    at Get (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:127:12)
    at Object.<anonymous> (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:43:22)
    at Generator.next (<anonymous>)
    at /Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:7:71
    at new Promise (<anonymous>)
(node:14305) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:14305) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 

I would start there.

It would seem you are sending it a message which has a part of it which is not defined.

Put a debug node on the input (Well, on the output of the previous node) and tick the show complete message in the debug node.

Send it a message and see what is being sent into the node.

That should get you a bit of the way to understanding the problem.

I found the node, node-red-contrib-indigo. The problem you describe above is caused by this line of code:


What happens is that the node uses asynchronous calls to the underlying indigo library. The line above does that exact call, but doesn’t have a responding answer in case the call fails. Node-red isn’t capable of handling errors when async calls fail, thus the system crashes. This is a bug in the node, so you should try to report it, but I can’t find a bug tracker for it. It might be worth finding out why it fails on discovering devices.

2 Likes

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