Dashboard not appearing

Hi zenofmud
regarding deleting the mdashboard still after execution your command ,please see
(pi@pi:~ $ npm remove node-red-contrib-mdashboard

npm WARN saveError ENOENT: no such file or directory, open ‘/home/pi/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/package.json’
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

audited 1 package in 3.845s
found 0 vulnerabilities)
and for Q2 here is the code ([{“id”:“f05b3948.17cf88”,“type”:“ui_switch”,“z”:“20adda7b.e83046”,“name”:“SW1”,“label”:“SWITCH”,“group”:“ca2cbd6.93ad64”,“order”:0,“width”:“6”,“height”:“2”,“passthru”:true,“decouple”:“false”,“topic”:"",“style”:"",“onvalue”:“1”,“onvalueType”:“num”,“onicon”:"",“oncolor”:"",“offvalue”:“0”,“offvalueType”:“num”,“officon”:"",“offcolor”:"",“x”:140,“y”:200,“wires”:[[“af192f40.f1674”]]},{“id”:“af192f40.f1674”,“type”:“rpi-gpio out”,“z”:“20adda7b.e83046”,“name”:"",“pin”:“40”,“set”:"",“level”:“0”,“freq”:"",“out”:“out”,“x”:540,“y”:140,“wires”:[]},{“id”:“ca2cbd6.93ad64”,“type”:“ui_group”,“z”:"",“name”:“Test “,“tab”:“f257f57c.3a7e88”,“disp”:true,“width”:“6”,“collapse”:false},{“id”:“f257f57c.3a7e88”,“type”:“ui_tab”,“z”:””,“name”:“Home”,“icon”:“dashboard”}])

regarding your answer for Q3 I’m used to deal with labview and function blocks so if you mean to write the logic by a programming language it is too far from me all what can i do in this field is COPY/PASTE since I ve no background in such kind of commands
thank you for your support and waiting your feedback

Which directory were you in?

I’m guessing you were in your home account. You needed to be in ~/.node-red

@mustafa
Re #1 as @ukmoose and I said in my answer, you must be in the .node-red folder before doing the remove

Re #2 It looks like you did not do as I told you to do. You need to put three backtick’s before your code and after it. This will keep the original sntac and not change things like double quotes to smart quotes which will not import.

Re #3 I suggest you do a search this site’s ‘flows’ tab with something like ‘logic gates’

Hi
I think i found the issue for the ON-OFF in my Q2 it was the initialize pin so i must select 0 at starting.
but after that I was need to go more with boolean so i create a two switched and one output GPIO with AND gate so when i hit the two switches the LED must be ON as per AND gate conditions but what I have now if I hit any one of the switches the LED get ON.
please see the code below and correct me since the help of boolean for AND gate is little bit poor .
[{“id”:“e9b1a4bc.4fae58”,“type”:“rpi-gpio out”,“z”:“20adda7b.e83046”,“name”:"",“pin”:“40”,“set”:true,“level”:“0”,“freq”:"",“out”:“out”,“x”:520,“y”:180,“wires”:[]},{“id”:“cee22204.80ee7”,“type”:“ui_switch”,“z”:“20adda7b.e83046”,“name”:"",“label”:“SW1”,“group”:“3b385c7b.432ea4”,“order”:0,“width”:0,“height”:0,“passthru”:true,“decouple”:“false”,“topic”:"",“style”:"",“onvalue”:“1”,“onvalueType”:“num”,“onicon”:"",“oncolor”:"",“offvalue”:“0”,“offvalueType”:“num”,“officon”:"",“offcolor”:"",“x”:90,“y”:80,“wires”:[[“b7e41676.9f08a8”]],“icon”:“node-red-dashboard/ui_button.png”},{“id”:“b7e41676.9f08a8”,“type”:“and-gate”,“z”:“20adda7b.e83046”,“name”:“AND GATE”,“rules”:[{“t”:“eq”,“v”:"",“vt”:“str”,“propertyType”:“msg”,“property”:“payload”,“topic”:“hi”}],“outputTopic”:"",“gateType”:“and”,“emitOnlyIfTrue”:false,“x”:250,“y”:160,“wires”:[[“e9b1a4bc.4fae58”]]},{“id”:“e9dcbfdb.04fab”,“type”:“ui_switch”,“z”:“20adda7b.e83046”,“name”:"",“label”:“SW1”,“group”:“3b385c7b.432ea4”,“order”:0,“width”:0,“height”:0,“passthru”:true,“decouple”:“false”,“topic”:"",“style”:"",“onvalue”:“1”,“onvalueType”:“num”,“onicon”:"",“oncolor”:"",“offvalue”:“0”,“offvalueType”:“num”,“officon”:"",“offcolor”:"",“x”:110,“y”:280,“wires”:[[“b7e41676.9f08a8”]],“icon”:“node-red-dashboard/ui_button.png”},{“id”:“3b385c7b.432ea4”,“type”:“ui_group”,“z”:"",“name”:“Mustafa”,“tab”:“e122973.ce40268”,“disp”:true,“width”:“6”,“collapse”:false},{“id”:“e122973.ce40268”,“type”:“ui_tab”,“z”:"",“name”:“Test 1”,“icon”:“dashboard”}]

