Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Node Red question

KD0RCKD0RC Broomfield, COMember ✭✭✭

I see a lot of good discussion about Node Red, but I am not sure what platform it is executing on. @Mike-VA3MWAre people running it on a PC or something like a Raspberry Pi or Arduino (dare I ask - Android)? Can it be used to connect via SmartLink? How much of the Flex API is implemented on each of the supported platforms?

I am finishing up a Teensy (Arduino work-alike) project using the IW7DMH library for the Flex API. It really works well, but takes a lot of C++ coding. I would like to play around with Node Red next, but not sure where to start.

Thanks & 73,

Len, KD0RC

Tagged:

Comments

  • AlanAlan Member ✭✭✭

    Len, let me try with some of your questions.

    What platform it is executing on? - Per the Nod-Red website, Node-Red can be installed on: Windows, Raspberry Pi, Docker, Beagle Boards, Android, Microsoft Could and others.


    I have successfully run it on Raspberry Pi (Linux), Windows, and Docker (Docker Mac, and Docker Raspberry Pi).

    I think the ham community likes to use Raspberry Pi because we can dedicate the Pi to run in the background providing monitoring, interlocks and running browser based dashboards.

    I have been following your "Teensy Project". If you replace the "Teensy" with a Raspberry Pi 4 or 3 or even zero, use the "Pi - GPIO" Node to get your "knobs" value into Node-Red, and then use the knob value to provide the input to the API or REST commands via Node-Red to the Flex or other devices.

    Here is a screenshot of one of my GPIO pin Out Nodes, would be the same if you used the pin for "GPIO - In":

    How much of the Flex API is implemented on each of the supported platforms. - The Flex API is fully available via Node-Red. Node red has TCP in/out nodes and other nodes to write the API code and send/receive the command/response from the Flex Server. Node-Red also has a UDP listener for those VITA49 broadcasts. There are a number of examples posted.

    Here is a screenshot of a Flex API flow to subscribe to "tx all" and to parse out variables of interest. (credit N6UA and WO2X):

    Here is a screenshot of a flow I wrote to command the Flex to "Tune":A

    And here is the code per the Flex API wiki, set up in the function node for commanding "Tune" via the Flex API:


    Mark, MKCM Software, has transitioned FRStack to the Raspberry Pi making his library of Flex REST commands available. I prefer to monitor and control the Flex this way, rather then the Flex API.


    In addition, you can write API commands or REST commands for other ham devices. Many are already done and posted to the Ham Node-Red forum. This way you can integrate dashboards, interlocks, etc.

    Alan

    WA9WUD

  • KD0RCKD0RC Broomfield, COMember ✭✭✭

    Thanks Alan, I really appreciate this! Since it looks like it will run under Windows, I will probably start there and if all goes well, I may try a port to the Teensy or jump into Raspberry Pi.

    I know what API commands are, but what are REST commands?

    Is there a Node Red method for connecting to a Flex via SmartLink?

    Thanks & 73,

    Len, KD0RC

    P.S. Not sure how I got Mike, VA3MW listed in my question (but always happy to have Mike's input)...

  • KD0RCKD0RC Broomfield, COMember ✭✭✭

    Hi Alan, I managed to get Node Red installed and even (eventually...) found the graphical interface. None of this is intuitive at all for me, so I am not getting anywhere very fast. (I started my professional life in the 70's as a PL/I programmer if that gives you a bit of context...)

    I can't seem to find the Flex libraries for Node Red. I have looked all over GitHub, but maybe I am just not searching the right thing. I think that if I can get that far, I will be able to figure out what the functions do when wired together. I have used a similar interface to generate Teensy code for the Teensy Audio board, so that part does not worry me much.

    Thanks & 73,

    Len, KD0RC

  • AlanAlan Member ✭✭✭
    edited November 2020

    Q- Will Node-Red do Smart Link? Not directly via SmartLink. You can connect FRStack Windows via SmartLink and use its REST commands on a remote PC running Node-Red.

    Or, as I do, I run FRStack and Node-Red on a dedicated Raspberry Pi. You can access the Node-Rd dashboard via any browser if you open the Node Red port on your router.

    Q - What are REST Commands?

    Commands you send in HTTP to/from Flex API via FRStack. Node- Red can send HTTP commands.

    To see how it works, put a formatted HTTP REST command into your browser, with FRStack running on the same PC and connected to your Flex Client. Hit Send or refresh on the browser, and the command will be sent to the Flex. Flex Response will show in the browser window. (Browser HTTP>>FRStack>>API>>Flex Server)

    See the complete list of the Windows FRStack REST commands and format here.

    See a complete list of the Raspberry Pi FRStack REST commands here:

    Instruction to load Node-Red on Windows here:

    Alan WA9WUD

  • AlanAlan Member ✭✭✭

    Len

    Since you have Node-Red up and running, first be sure to load the dashboard pallets:

    Then, import some flows. Suggest you import the VITA49 Flow and the Flex Radio V3 Flows:

    Down Load Flows. Suggest VITA49 and FlexRadioV3:

    Deploy the flow.

    Open up a new web browser page to see the dashboard:

    IP address of Device RunningNode-Red:1880/ui

    Alan

  • AlanAlan Member ✭✭✭

    Use "Debug" nodes and the Debug Window to see how each node changes the message flowing thru it.

  • KD0RCKD0RC Broomfield, COMember ✭✭✭

    Hi Alan, maybe it is just me, but this seems horribly complex and confusing. I got it to mute and unmute the Flex, but that was by putting the command into the command line of a browser, as you showed above. I don't see where Node Red comes into play. I see all of the flows that you guys are using to do things (dashboards, etc), and I assumed that there was a library of these flow boxes that can be uploaded into Node Red and wired together to read/display/change Flex parameters via the API. I feel like I am missing some fundamental aspect of this whole concept. I know this doesn't make sense, but I was able to decipher the Arduino library and build an app around it having never written a single line of C or C++ before, more easily than setting up and understanding Node Red...

    I don't want to take up too much more bandwidth here, but I am willing to try a little more to see if I can use the graphical interface, or, if I am totally missing the whole concept here, maybe I should move on to something else. Thanks again for all your help - I really appreciate your patience on this.

    Len

  • KD0RCKD0RC Broomfield, COMember ✭✭✭

    Hi Alan, I wrote the previous while you were writing the answers! I have the Node Red screen up, let me see if I can get the boxes to show.

  • KD0RCKD0RC Broomfield, COMember ✭✭✭

    Hmmm... The dashboard is not an option, and I don't see the Flex Radio V3 or Vita49 flows on the Groups.io files section. Am I looking in the wrong place?

  • AlanAlan Member ✭✭✭

    Let's set up a Phone Call / Team view. I sent you an e-mail.

    Alan

  • KD0RCKD0RC Broomfield, COMember ✭✭✭

    OK, I got it working. I had to search to find the flows and components. I stumbled across a readme from WO2X that showed me what to load. I will study the contents of the flow boxes to see if I can better understand this interface specifically, and Node Red in general.

    Thanks again for the help,

    Len

  • Len,


    Feel free to ask here or contact me directly if you have any questions. Alan and I can assist you.


    73

    Dave wo2x

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.