Keyboard Shortcuts
Likes
- Nodered-Hamradio
- Messages
Search
Re: Node-Red msg notification
Thanks..i am taking a break this evening.? I will get back on it tomorrow.. Mick On Sun, Oct 11, 2020, 6:34 PM Alan Blind, WA9WUD <a.alan.blind@...> wrote:
|
Re: Node-Red msg notification
Mick For the function to work comparing msg.inputs, you need to first add each message to a context variable so they both exist at the same time within the function. ?"Node" variables exist within the same node (function node in this case).? You could also use "Flow" or "Global" context variables.? Var1 = context.var1 || 0 ? // sets Var1 to contents of context.var1 or 0 Var2 = context.var2 || 0 Assign each msg input to the function node a unique "topic' and use the topic to set up a unique Var name within the function.? Var1 and Var2.? if(msg.topic.xxx) {context.var1 = msg.payload. ? //msg.payload with topic xxx if(msg.topic.yyy) {context.var2 = msg.payload. ? //msg.payload with topic yyy ?Then: If(Var1==Var2) {msg.payload = true}. // boolean If(Var1>Var2) {msg.payload = "big} //string If(Var < Var2) {msg.payload = "small"} //string If(Var - Var2 >0) {msg.payload = 25} // number else {msg.payload = false}; ?//boolean Take a look at this video: Alan PS, my coding is for illustration, not tested code. |
Re: Node-Red msg notification
Thanks Alan, I took several steps backwards today.? I realized my flow to inhibit TX does not work.? Thinking I need to do this in a function? to compare TUNE and MOX.? If Tune is ON and MOX is on,? I would ignore the TX inhibit,? but if just MOX is on I would not ignore it.? I tried to use the gate func, but it beat me up...I am presently trying to figure out how to get the MOX / Tune payloads into a variable so I can do an if statement on this... If this was only sql I would be flying through it.. Mick On Sun, Oct 11, 2020 at 4:21 PM Alan Blind, WA9WUD <a.alan.blind@...> wrote:
|
Re: Node-Red msg notification
Mick Note the subtle difference between "Client" and "Clients". "Client" is a command to the Flex Server to?bind to a client "name".? "Clients" request information from the Flex Server.? This is how the flow builds the list of clients connected to the Flex Server, from which you can choose to bind FRStack to. Alan WA9WUD |
Re: Node-Red msg notification
Thank you, Mick.? Another lesson under my belt.? Got the missing nodes loaded and able to display the console on the dashboard. Thanks again and 73, Bob, KN4HH
On Sunday, October 11, 2020, 12:48:23 PM EDT, Mick <w8bea2b2c2@...> wrote:
Bob, You probably?don't have the gate node in your pallet.? You will need to go to manage Palette and load the gate Palette.? Here is what I loaded.? |
Re: Node-Red msg notification
Good day.? Beginner here.? Just got node red running and created a few very basic flows.? I tried importing Alan's flow and I received an error message "Unknown node type Gate". I would appreciate a point in the right direction. 73, Bob, KN4HH
On Sunday, October 11, 2020, 10:07:02 AM EDT, Alan Blind, WA9WUD <a.alan.blind@...> wrote:
Add a gate. ?This will give you the idea: [{"id":"26463a39.8eb58e","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d3fda263.3853b8","type":"change","z":"26463a39.8eb58e","name":"TXANT","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.TXANT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":268,"y":104,"wires":[["4a80dc91.28339c","55fc750b.55a534"]]},{"id":"4a80dc91.28339c","type":"ui_text","z":"26463a39.8eb58e","group":"fc0ab7c9.239048","order":3,"width":2,"height":1,"name":"TXANT","label":"<font size = 5, font color = red>TX ","format":"<font color = red>{{msg.payload}}","layout":"col-center","x":498,"y":125,"wires":[]},{"id":"55fc750b.55a534","type":"switch","z":"26463a39.8eb58e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"ANT1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":361,"y":235,"wires":[["e1651f62.da3268","945e136.4f2a6f"]]},{"id":"e1651f62.da3268","type":"change","z":"26463a39.8eb58e","name":"SetAntTX-Ant1","rules":[{"t":"set","p":"payload","pt":"msg","to":"ANT1","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"$globalContext(\"frstackurl\") & \"/\" & $flowContext(\"stype\") & \"/TXANT?param=\" & msg.payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":596,"y":225,"wires":[[]]},{"id":"7f6082e.762fa7c","type":"ui_toast","z":"26463a39.8eb58e","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":1115,"y":663,"wires":[]},{"id":"fd8507f9.1d02b8","type":"change","z":"26463a39.8eb58e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Invalid TX ANT Selected - Flex","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":326,"y":505,"wires":[["ad1c9a96.2476c"]]},{"id":"13286bd3.dcf6c4","type":"switch","z":"26463a39.8eb58e","name":"","property":"url","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":342,"wires":[["fd8507f9.1d02b8","15d5a86d.168758"],["42c75df4.0e3eb4"]]},{"id":"13030dfa.66806a","type":"http request","z":"26463a39.8eb58e","name":"GetClients","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":396,"y":332,"wires":[["13286bd3.dcf6c4"]]},{"id":"945e136.4f2a6f","type":"change","z":"26463a39.8eb58e","name":"getclientsUrl","rules":[{"t":"set","p":"url","pt":"msg","to":"$globalContext(\"frstackurl\") & \"/Radio/CLIENTS\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":212,"y":327,"wires":[["13030dfa.66806a"]]},{"id":"ad1c9a96.2476c","type":"gate","z":"26463a39.8eb58e","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":1105,"y":487,"wires":[["7f6082e.762fa7c"]]},{"id":"15d5a86d.168758","type":"change","z":"26463a39.8eb58e","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":310,"wires":[["ad1c9a96.2476c"]]},{"id":"42c75df4.0e3eb4","type":"change","z":"26463a39.8eb58e","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":868,"y":377,"wires":[["ad1c9a96.2476c"]]},{"id":"fc0ab7c9.239048","type":"ui_group","z":"","name":"Flex - Active Slice","tab":"367c1bb9.ba774c","order":2,"disp":true,"width":"6","collapse":false,"info":"Active Slice "},{"id":"367c1bb9.ba774c","type":"ui_tab","z":"","name":"SVARC Station Control","icon":"dashboard","order":2,"disabled":false,"hidden":false}] |
Re: Node-Red msg notification
Add a gate. ?This will give you the idea:
[{"id":"26463a39.8eb58e","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d3fda263.3853b8","type":"change","z":"26463a39.8eb58e","name":"TXANT","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.TXANT","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":268,"y":104,"wires":[["4a80dc91.28339c","55fc750b.55a534"]]},{"id":"4a80dc91.28339c","type":"ui_text","z":"26463a39.8eb58e","group":"fc0ab7c9.239048","order":3,"width":2,"height":1,"name":"TXANT","label":"<font size = 5, font color = red>TX ","format":"<font color = red>{{msg.payload}}","layout":"col-center","x":498,"y":125,"wires":[]},{"id":"55fc750b.55a534","type":"switch","z":"26463a39.8eb58e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"ANT1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":361,"y":235,"wires":[["e1651f62.da3268","945e136.4f2a6f"]]},{"id":"e1651f62.da3268","type":"change","z":"26463a39.8eb58e","name":"SetAntTX-Ant1","rules":[{"t":"set","p":"payload","pt":"msg","to":"ANT1","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"$globalContext(\"frstackurl\") & \"/\" & $flowContext(\"stype\") & \"/TXANT?param=\" & msg.payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":596,"y":225,"wires":[[]]},{"id":"7f6082e.762fa7c","type":"ui_toast","z":"26463a39.8eb58e","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":1115,"y":663,"wires":[]},{"id":"fd8507f9.1d02b8","type":"change","z":"26463a39.8eb58e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Invalid TX ANT Selected - Flex","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":326,"y":505,"wires":[["ad1c9a96.2476c"]]},{"id":"13286bd3.dcf6c4","type":"switch","z":"26463a39.8eb58e","name":"","property":"url","propertyType":"msg","rules":[{"t":"nnull"},{"t":"null"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":342,"wires":[["fd8507f9.1d02b8","15d5a86d.168758"],["42c75df4.0e3eb4"]]},{"id":"13030dfa.66806a","type":"http request","z":"26463a39.8eb58e","name":"GetClients","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":396,"y":332,"wires":[["13286bd3.dcf6c4"]]},{"id":"945e136.4f2a6f","type":"change","z":"26463a39.8eb58e","name":"getclientsUrl","rules":[{"t":"set","p":"url","pt":"msg","to":"$globalContext(\"frstackurl\") & \"/Radio/CLIENTS\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":212,"y":327,"wires":[["13030dfa.66806a"]]},{"id":"ad1c9a96.2476c","type":"gate","z":"26463a39.8eb58e","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":1105,"y":487,"wires":[["7f6082e.762fa7c"]]},{"id":"15d5a86d.168758","type":"change","z":"26463a39.8eb58e","name":"open","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":310,"wires":[["ad1c9a96.2476c"]]},{"id":"42c75df4.0e3eb4","type":"change","z":"26463a39.8eb58e","name":"close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":868,"y":377,"wires":[["ad1c9a96.2476c"]]},{"id":"fc0ab7c9.239048","type":"ui_group","z":"","name":"Flex - Active Slice","tab":"367c1bb9.ba774c","order":2,"disp":true,"width":"6","collapse":false,"info":"Active Slice "},{"id":"367c1bb9.ba774c","type":"ui_tab","z":"","name":"SVARC Station Control","icon":"dashboard","order":2,"disabled":false,"hidden":false}] |
Node-Red msg notification
I am trying to get fancy with my flows... I have a flow set up to do notify on the toolbar if the invalid TX ANT is selected...see below: |
Re: File /Flex TX Power Limiter, By Band/Amp Power Limit.json uploaded
#file-notice
Thank-You, Mick.
Alan |
Re: File /Flex TX Power Limiter, By Band/Amp Power Limit.json uploaded
#file-notice
Alan, I take it you have?a PG-XL.? ?To? me that is a dream amp...Your flows are clean and impressive. Mick
|
Re: File /Flex TX Power Limiter, By Band/Amp Power Limit.json uploaded
#file-notice
I added a new file to the Amp Band Limit Flow set. This new flow complements the "Amp Band Select" flow by adding a "High", "Mid", and "Low" setting for the PG-XL "Maximum Allowed Watts Out.? There is a separate "Setup" dashboard with "sliders" to set the maximum PG-XL Watts out for each range.? If the PG-XL puts out a higher value of Watts in MOX, the flow will "run-back" the Flex TX power to match the "Max PG-XL Watts" setpoint.? Using these flows together, you have three definable ranges for TX Maximum Setpoint and for Maximum PG-XL Watts. The flow will run the TX setpoint below the lowest value. If the Flex Setpoint is below both TX Setpoint and PG-XL Watts limits, the flow will allow the Flex TX Setpoint to control. Here is a screenshot of the "control panel" used to set PG-XL Max Power for each range: And, here is a screen-shot of my station dashboard showing the consolidated "Limiter" buttons / Indications: Alan WA9WUD |
File /Flex TX Power Limiter, By Band/Amp Power Limit.json uploaded
#file-notice
[email protected] Notification
The following files have been uploaded to the Files area of the [email protected] group. By: Alan Blind, WA9WUD Description: |
File /SteppIR Using FR Stack/SDA100 AutoTrack Settings.json uploaded
#file-notice
[email protected] Notification
The following files have been uploaded to the Files area of the [email protected] group. By: Alan Blind, WA9WUD Description: |
Minimum hardware
I hope to start dabbling with Node Red soon. I see hardware requirements called out but some vagueness remains particularly relative to amount of RAM needed.
I have a Pi 3B with 1GB... is that going to be sufficient to get me started? Where I want to end up with is FRstack running. Control functions otherwise are relatively simple and primarily all discretes (power control, Flex off/on, antenna switches...). If I buy a Pi 4, how much RAM do I really need? My apologies if I missed more-detailed discussion already held on this topic, but I didn't find it. 73 Steve AK0M |
Re: Node-Red Ui Header - Add Raspi Temp
Now you are getting the hang of it. In the FRStack download file, there is an HTML file called "Read Me". Perhaps you already?used that for install instructions.? Included in the Read me?are all of the REST commands and their formats.? You should see you have simply built the TX stop REST command in Node-Red. To illustrate, put a debug node on the outlet of the node where you built the url command in JASONata.? Set the debug node for "msg.url".? Copy the debug output (should be the "TX off" REST command) from the debug window and paste that into a browser's address bar.? Hit return.? Your browser?will now send the command and you should see the Flex respond.? Change the "param" to 1 for TX on, 2 for TX off. Back to the slices.? Mark has "active slice" and A,B,C and D slices.? He does not have a TX slice.? I built a flow to "derive" the TX slice.? I prefer to control the TX slice vs the "Active" slice. ? Here is a link the folder with my?slices,?TX slice on the bottom. Alan |
Re: Node-Red Ui Header - Add Raspi Temp
I did it...I figured out a way to disable xmit on swr higher than 2.0.? The key was flow.stype.? ? On Tue, Oct 6, 2020 at 4:07 PM M Stutler via <w8bea2b2c2=[email protected]> wrote: I feel like Edison testing light bulbs. |
Re: Node-Red Ui Header - Add Raspi Temp
"M". On your SWR node, I built a similar?flow.? I have three sources of SWR, Flex, HF-Auto, and PG-XL amp.? My flow has a tile for each device, with color changes and one tile that shows the "highest" SWR with background?color changes.? It may give you some ideas for your own. It is uploaded to the forum files: On your idea to inhibit TX on high SWR, I have found the "Gate" node useful for such actions. ? To stop TX, you would need to inject constant?steam?of "TX Stop" commands, held back by a closed gate, until the hight SWR opens the gate. I also considered such a high?SWR interlock, but decided the Flex and PG-XL already had such functionality, so why duplicate it. Here are all of the tiles on their separate?dashboard: Here is the single, "High SWR" on my station control dashboard.? My idea is to reduce the number of tiles on the mainboard, but continue to have the same info: I saw your post to the forum for help adding the Pi CPU Temp to the Tool Bar.? So far, no responses. I did some reading on the "Template" Node and writing XML.? Just getting started.? I was able to get a variable "temp" ?(178) to display on the toolbar: Here is the modified script: I tried both string and numeric variables.? The script worked with both. Problem was, I could not find a way to get the outside "cpu.msg" into the script. I tried a message variable from the CPU Temperature flow, msg.temp.? Did not work. I tried a context variable.? I moved the CPU Temperature, to a context variable, "flow.set("temp", msg.temp") and within the script, a line, "temp = flow.set("temp"), thinking the script could not see the preceding "msg" nodes but could bring in a context variable from within the script. ? ?Did not work. I feel like Edison testing light bulbs. Alan WA9WUD |