Adorkable / node-red-contrib-ui-led

A simple LED status indicator for the Node-RED Dashboard
MIT License
16 stars 12 forks source link

errors when deploying ui-led #46

Closed vieuxcampus closed 4 years ago

vieuxcampus commented 4 years ago

trying to run the basic example, I get those messages: 23/11/2019 à 14:20:54msg : error "TypeError: Cannot read property 'length' of undefined" 23/11/2019 à 14:20:54node: 2aae8fef.55ce8 msg : error "TypeError: Cannot read property 'push' of undefined"

Nothing is left undefined in the configuration. I'm running raspian(v10 buster) on a raspberry 4, MQTT and node-red(v13.1.0)

Nokomis449 commented 4 years ago

I had the same problem this week and since so many people were downloading the node with no reported issues, I assumed it was me. After two evenings of trying to get an LED in the dashboard using the provided example, I finally deleted the ui-led node, reinstalled it, and wrote my own basic example (below) and it now works as expected. My example is two inject nodes, alternately injecting "True" and False" into the LED node, and the LED node blinks green and red as expected.

[{"id":"630432c5.e7318c","type":"ui_led","z":"7d8f18fe.7d70a8","group":"8152166b.5f11f8","order":1,"width":0,"height":0,"label":"Blinking LED","labelPlacement":"right","labelAlignment":"center","colorForValue":[{"color":"red","value":"false","valueType":"bool"},{"color":"green","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"name":"","x":600,"y":340,"wires":[]},{"id":"5f623f9e.2e727","type":"inject","z":"7d8f18fe.7d70a8","name":"True","topic":"","payload":"true","payloadType":"bool","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":430,"y":320,"wires":[["630432c5.e7318c"]]},{"id":"e44ef96d.b4e3a8","type":"inject","z":"7d8f18fe.7d70a8","name":"False","topic":"","payload":"false","payloadType":"bool","repeat":"2","crontab":"","once":true,"onceDelay":"1","x":430,"y":360,"wires":[["630432c5.e7318c"]]},{"id":"8152166b.5f11f8","type":"ui_group","name":"Group 2","tab":"5cf502fe.71c0cc","order":2,"disp":true,"width":6},{"id":"5cf502fe.71c0cc","type":"ui_tab","z":"","name":"NokoNet","icon":"dashboard","order":1,"disabled":false,"hidden":false}] ui-led

yoiang commented 4 years ago

Do you both mean the examples in the new "Examples" tab? Hmm, I'll try with a fresh install, see if I can reproduce this.

Nokomis449 commented 4 years ago

I tried the example that included its own MQTT nodes and absolutely nothing showed up on the dashboard, even though other things I tried showed up on the dashboard. The MQTT node would show as connected. So either the example wouldn't work for me, or the ui-led install was bad. Deleting/reinstalling and using my own example got me working. I'm using the latest Node-RED (installed per Node-RED) on the latest Ubuntu LTS.

vieuxcampus commented 4 years ago

sorry but it's the same with your example. I always get those error messages whatever the example.

Nokomis449 commented 4 years ago

The following example just adds a debug node. You should get continuous True/False/True/False... in the debug window, with the LED blinking on & off. If the True/False is working but no LED, I'm not sure what else to try except reinstall the ui-led node.

[{"id":"630432c5.e7318c","type":"ui_led","z":"7d8f18fe.7d70a8","group":"8152166b.5f11f8","order":1,"width":0,"height":0,"label":"Blinking LED","labelPlacement":"right","labelAlignment":"center","colorForValue":[{"color":"red","value":"false","valueType":"bool"},{"color":"green","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"name":"","x":600,"y":340,"wires":[]},{"id":"5f623f9e.2e727","type":"inject","z":"7d8f18fe.7d70a8","name":"True","topic":"","payload":"true","payloadType":"bool","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":430,"y":320,"wires":[["630432c5.e7318c","53435004.ced1"]]},{"id":"e44ef96d.b4e3a8","type":"inject","z":"7d8f18fe.7d70a8","name":"False","topic":"","payload":"false","payloadType":"bool","repeat":"2","crontab":"","once":true,"onceDelay":"1","x":430,"y":360,"wires":[["630432c5.e7318c","53435004.ced1"]]},{"id":"53435004.ced1","type":"debug","z":"7d8f18fe.7d70a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":400,"wires":[]},{"id":"8152166b.5f11f8","type":"ui_group","name":"Group 2","tab":"5cf502fe.71c0cc","order":2,"disp":true,"width":6},{"id":"5cf502fe.71c0cc","type":"ui_tab","z":"","name":"NokoNet","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

vieuxcampus commented 4 years ago

The debug window shows the true/false sequence but there is no led showing in the dashboard. Deleting and re-installing does nothing. I installed the ui-led with the "manage palette" menu item. if I use npm I get this: npm install node-red-contrib-ui-led npm WARN node-red-contrib-ui-led@0.3.1 requires a peer of node-red-dashboard@2.14.x but none is installed. You must install peer dependencies yourself.

and it doesn't show the led. I guess there is something missing with the install but don(t know how to fix it

Nokomis449 commented 4 years ago

For unrelated reasons (testing; wanted to start clean), I deleted and re-installed Node-RED and NPM. I loaded the Dashboard and ui-led nodes via the pallet and copied my above example to it, and the dashboard was still giving me the "Welcome... Please add some UI nodes to your flow and redeploy", indicating that the led node was again not working. I then stopped and restarted Node-RED, and the led began working as expected. So it may be that Node-RED needs a restart for the node to work.

vieuxcampus commented 4 years ago

yes !! that did it ! I reinstalled the led module then reboot. As you said, it looks like nodered needs a start for this node to work. I should have tried this. Shame on me ! Thanks to all best regards

yoiang commented 4 years ago

Sorry for the late follow up! I'm glad this was resolved :)