In order for anyone to try out your flow, you will need to edit your post and put the JSON text into a code block – as you have posted it, the double quotes have been changed to “smart-quotes” which are not valid JSON.

The “code” button in this editor is for smaller inline chunks of code – to create a code block, add a line before and after your code text that contains only three backticks, like
```
Please see this post for more information.

Hi Again
I have copy the code in attached .txt file
please advice about the AND gate behavior which should gives output when both switches got ON the LED get ON .
now the LED get ON when the first switch ON or when the second switch get ON
AND.txt (1.3 KB)

A brief look at your flow shows that you have not configured any rules -- so it's not surprising that the and-gate node does not magically know what you want it to do ;*)

Looks like you will also need to set a different topic for each switch, so you can setup your rules, something like this (making sure to compare numeric values, not strings, in order to match the outputs from your switches):

image

It's interesting that the sidebar info says input topic is mandatory, yet you did not have it set... hmm, perhaps the node's author should be notified.

Hi Shrickus
Thank you for your quick reply
I have tried to set the AND and switches but it seems I'm lacking for a lot information about basic of node so would you please check the attached file and advice or correct it since i did not know what to set in (topic) for the AND gate and switches
It seems that i have a very long way to learn the Node red so can you please advice from where to start to learn the basics of node red with examples since the information in sidebar is not clear to me due to my poor level in node red.

thank you for your supporting AND.txt (1.5 KB)

In the future, please just include your exported flow JSON string between two lines that contain just 3 backtics (e.g. ```) -- I for one do not like to download attachments from internet postings...

I see your and-gate node is looking for values from the 2 topics "SW1" and "SW2". So far, so good -- but you need to change each of your ui_switch nodes to add those topics to the output msg (right now, the "topic" field is empty).

Hi
i didn't got the term of (topic) in your reply about the switches.
would you please advice about the setting what should be in the two screenshots

So your and-gate node has two rules that have to evaluate to true...

  1. if the topic is "SW1" and msg.payload == 1, and
  2. if the topic is "SW2" and msg.payload == 1, right?

So the ui_switch called SW1 needs to set its topic to "SW1", and ui_switch SW2 needs to send its msg with topic "SW2" in order for the logic node to work. So in your first screen shot, where you have the arrow pointing to the Topic field, enter the same string as the Label field for each switch, and it should work...

Hi
i have set the SW 1& 2 topics but the AND gate work as below
1- both SW1 and 2 are in OFF
2- make SW1 ON and SW2 OFF the AND gate gives ON then LED of raspberry pi get ON
3- SW1 ON and make SW2 ON then LED still ON
4- change SW1 or 2 to OFF the LED get OFF
it seems the initial status of both SW1 and SW2 not appear to the AND gate
please see the code
[{"id":"2838505.23af83","type":"rpi-gpio out","z":"e0495c23.28b4a","name":"","pin":"40","set":"","level":"0","freq":"","out":"out","x":487,"y":112,"wires":[]},{"id":"85d90517.321c48","type":"and-gate","z":"e0495c23.28b4a","name":"AND","rules":[{"t":"eq","v":"1","vt":"num","propertyType":"msg","property":"payload","topic":"SW1"},{"t":"eq","v":"1","vt":"num","propertyType":"msg","property":"payload","topic":"SW2"}],"outputTopic":"1","gateType":"and","emitOnlyIfTrue":false,"x":269,"y":120,"wires":[["2838505.23af83"]],"inputLabels":["SW1"],"outputLabels":["output"]},{"id":"5a2fa7c.c31c858","type":"ui_switch","z":"e0495c23.28b4a","name":"Switch-1","label":"SW1","group":"2cad78f1.953508","order":0,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"SW1","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":92,"y":62,"wires":[["85d90517.321c48"]],"icon":"node-red-dashboard/ui_numeric.png"},{"id":"fb3b3fca.42a898","type":"ui_switch","z":"e0495c23.28b4a","name":"Switch-2","label":"SW2","group":"2cad78f1.953508","order":0,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"SW2","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":94,"y":140,"wires":[["85d90517.321c48"]],"icon":"node-red-dashboard/ui_numeric.png"},{"id":"2cad78f1.953508","type":"ui_group","z":"","name":"Mustafa","tab":"9f2b0241.7a073","disp":true,"width":"6","collapse":false},{"id":"9f2b0241.7a073","type":"ui_tab","z":"","name":"Home","icon":"my dash"}]
please advise

If the node does not function as documented, then you need to find the owner's Github page (there's a link on the node's information page in the flows library). Then open an issue with these examples, and see if they can fix it...

Note that the switches only send an output when they are clicked, so they will not send anything on startup or re-deploy.
Do you mean that the And gate sends an output before it has received both inputs? In that case that may be a bug in that node. A solution may be to inject 0 (or 1) into both switches and the and-gate using an inject node configured to inject once on startup. That should ensure everything starts up reliably.

I have no idea how to run this UI in my browser, is this red-dashboard only for rasperry pie?

Provided you have the dashboard nodes installed and at least one has been configured in a flow. Then you should point a web-browser on the same network to http://:1880/ui

ui_link

This will take you to the ui link

1 Like