Hi there,
I had a run the program which is in the document and in the NodeRED forum topic the thing is that i added 16 nodes RTD , 16 nodes of timestamp, 16 nodes of gauge , but now the problem is when i use one Hat i only need 8 nodes of each and when i use 2 i need 16 nodes of each, but is it possible to change this node in a code using function node where i can specify when i use 1 HAT it reads from 8 nodes and when i put 2 HAT it reads from 16 or etc HAT, second thing is that when the solution i got it used i2c in node which i have to find RTD address using i2c status and when i get it i have a problem with that because I have to check it repeatedly wheather it has the same address when i remove 2 HAT or not is there any solution for that to code using function node to find how many HAT are connected. Please help with this issue.
Anyone to reply this topic please reply
Have a read of this and follow what it tells you to do:
What should I do now please tell me
Have you provided all the information suggested in the linked post? In particular show us what you have already done so that we can understand better.
Also, if you are a beginner to node red then please watch this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.
I read your post and really tried to understand it.
What should I do now please tell me?
Which program did you run? Which document? Which forum post? Links please.
It would help if you give the details of the add-on boards, including URLs so we can see what they are.
It would help if you break up your question into short sentences with fewer "and"s.
Clearly state what you want to achieve, what you have tried and any successes so far.
@jbudd, @Colin
I am using this device
8-Channel RTD Data Acquisition 8-Layer Stackable for Raspberry Pi – Sequent Microsystems
then i connected PT 100 to RTD
61tAriSEv9L.SX522.jpg (522Ă—294) (media-amazon.com)
and now what i have the flow which i am using as trial there are two types of flows and
I have to use i2c node and sequent microsystem node which i have place the link of github
rtd-rpi/node-red-contrib-sm-rtd at master · SequentMicrosystems/rtd-rpi · GitHub
now what i have got the example from the forum and from github they are as follows
1). This is Github Example which i edited as my needs
[{"id":"dedb85dc.b133d8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"1cbd1095.05225f","type":"ui_gauge","z":"dedb85dc.b133d8","name":"","group":"6d0e4a93.472f74","order":1,"width":6,"height":5,"gtype":"gage","title":"RTD 3","label":"°C","format":"{{value | number:0}}","min":0,"max":"300","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":930,"y":480,"wires":[]},{"id":"63b12e71.9367c","type":"exec","z":"dedb85dc.b133d8","command":"rtd 2 read 3","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":570,"y":500,"wires":[["71453aabacce54fc"],[],[]]},{"id":"d75976cd.56d598","type":"inject","z":"dedb85dc.b133d8","name":"","repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":240,"wires":[["705b3583.6e855c"]]},{"id":"705b3583.6e855c","type":"delay","z":"dedb85dc.b133d8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":200,"y":500,"wires":[["63b12e71.9367c"]]},{"id":"71453aabacce54fc","type":"function","z":"dedb85dc.b133d8","name":"","func":"var newMsg = msg.payload;\nnewMsg ={payload: msg.payload};\nif (parseFloat(msg.payload) > 300 || parseFloat(msg.payload) < -60)\n{\n newMsg.payload = \"0.0\";\n}\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":747,"y":490.20001220703125,"wires":[["1cbd1095.05225f","75a349b67ce954de"]]},{"id":"75a349b67ce954de","type":"debug","z":"dedb85dc.b133d8","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":560,"wires":[]},{"id":"6d0e4a93.472f74","type":"ui_group","name":"TEMPERATURE3","tab":"501903b1.f40adc","order":3,"disp":false,"width":"6","collapse":false},{"id":"501903b1.f40adc","type":"ui_tab","name":"RTD","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
2). this is the example
[{"id":"40b1d6b4f29aaaf7","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"fbd74ccd506b91b3","type":"rtd","z":"40b1d6b4f29aaaf7","name":"Sensor 1","stack":"2","channel":"3","resistance":false,"payload":"payload","payloadType":"msg","x":540,"y":220,"wires":[["1cf60b3e2f029bcf"]]},{"id":"b16d20f32b014fd7","type":"inject","z":"40b1d6b4f29aaaf7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":520,"wires":[["322c1f0cf8874247"]]},{"id":"53e8e537c0748614","type":"inject","z":"40b1d6b4f29aaaf7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":220,"wires":[["4a18a01eafe57521"]]},{"id":"322c1f0cf8874247","type":"i2c scan","z":"40b1d6b4f29aaaf7","name":"","busno":"1","x":460,"y":520,"wires":[[],["76664ce7c05cc423"]]},{"id":"76664ce7c05cc423","type":"debug","z":"40b1d6b4f29aaaf7","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":720,"y":520,"wires":[]},{"id":"1cf60b3e2f029bcf","type":"debug","z":"40b1d6b4f29aaaf7","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":780,"y":220,"wires":[]},{"id":"4a18a01eafe57521","type":"i2c in","z":"40b1d6b4f29aaaf7","name":"","busno":"1","address":"66","command":"","count":"1","x":390,"y":220,"wires":[["fbd74ccd506b91b3"]]}]
and this is the forum link
RTD 8 channel hat with Raspberry Pi 4 (Need help to read temperature from PT100) - General - Node-RED Forum (nodered.org)
@Colin @jbudd,
I have provided the details regarding example, but the thing is that i have to add 24 nodes of rtd and gauges for this project if i place three HAT [8-Channel RTD Data Acquisition 8-Layer Stackable] (8-Channel RTD Data Acquisition 8-Layer Stackable for Raspberry Pi – Sequent Microsystems) on raspberry pi, so I need a function where it should detect the HAT and define how many nodes should it require as it is multiple of 8.
Do you already have three of these stackable hats?
You have to set jumpers to give them a unique "stack level" 0, 1 & 2.
There is a command line tool rtd.
rtd -list shows "the connected cards, number of boards and stack level for every board"
I imagine that this command will tell you which boards are attached to your Pi.
What does the rtd -list command show you when just one is connected to your Pi?
When 2? 3?
When none are connected?
From a glance at the documentation provided by Sequent, node-red-contrib-sm-rtd, which I think you have installed, is basically a wrapper for the rtd command.
I do not have one of these boards nor an internet connection at the moment so it's unlikely I can help any more. Good luck
anyone else who can provide me some solution on this.
@Steve-Mcl @Colin can you help me
You haven't answered the questions from @jbudd
Also, to me at least, it is not at all clear what you are having difficulty with. Note, though, that I am not familiar with these devices.
@Colin , ok i understand that you are not familiar with the device it's ok but i need help to create a function where if i am having a condition of 3 in function node i would have get a 24 nodes of gauge and if i use condition 1 i would only get 8 nodes of gauges. Actually the problem is that if I added the 24 gauges nodes it is very time consuming to edit and write the things in that so is there any simple way to add automatically if possible using function node. Because there is the problem if i add 24 nodes and i only need 8 nodes to see the remaining shows me different temperatures. Therefore it would be great if there is a solution on it.
@jbudd yes I tried as you told about the RTD. And i got the values as i testing my hat
the rtd -list command show me 0 when one hat is connected to Pi
When 3 Hat are connected it shows me 0,1,2 like this and says 3 connected
When none are connected it doesn't show anything
Excellent. You have a way to tell which hats are connected.
So if only one hat is connected you want 8 gauges to show on the dashboard. If two, 16 gauges and if three, 24 gauges.
I suggest that you define three dashboard groups: "Hat0", "Hat1", "Hat2". Then you can hide/show each group using a ui_control node.
Let's say node-red-contrib-sm-rtd shows you that just the hat with ID zero is connected.
Then you need to send to ui_control a msg.payload like this
{ "group": { "show": ["TabName_Hat0"], "hide": ["TabName_Hat1","TabName_Hat2"]}}
I think that Flexdash, an alternative dashboard, does allow you to dynamically create widgets like this.
No idea if it's more or less effort than copy/paste 8 gauges
@jbudd i have to show in one window means 1 hat consist of 8 Temp sensor like that i have to continue it till 24 Temp sensors so i cannot create dashboard groups because it will make a separate HAT1, HAT2, HAT3
Are you referring to the group names and/or space between groups?
Pretty straightforward to remove both of these features of the dashboard.
@jbudd can you explain me i need to remove unwanted temp reading to 0 as i did not connected the temp sensor and second thing is that i added ui_control but i dont know where to put the code you have gave me
I have no idea what that means.
This is a commercial / industrial project I believe?
i am using it [Node-red] for industrial purpose
So you are being paid for your expertise in Node-red.
Who do you think is paying me and the others who have tried to help you?
If you search the forum for "ui_control" I expect you will find examples of it's use.
@jbudd , I Think so that you are thinking that I haven't Mentioned it
i am using it [Node-red] for industrial purpose
Also Note that the topic that you might be comparing is different and therefore i have mentioned on that topic and this topic is for my personal use where i have to monitor my children health also the room temperature i having two different sensors for monitoring them and you think that i am expertise in node red why would someone pay me for this to monitor my own children.