Skip to content

Node-red crashs after activating example flow #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gaudes opened this issue Jan 3, 2018 · 8 comments
Open

Node-red crashs after activating example flow #3

gaudes opened this issue Jan 3, 2018 · 8 comments

Comments

@gaudes
Copy link

gaudes commented Jan 3, 2018

Hi,

I've installed node-red-contrib-cec as described. After importing the example flow and pressing "deploy" Node Red crashs with the following output:

3 Jan 23:05:19 - [red] Uncaught Exception:
3 Jan 23:05:19 - TypeError: Cannot convert undefined or null to object
at Function.keys ()
at CECMonitor. (/home/pi/.node-red/node_modules/@damoclark/cec-monitor/lib/cec-monitor.js:458:16)
at CECMonitor. (/home/pi/.node-red/node_modules/@damoclark/cec-monitor/lib/cec-monitor.js:202:14)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.

Any ideas ?

The basic command echo "scan" | cec-client RPI -s -d 1 is working on my Raspberry.

Thanks and regards,

Ralf

@damoclark
Copy link
Owner

Hey Ralph,

Sorry to hear its not playing nice with your setup.

Here is something to try to help diagnose the issue.

The fork of cec-monitor I created includes a node.js command line tool. You can run it like so:

$ cd ~/.node-red/node_modules/@damoclark/cec-monitor/bin
$ node cli.js

The output from mine looks like so:

CEC-MON> {"type":"TRAFFIC","number":"433","flow":"OUT","source":14,"target":0,"opcode":140,"args":[],"event":"GIVE_DEVICE_VENDOR_ID","data":{}}
CEC-MON> {"type":"TRAFFIC","number":"626","flow":"IN","source":0,"target":15,"opcode":135,"args":[8,0,70],"event":"DEVICE_VENDOR_ID","data":{"val":524358,"str":"SONY"}}
CEC-MON> {"type":"TRAFFIC","number":"1514","flow":"OUT","source":4,"target":15,"opcode":132,"args":[64,0,4],"event":"REPORT_PHYSICAL_ADDRESS","data":{"val":16384,"str":"4.0.0.0"}}
CEC-MON> {"type":"TRAFFIC","number":"1677","flow":"OUT","source":4,"target":0,"opcode":71,"args":[99,101,99,45,109,111,110,45,99,108,105],"event":"SET_OSD_NAME","data":{"val":"cec-mon-cli","str":"cec-mon-cli"}}
CEC-MON> {"type":"TRAFFIC","number":"2008","flow":"OUT","source":4,"target":0,"opcode":143,"args":[],"event":"GIVE_DEVICE_POWER_STATUS","data":{}}
CEC-MON> My address:
logical addresses: 4
  primary logical: 4
         physical: 4.0.0.0
 -- READY -- 
CEC-MON> {"type":"TRAFFIC","number":"2430","flow":"IN","source":0,"target":4,"opcode":144,"args":[1],"event":"REPORT_POWER_STATUS","data":{"val":1,"str":"STANDBY"}}
CEC-MON> 

If you get this far, at the CEC-MON> prompt, type:

CEC-MON> scan

See if you receive any output from that.

If you press TAB, you will get a list of commands available to this utility. There is also tab completion for multiple parameter commands. Try typing tx and then press TAB. It should be a bit easier to use than cec-client.

Try some of the commands as part of the example flow I created. Do they work?

If this works, then the problem may be with the node-red part, rather than the underlying cec-monitor module. See how you go and report back.

Damo.

@gaudes
Copy link
Author

gaudes commented Jan 4, 2018

Hello Damo,

thanks for the very fast answer. I've just tried it. Same error, here is the output:

CEC-MON> {"type":"TRAFFIC","number":"156","flow":"OUT","source":14,"target":0,"opcode":140,"args":[],"event":"GIVE_DEVICE_VENDOR_ID","data":{}}
CEC-MON> {"type":"TRAFFIC","number":"361","flow":"IN","source":0,"target":15,"opcode":135,"args":[0,0,240],"event":"DEVICE_VENDOR_ID","data":{"val":240,"str":"SAMSUNG"}}
CEC-MON> {"type":"TRAFFIC","number":"1263","flow":"OUT","source":11,"target":15,"opcode":132,"args":[64,0,4],"event":"REPORT_PHYSICAL_ADDRESS","data":{"val":16384,"str":"4.0.0.0"}}
CEC-MON> TypeError: Cannot convert undefined or null to object
at Function.keys ()
at CECMonitor. (/home/pi/.node-red/node_modules/@damoclark/cec-monitor/lib/cec-monitor.js:458:16)
at CECMonitor. (/home/pi/.node-red/node_modules/@damoclark/cec-monitor/lib/cec-monitor.js:202:14)
at wrappedMapper (/home/pi/.node-red/node_modules/map-stream/index.js:84:19)
at Stream.stream.write (/home/pi/.node-red/node_modules/map-stream/index.js:96:21)
at Stream.ondata (internal/streams/legacy.js:16:26)
at emitOne (events.js:116:13)
at Stream.emit (events.js:211:7)
at drain (/home/pi/.node-red/node_modules/through/index.js:36:16)
at Stream.stream.queue.stream.push (/home/pi/.node-red/node_modules/through/index.js:45:5)
cec-client exit

Thanks and regards, Ralf

@damoclark
Copy link
Owner

Hey Ralf,

Sorry, busy work period.

Could you provide some details in terms of your device/software.

  • Raspberry Pi Model etc
  • OS & Version
  • Node.js version

The following commands will help if you aren't too familiar with Linux:

uname -a
node --version
npm --version

Damo.

@gaudes
Copy link
Author

gaudes commented Jan 28, 2018

Hey Damo,

sorry, same here :-)

Here the versions output:

Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

node: v6.12.3
npm: 3.10.10

Thx & Regards, Ralf

@damoclark
Copy link
Owner

damoclark commented Feb 1, 2018 via email

@gaudes
Copy link
Author

gaudes commented Feb 3, 2018

Hey Damo,

I've upgraded npm to 5.6.0 now.

I've done uninstall and install, still the same problem here.

Thx & Regards, Ralf

@almadsen
Copy link

I got the same problem as the one above:

$ cd ~/.node-red/node_modules/@damoclark/cec-monitor/bin
$ node cli.js

gives:

CEC-MON> {"type":"TRAFFIC","number":"164","flow":"OUT","source":14,"target":0,"opcode":140,"args":[],"event":"GIVE_DEVICE_VENDOR_ID","data":{}}
CEC-MON> {"type":"TRAFFIC","number":"364","flow":"IN","source":0,"target":15,"opcode":135,"args":[0,0,240],"event":"DEVICE_VENDOR_ID","data":{"val":240,"str":"SAMSUNG"}}
CEC-MON> {"type":"TRAFFIC","number":"1266","flow":"OUT","source":11,"target":15,"opcode":132,"args":[16,0,4],"event":"REPORT_PHYSICAL_ADDRESS","data":{"val":4096,"str":"1.0.0.0"}}
CEC-MON> TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at CECMonitor.<anonymous> (/home/pi/.node-red/node_modules/@damoclark/cec-monitor/lib/cec-monitor.js:458:16)
    at CECMonitor.<anonymous> (/home/pi/.node-red/node_modules/@damoclark/cec-monitor/lib/cec-monitor.js:202:14)
    at wrappedMapper (/home/pi/.node-red/node_modules/map-stream/index.js:84:19)
    at Stream.stream.write (/home/pi/.node-red/node_modules/map-stream/index.js:96:21)
    at Stream.ondata (internal/streams/legacy.js:16:26)
    at Stream.emit (events.js:160:13)
    at drain (/home/pi/.node-red/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/home/pi/.node-red/node_modules/through/index.js:45:5)
    at emit (/home/pi/.node-red/node_modules/split/index.js:36:14)
cec-client exit

My hardware & software profile:

uname -a : Linux candy 4.14.18-v7+ #1093 SMP Fri Feb 9 15:33:07 GMT 2018 armv7l GNU/Linux
node -v : v9.5.0
npm -v : 5.7.1

Any ideas on what's making it fail?

Regards -
@almadsen

@damoclark
Copy link
Owner

Finally getting back to this error.

So I am unable to reproduce this error on my set up. But I think there error may be caused by an uninitialised variable in cec-monitor library. I've attempted to fix this with the latest commit to cec-monitor.

Try performing an npm update within your /home/pi/.node-red directory and give it another whirl.

You want to have version 1.0.10-release.5 of cec-monitor installed from npmjs.org.

Let me know how it goes.

Damo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants