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 refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Remote operating and Node Red

1246710

Comments

  • Alan
    Alan Member ✭✭✭✭
    edited December 2019
    As John says, you can access the RPi using a screen share program of choice.  Node-Red runs on the RPi but its graphical interface does not.  For me, the advantage of running Node-Red on the RPi is to allow the RPi to be co-located close to my remote station and relays which control various functions.  If you do not need the remote access, but want Node-Red, you can install Node-Red on your station Windows Computer.

    For Node-Red, you access it using any type of web browser of choice on your platform of choice.

    Regarding using Node-Red to access third party devices.....it depends.  Others on this list have shown examples of interfacing with devices whose developers were willing to share API details.   For them, it allowed consolidating and customizing to one's particular operating situation and giving convenient remote control access.

    Node-Red also allows one to simplify the remote operation of devices via your LAN and WAN (need to forward the 1880 port in your router for WAN).

    I use PST router in a server-client mode and am not aware of any advantages of moving it to Node-Red because it really depends on the type of antenna rotor controller you use and if the controller is open source.

    I do not have direct experience with the other device / app examples in your question.

    Alan
    WA9WUD 


  • W7NIK
    W7NIK Member ✭✭
    edited December 2019
    Alan , I would like to pick your thoughts, my email is [email protected] What does running PST on server /client. Mode mean ? Are you on 40m or 80 m in the evening?
  • John - K3MA
    John - K3MA Member ✭✭
    edited December 2019
    I believe he means PSTRotator which is a software program to control many different rotors via computer.  Here is a link for your reading pleasure.

    https://www.qsl.net/yo3dmu/index_Page346.htm
  • Alan
    Alan Member ✭✭✭✭
    edited December 2019
    Not exactly.

    PST can control multiple rotors as you say, but that is not the server/client purpose.

    In my case, I operate remotely.  PST Rotor communicates to the rotor controller via Windows Com Ports (physical USB cables).  I have a small windows computer at the remote location with PST Rotor installed (the Server) and physically connected to the antenna rotor via USB cables.

    On PST rotor, under the "communications" pulldown, I designated the remote Windows computer as the "TCP Server"

    At my shack station, I also have PST Rotor running on my desktop.  Under the same "communications" pulldown, the shack compter is designated as a "client".

    The first time you must, on the "communications" pulldown, select "TCP Client Setup" to enter the ip address of the server computer and the port you are using (the same setup on the server computer allows you to select ports).  Make sure the port is the same on both client and server.

    Now, you can operate your PST rotor from both locations, the shack, and the remote location.

    If you open the port on your internet router and point it to the ip address of the server, you can turn your rotor with PST rotor anywhere you can get an internet connection.   Otherwise, you can only access the server on your local network.

    Yes, pick away on my brain.   My e-mail is:    [email protected]

    Alan
    WA9WUD
  • W7NIK
    W7NIK Member ✭✭
    edited December 2019
    Thank  u  i under stand now, I have PST only as local connection, luv, it , automatic  switchers my relays according freq. 
  • Alan
    Alan Member ✭✭✭✭
    edited December 2019
    Hi Mike

    I am looking at adding the W2 Wattmeter to my remote station.   Could you share your Node-Red flow for this device?

    Also, what is your serial interface between the W2 Wattmeter to the Node-Red host device? 
     
    Alan
    WA9WUD
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited December 2019
    Hi Alan

    Here it is thanks for Andreas N6NU.  He wrote it.  You will have to make some changes and likely remove the GATE I have.  The GATE is used so that the W2  only reads RF power when the radio is in TX.

    I use a StarTech 4 port RS232 interface that is about $100CDN.  I found it on Amazon.    

    I will paste it in hear so others can use it.  It isn't quite plug and play but if you have some things on NR working, you will figure it out.   I have a couple of buttons to select the active port and to put it in high power.  If you use lower power sensors you'll have to make the changes accordingly so the math is correct or you will be out by a factor of 10.

    Mike va3mw


    [{"id":"81b1b39d.82de4","type":"tab","label":"W2","disabled":false,"info":""},{"id":"d661203c.bd0e6","type":"inject","z":"81b1b39d.82de4","name":"SendF","topic":"","payload":"F;","payloadType":"str","repeat":".1","crontab":"","once":true,"onceDelay":".1","x":120,"y":200,"wires":[["adeef7d7.d900e8"]]},{"id":"6bc5931b.62256c","type":"inject","z":"81b1b39d.82de4","name":"SendS","topic":"","payload":"S;","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":120.43580627441406,"y":244.99465942382812,"wires":[["adeef7d7.d900e8"]]},{"id":"83b5a67c.9ee178","type":"delay","z":"81b1b39d.82de4","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":738.5714111328125,"y":78.60714721679688,"wires":[["4d79f191.9651d"]]},{"id":"fcff1429.21ab88","type":"delay","z":"81b1b39d.82de4","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":735.5714111328125,"y":115.60714721679688,"wires":[["4d79f191.9651d"]]},{"id":"fcf4a2a0.6750a","type":"delay","z":"81b1b39d.82de4","name":"","pauseType":"delay","timeout":"750","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":733.5714263916016,"y":214.60714530944824,"wires":[["4d79f191.9651d"]]},{"id":"a975e60b.c82b68","type":"delay","z":"81b1b39d.82de4","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":738.5714111328125,"y":40.607147216796875,"wires":[["4d79f191.9651d"]]},{"id":"2c7db0f4.cd3fb","type":"inject","z":"81b1b39d.82de4","name":"","topic":"","payload":"I;","payloadType":"str","repeat":"10","crontab":"","once":false,"onceDelay":"","x":120.5714111328125,"y":300.3571472167969,"wires":[["adeef7d7.d900e8"]]},{"id":"4d79f191.9651d","type":"serial out","z":"81b1b39d.82de4","name":"W2MeterOut","serial":"8c8041f4.047d2","x":954.0714111328125,"y":362.3571472167969,"wires":[]},{"id":"6416080a.c0dde8","type":"function","z":"81b1b39d.82de4","name":"SWR REQ","func":"msg.payload=""S;""
    return msg;","outputs":1,"noerr":0,"x":530,"y":120,"wires":[["c87a7c97.47bbb","fcf4a2a0.6750a"]]},{"id":"970ebfe1.027fe","type":"serial in","z":"81b1b39d.82de4","name":"W2MeterIn","serial":"8c8041f4.047d2","x":160,"y":540,"wires":[["d67eb13a.0ebcc","9453e50a.cb4118"]],"info":"Under normal operating conditions, if the W2 is sent either an ""I"" or an ""i"", it returns a string of information about the state of
    the Sensors, the Range settings, some internal settings, and which Sensor is active. If, however, the W2 is in the high SWR
    alarm mode (all SWR LED's flashing), sending the ""I"" command returns only ""A!;""

    Byte Property
    1 ""I"" or ""i"" (echoes back what you sent).
    2 Active Sensor (1 or 2) matching the ""S1/S2"" LED lit.
    3 Range Level (1=2W, 2=20W, 3=200W, 4=2KW) of the Active Sensor.
    4 AutoRange status (0=off, 1=on) for Active Sensor.
    5 Sensor type (0=200W, 1=2KW, 2=VHF) of Active Sensor.
    6 Sensor's internal attenuator status (0=off, 1=on) of Active Sensor.
    7 W2 LED display state (0=off, 1=on).
    8 Active Sensor (0=none, 1=S1, 2=S2).
    9 Sensor1 Range Control (0=manual, 1=auto).
    10 Sensor1 Range Level (0=no sensor, 1=2W, 2=20W, 3=200W, 4=2KW).
    11 Sensor2 Range Control (0=manual, 1=auto).
    12 Sensor2 Range Level (0=no sensor, 1=2W, 2=20W, 3=200W, 4=2KW).
    E l e c r a f t • w w w . e l e c r a f t . c o m • 8 3 1 - 7 6 3 - 4 2 1 1
    W"},{"id":"d67eb13a.0ebcc","type":"switch","z":"81b1b39d.82de4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"F","vt":"str"},{"t":"cont","v":"R","vt":"str"},{"t":"cont","v":"S","vt":"str"},{"t":"cont","v":"I","vt":"str"},{"t":"eq","v":";","vt":"str"}],"checkall":"false","repair":false,"outputs":5,"x":350,"y":569.714298248291,"wires":[["f4bf6aad.e44788"],[],["915b1fdb.3f78b"],[],[]],"outputLabels":["F","R","","",""]},{"id":"f4bf6aad.e44788","type":"function","z":"81b1b39d.82de4","name":"ParsePower","func":"msg.payload = parseInt(msg.payload.substr(1,5))/10

    return msg;","outputs":1,"noerr":0,"x":170,"y":649.714298248291,"wires":[["17451ed9.d8e651","38a12d0e.ebc842"]]},{"id":"915b1fdb.3f78b","type":"function","z":"81b1b39d.82de4","name":"ParseSWR","func":"msg.payload = parseInt(msg.payload.substr(1,5))/100

    return msg;","outputs":1,"noerr":0,"x":169.5,"y":689.714298248291,"wires":[["f0a1222e.486fe","aa8b0e8a.43d33","cc0b59c1.b2a088"]]},{"id":"17451ed9.d8e651","type":"mqtt out","z":"81b1b39d.82de4","name":"","topic":"W2FWD","qos":"","retain":"","broker":"201e7171.0af3ee","x":875.8572463989258,"y":646.0001468658447,"wires":[]},{"id":"f0a1222e.486fe","type":"mqtt out","z":"81b1b39d.82de4","name":"","topic":"W2SWR","qos":"","retain":"","broker":"201e7171.0af3ee","x":872.2856864929199,"y":694.0000810623169,"wires":[]},{"id":"dc153878.06d958","type":"delay","z":"81b1b39d.82de4","name":"","pauseType":"delay","timeout":"650","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":734,"y":161,"wires":[["4d79f191.9651d"]]},{"id":"cc0b59c1.b2a088","type":"debug","z":"81b1b39d.82de4","name":"Alarm?","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":894.9999961853027,"y":587.9999990463257,"wires":[]},{"id":"7cdb8e0f.63d75","type":"ui_level","z":"81b1b39d.82de4","group":"2dbe67ac.f10de8","order":4,"width":"5","height":"2","name":"W2 RF","label":"PGXL RF","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"1400","segWarn":"","segHigh":"","unit":"Watts","layout":"sh","channelA":"","channelB":"","decimals":0,"animations":"reactive","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"x":597.0000267028809,"y":803.0000438690186,"wires":[]},{"id":"e2b211ba.b76b3","type":"ui_level","z":"81b1b39d.82de4","group":"2dbe67ac.f10de8","order":5,"width":"5","height":"2","name":"W2 SWR","label":"SWR","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":"1","max":"4","segWarn":"2.5","segHigh":"","unit":"","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"reactive","shape":"1","colorschema":"fixed","textoptions":"custom","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"x":605.9999885559082,"y":761.0000162124634,"wires":[]},{"id":"aa8b0e8a.43d33","type":"rbe","z":"81b1b39d.82de4","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":388.5000190734863,"y":721.9999876022339,"wires":[["e2b211ba.b76b3"]]},{"id":"c87a7c97.47bbb","type":"debug","z":"81b1b39d.82de4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":949.515625,"y":283.9140625,"wires":[]},{"id":"9453e50a.cb4118","type":"debug","z":"81b1b39d.82de4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":910,"y":520,"wires":[]},{"id":"8e14a494.92fb68","type":"rbe","z":"81b1b39d.82de4","name":"","func":"rbe","gap":"5%","start":"","inout":"out","property":"payload","x":432.52784729003906,"y":800.923656463623,"wires":[["7cdb8e0f.63d75"]]},{"id":"38a12d0e.ebc842","type":"smooth","z":"81b1b39d.82de4","name":"","property":"payload","action":"max","count":"3","round":"0","mult":"single","x":293.5277976989746,"y":795.9168491363525,"wires":[["8e14a494.92fb68"]]},{"id":"df7c0100.a065e","type":"mqtt in","z":"81b1b39d.82de4","name":"From Flex TX/RX","topic":"control","qos":"2","datatype":"auto","broker":"201e7171.0af3ee","x":140,"y":40,"wires":[["adeef7d7.d900e8"]]},{"id":"adeef7d7.d900e8","type":"gate","z":"81b1b39d.82de4","name":"","controlTopic":"control","defaultState":"open","openCmd":"close","closeCmd":"open","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":310,"y":160,"wires":[["6416080a.c0dde8","4d79f191.9651d","c87a7c97.47bbb","86f54466.fc5698"]]},{"id":"fc31a0ef.701ea","type":"ui_button","z":"81b1b39d.82de4","name":"Hi PWR Range","group":"2dbe67ac.f10de8","order":6,"width":"2","height":"1","passthru":false,"label":"Hi PWR","tooltip":"Hi Power Range","color":"","bgcolor":"","icon":"","payload":"3H;","payloadType":"str","topic":"","x":400,"y":440,"wires":[["4d79f191.9651d"]]},{"id":"55553919.391428","type":"ui_button","z":"81b1b39d.82de4","name":"Port 1","group":"2dbe67ac.f10de8","order":8,"width":"2","height":"1","passthru":false,"label":"Port 1","tooltip":"W2 RF Port 1","color":"","bgcolor":"","icon":"","payload":"O1;","payloadType":"str","topic":"","x":370,"y":400,"wires":[["4d79f191.9651d"]]},{"id":"e6dd7a04.6b21e8","type":"ui_button","z":"81b1b39d.82de4","name":"Port 2","group":"2dbe67ac.f10de8","order":9,"width":"2","height":"1","passthru":false,"label":"Port 2","tooltip":"W2 RF Port 2","color":"","bgcolor":"","icon":"","payload":"O2;","payloadType":"str","topic":"","x":370,"y":360,"wires":[["4d79f191.9651d"]]},{"id":"f567e35a.65ad5","type":"ui_button","z":"81b1b39d.82de4","name":"SCAN","group":"2dbe67ac.f10de8","order":7,"width":"2","height":"1","passthru":false,"label":"Scan","tooltip":"RF Port Scan","color":"","bgcolor":"","icon":"","payload":"Y1;","payloadType":"str","topic":"","x":370,"y":320,"wires":[["4d79f191.9651d"]]},{"id":"73c5e5d1.6de7ac","type":"polymer_paper-toggle-button","z":"81b1b39d.82de4","name":"","html":"","class":"","parent":"","width":"100%","height":"","topic":"","payloadTrueType":"bool","payloadFalseType":"bool","payloadTrue":"true","payloadFalse":"false","x":980,"y":100,"wires":[[]]},{"id":"86f54466.fc5698","type":"delay","z":"81b1b39d.82de4","name":"Clear Display after Unkey","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":390,"y":260,"wires":[["4d79f191.9651d"]]},{"id":"8c8041f4.047d2","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","newline":";","bin":"false","out":"char","addchar":";","responsetimeout":"115"},{"id":"201e7171.0af3ee","type":"mqtt-broker","z":"","name":"","broker":"192.168.110.111","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"2dbe67ac.f10de8","type":"ui_group","z":"","name":"RF Info","tab":"d6ba9a2a.f3f0d8","order":2,"disp":true,"width":"4","collapse":false},{"id":"d6ba9a2a.f3f0d8","type":"ui_tab","z":"","name":"VA3MW Shack Control","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
  • Alan
    Alan Member ✭✭✭✭
    edited December 2019
    Thanks, Mike.  This is a big help.

    Alan
    WA9WUD
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Update on my use of Node-Red / W2 Wattmeter.

    So far, my integration of the Elecraft W2 Wattmeter into Node-Red has been with mixed results.

    I used the Moxa N5110A Serial Converter because I already was using the same with my HF-Auto software.  This is whare my challenges remain.

    I wanted to use virtual com ports rather than the IP / port from the Moxa.  Setting up the Moxa  TTY drivers on the Raspberry was a challenge but completed successfully.   I was able to enter the dev/tty-XX port designations into the Node-Red Serial-in node and it was recognized by Node-Red.....but no data was moving from the W2 to Node-Red.   The "gate" node on Mike's flow was "open".

    Problem is the Moxa /dev file is at the root level and Node-Red is at the user level.  I have not been successful in bridging this gap.

    The good news is that Moxa makes it easy to make virtual ports on Windows and I have been successful in using the Elecraft W2 application remotely.   The Elecraft W2 application meets my needs, for now.

    Any advice from the group on using virtual com ports on a Raspberry would be appreciated.

    Moxa customer support says I should use IP based ports instead of virtual COM ports.  If I do that, then I cannot use the Elecraft W2 applications.

    Alan
  • Ted  VE3TRQ
    Ted VE3TRQ Member ✭✭✭
    edited January 2020
    This may be obvious, but make sure the /dev virtual port has permissions to allow your user of choice to read and write to it (“sudo chmod” is your friend).
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Thanks, Ted

    I will give this a try.  I did not know how to change the permission of the /dev/tty file in the Root.

    Alan
  • Ted  VE3TRQ
    Ted VE3TRQ Member ✭✭✭
    edited January 2020
    As an aside, the usual way to set up access to device files in /dev is to change the “g” (group) access rights, adding yourself to the group that has the appropriate rights. As an example, in many case “dialin” is the group that is attached to tty serial devices - so add yourself (your login user) to the “dialin” group. Alternatively, and less securely, you can of course open access rights to the “a” (all) user attribute (e.g. “sudo chmod a+wr /dev/”). (Edited to add the less secure way)
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Looking for help to add Flex Voltage information to my Grafana Chart via Node-Red.

    Here is a screenshot of a time-domain chart of the bus voltage, just ahead of the Flex Power Poles.   You can see where I powered up the Flex followed by some FT8 transmissions.



    I am using an AdaFruit INA-219 Voltage/Amp sensor monitoring the DC Distribution box just ahead of the Flex:



    At the same time, I watched the internal Flex voltages as shown by FRStack.  The internal voltages are about one-half volt less than the external bus voltages.  I would like to explore this further by using Node-Red and adding the internal Flex voltages to the same time domain chart as my bus voltages.

    Here is a listing of what looks like available internal voltages from the Flex API Wiki:


    I already use the Flex API flow, shown below, provided on this forum.  Not sure who developed it, Mike, Joe, or Dave....but thanks:


    To add the voltages, I believe there must be a "subscribe" message and then a Node-Red node to filter out the desired portions of the returned message.   I have read the Wiki over and over and still do not "get" how to write these commands.

    Help....could someone help me to add the additional subscribe and receive flow elements to get Flex voltages?

    Alan
    WA9WUD

    PS.    not ready to make this a discussion on Flex voltages/merits of Power Poles...I want more data first.




  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Making some progress on inputting Flex Input Voltage into Node-Red.

    I successfully subscribed to meter #15, "Radio Input Voltage at PA".

    In response, I get the meter "context packet" for meter#15, but no data.   Here is a screenshot of the response:

    image
    Here is what the WIKI for metering says:

    "The metering protocol is sent using VTIA-49 extension and context extension packets. The meters that are sent in the extension packets (meter packets) are detailed in the extension context packet. In other words, which meters will be sent, their descriptions, units, etc. are all sent in the context packet. Once the context packet has been received and parsed, your software can understand the format of the meter packets themselves."

    So... how do I gain access, in Node-Red, to the meter packets?

    Alan
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    From the Wiki:

    "The meter identifier is a 16-bit number that is used to tie the meter value to its context information in this packet. It must be preserved so that it may be matched with the metering data itself. These generally start with 0 and go through the number of meters, but it is possible that numbers could be skipped.

    So, I have parsed the context extension and obtained the meter id.   

    "S82D5EAC6|meter".

    Also, from the Wiki:

    "The meter extension packet is sent frequently (typically at a 10Hz rate) and contains all of the meters described in the context packet."

    I just need to know where to point Node-Red to see the "meter extension packet".

    Any help would be appreciated.

    Alan
    WA9WUD
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    More Research.   From the Wiki:

    The SmartSDR Ethernet API has a number of distinct pieces:
    1. The SmartSDR Command API which is used to command the radio and receive streaming status information from the radio. The command API uses TCP/IP port 4992.
    2. Streaming data is sent from the radio in the VITA-49 format from UDP/IP port 4991 to targeted clients. This data carries:
      1. FFT data used in panadapters and waterfall displays
      2. Metering protocol which provides meter data on the radio itself as well as receivers and such
    So.....I set up a Node-Red UDP listener on port 4991.............nothing but silence.
    So.....I set up an IP listener, pointed at the IP for my flex and on port 4991......would not connect.

    Looks like the key missing is "to targeted clients".   How do I become a targeted client?  I am subscribed to meters sending the command on port 4992.    That seemed to work since I received the context extension......but where or where is meter data?

    Help, anyone

    Alan
    WA9WUD
  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    I use PST Rotor for Azimuth and Elevation control while Satellite Tracking.  PST Rotor provides a UDP control and data connection with some simple commands.

    Using the UDP interface, I made a simple Node-Red flow and Dashboard.   I plan to continue to use the PST Rotor App but I added a new feature, using Node-Red, that I needed for Satellite Tracking.

    Often, after putting PST Rotor in the "Tracking" mode to follow a satellite, I would forget to return the mode to "manual".  Then, several days later, while outside, I would see my rotors happily following the satellite as it crosses some other continent.....putting unnecessary wear and tear on my rotors.

    So....I used NodeRred to return the PST Rotor mode to "Manual" from "Tracking", after a 15-minute time-out. 

    Here is a screenshot from my PC and it looks great on my iPhone.

    The timer is available on the flow and can be changed to anything you want.



    Alan
    WA9WUD

    Here is the code:

    [{"id":"7bf7b499.94f60c","type":"tab","label":"PST Rotor","disabled":false,"info":""},{"id":"6a77853.1d8d47c","type":"udp in","z":"7bf7b499.94f60c","name":"","iface":"","port":"12001","ipv":"udp4","multicast":"false","group":"","datatype":"buffer","x":289,"y":288,"wires":[["fa8dc3d7.202ea8","b8005375.0e9b48"]]},{"id":"fa8dc3d7.202ea8","type":"debug","z":"7bf7b499.94f60c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":557,"y":451,"wires":[]},{"id":"5eb1d972.c95c4","type":"udp out","z":"7bf7b499.94f60c","name":"","addr":"192.168.50.130","iface":"","port":"12000","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":1092,"y":811,"wires":[]},{"id":"a57d414b.04f2e8","type":"ui_button","z":"7bf7b499.94f60c","name":"Track","group":"719af95d.f54d9","order":2,"width":4,"height":1,"passthru":true,"label":"<font size = 6>Track","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><TRACK>1</TRACK></PST>","payloadType":"str","topic":"","x":419,"y":732,"wires":[["22026a9c.c8e94e","7360d45e.d04bac"]]},{"id":"c2d2501b.d8ad18","type":"ui_template","z":"7bf7b499.94f60c","group":"316912ab.78153e","name":"button template","order":1,"width":0,"height":0,"format":"<style>
     .filled {
         height: 100% !important;

         padding: 0 !important;
         margin: 0 !important;
     }
     .nr-dashboard-template {
         padding: 0;
         margin: 0;
     }
     
     .rounded {
     border-radius: 12px 12px 12px 12px;
    }

      .bigfont {
     font-size: 18px;
    }

      .smallfont {
     font-size: 12px;
    }
     
    </style>

    <script>
    $('.vibrate').on('click', function() {
     navigator.vibrate(100);
    });

    function restore_bg(x) {
               $(this).css(""background-color"", x);
       };

    $('.touched').on('mousedown', function() {
       
       var x= $(this).css(""background-color"");
       $(this).css(""background-color"", ""yellow"");
       
       setTimeout(restore_bg.bind(this,x),100);
       navigator.vibrate(80);
       });
       
    </script>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1084,"y":717,"wires":[[]]},{"id":"ceb88868.539a38","type":"ui_button","z":"7bf7b499.94f60c","name":"Manual","group":"719af95d.f54d9","order":1,"width":4,"height":1,"passthru":true,"label":"<font size = 6> Manual","tooltip":"","color":"Black","bgcolor":"Yellow","icon":"","payload":"<PST><TRACK>0</TRACK></PST>","payloadType":"str","topic":"","x":428,"y":816,"wires":[["8c0ec987.736ae8"]]},{"id":"22026a9c.c8e94e","type":"stoptimer2","z":"7bf7b499.94f60c","duration":"5","durationType":"num","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":199,"y":812,"wires":[["ceb88868.539a38"],[]]},{"id":"9e48667.a23ca18","type":"function","z":"7bf7b499.94f60c","name":"Azimuth","func":"// Convert Buffer to String:
    var data = msg.payload.toString()
    // Split it using the ':' character
    var parts = data.split("":"");

    // parts is now a two-element array, containing ""AZ"" and ""129.9""
    // use the second element:
    msg.payload = parts[1];

    return msg","outputs":1,"noerr":0,"x":871,"y":183,"wires":[["b1303971.c88dc","194ee42d.e73f0c","82364800.891508"]]},{"id":"b1303971.c88dc","type":"debug","z":"7bf7b499.94f60c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1080,"y":132,"wires":[]},{"id":"b8005375.0e9b48","type":"switch","z":"7bf7b499.94f60c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"AZ","vt":"str"},{"t":"cont","v":"EL","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":587,"y":284,"wires":[["9e48667.a23ca18"],["dcedfa3f.1c7558"]]},{"id":"dcedfa3f.1c7558","type":"function","z":"7bf7b499.94f60c","name":"Elevation","func":"// Convert Buffer to String:
    var data = msg.payload.toString()
    // Split it using the ':' character
    var parts = data.split("":"");

    // parts is now a two-element array, containing ""AZ"" and ""129.9""
    // use the second element:
    msg.payload = parts[1];

    return msg","outputs":1,"noerr":0,"x":933,"y":422,"wires":[["4de6f8e6.cf037","73089bda.055f4c","63c18764.3eacb8"]]},{"id":"4de6f8e6.cf037","type":"debug","z":"7bf7b499.94f60c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1127,"y":497,"wires":[]},{"id":"73089bda.055f4c","type":"ui_text","z":"7bf7b499.94f60c","group":"5e497553.f26e3c","order":1,"width":4,"height":2,"name":"","label":"Degrees","format":" <font size = 10px color = red> {{msg.payload}}","layout":"col-center","x":1141,"y":443,"wires":[]},{"id":"63c18764.3eacb8","type":"ui_gauge","z":"7bf7b499.94f60c","name":"Elevation","group":"5e497553.f26e3c","order":4,"width":4,"height":3,"gtype":"gage","title":"","label":"Degrees","format":"{{value}}","min":0,"max":"180","colors":["#00b500","#e6e600","#ca3838"],"seg1":"179","seg2":"180","x":1141,"y":381,"wires":[]},{"id":"194ee42d.e73f0c","type":"ui_text","z":"7bf7b499.94f60c","group":"6f8664b0.f1d9b4","order":1,"width":4,"height":2,"name":"Azimuth","label":"Degrees","format":" <font size = 10px color = red> {{msg.payload}}","layout":"col-center","x":1078,"y":197,"wires":[]},{"id":"82364800.891508","type":"ui_gauge","z":"7bf7b499.94f60c","name":"","group":"6f8664b0.f1d9b4","order":4,"width":4,"height":3,"gtype":"compass","title":"","label":"Degrees","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1096,"y":266,"wires":[]},{"id":"5fa2b20e.873ebc","type":"link in","z":"7bf7b499.94f60c","name":"","links":["5dbe6004.654578","699dfd48.403dfc","50be597a.a37fa","7360d45e.d04bac","8c0ec987.736ae8","aeaba61a.35f378","225f1b5d.9ba0ac","77d78494.4b4c0c","ce251477.917c78","448b3b0c.231c8c","31d68e3d.565412","41b09da3.5dabc4","9e047a6f.e338c","971f9f0d.f73ab","37d91623.35a34a","beb1fae6.e33348","f730a6d7.e72d38","c4048b18.6f3e9","3f798fe2.0cf56","c8b78c92.a4aa7","b7234289.71feb","b7add295.c3a238","dfb8be4c.35fe98","cc874a2d.7b2d","e9f5f130.8947","56d2af35.f35f","be847d04.8c55c8","83d67fcb.b25868","7159bcb4.b1d944","5d84a9d5.91cd3"],"x":772,"y":810,"wires":[["5eb1d972.c95c4"]]},{"id":"7360d45e.d04bac","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":567,"y":734,"wires":[]},{"id":"8c0ec987.736ae8","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":577,"y":815,"wires":[]},{"id":"aeaba61a.35f378","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":365,"y":1046,"wires":[]},{"id":"d8630bf6.aee65","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 270","group":"6f8664b0.f1d9b4","order":6,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 270","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>270</AZIMUTH></PST>","payloadType":"str","topic":"","x":223,"y":1043,"wires":[["aeaba61a.35f378"]]},{"id":"225f1b5d.9ba0ac","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":357,"y":1381,"wires":[]},{"id":"186a2d19.c63c0b","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 90","group":"6f8664b0.f1d9b4","order":19,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 90","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>90</AZIMUTH></PST>","payloadType":"str","topic":"","x":223,"y":1378,"wires":[["225f1b5d.9ba0ac"]]},{"id":"77d78494.4b4c0c","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":370,"y":898,"wires":[]},{"id":"48527ee0.bdb24","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 360","group":"6f8664b0.f1d9b4","order":2,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 360","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>3</AZIMUTH></PST>","payloadType":"str","topic":"","x":228,"y":895,"wires":[["77d78494.4b4c0c"]]},{"id":"ce251477.917c78","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":336,"y":1199,"wires":[]},{"id":"2b5efdbe.5ec512","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 180","group":"6f8664b0.f1d9b4","order":11,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 180","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>180</AZIMUTH></PST>","payloadType":"str","topic":"","x":212,"y":1199,"wires":[["ce251477.917c78"]]},{"id":"31d68e3d.565412","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":791,"y":919,"wires":[]},{"id":"fe7bc53.c6822b8","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 90","group":"5e497553.f26e3c","order":2,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 90","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>90</ELEVATION></PST>","payloadType":"str","topic":"","x":639,"y":916,"wires":[["31d68e3d.565412"]]},{"id":"41b09da3.5dabc4","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":790,"y":1067,"wires":[]},{"id":"54f31b11.ed44bc","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 45","group":"5e497553.f26e3c","order":6,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 45","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>45</ELEVATION></PST>","payloadType":"str","topic":"","x":638,"y":1064,"wires":[["41b09da3.5dabc4"]]},{"id":"9e047a6f.e338c","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":794,"y":1224,"wires":[]},{"id":"c1f6f092.f9c05","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 0","group":"5e497553.f26e3c","order":11,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 0","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>0</ELEVATION></PST>","payloadType":"str","topic":"","x":655,"y":1220,"wires":[["9e047a6f.e338c"]]},{"id":"971f9f0d.f73ab","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":359,"y":1265,"wires":[]},{"id":"af6c9124.410638","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 150","group":"6f8664b0.f1d9b4","order":13,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 150","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>150</AZIMUTH></PST>","payloadType":"str","topic":"","x":217,"y":1262,"wires":[["971f9f0d.f73ab"]]},{"id":"37d91623.35a34a","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":361,"y":1329,"wires":[]},{"id":"b253a6ec.7157b","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 120","group":"6f8664b0.f1d9b4","order":15,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 120","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>120</AZIMUTH></PST>","payloadType":"str","topic":"","x":219,"y":1326,"wires":[["37d91623.35a34a"]]},{"id":"beb1fae6.e33348","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":355,"y":1436,"wires":[]},{"id":"d3939ed0.84e4d8","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 60","group":"6f8664b0.f1d9b4","order":17,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 60","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>60</AZIMUTH></PST>","payloadType":"str","topic":"","x":217,"y":1437,"wires":[["beb1fae6.e33348"]]},{"id":"c4048b18.6f3e9","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":791,"y":973,"wires":[]},{"id":"401ae2a5.87398c","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 75","group":"5e497553.f26e3c","order":3,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 75","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>75</ELEVATION></PST>","payloadType":"str","topic":"","x":639,"y":970,"wires":[["c4048b18.6f3e9"]]},{"id":"3f798fe2.0cf56","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":789,"y":1019,"wires":[]},{"id":"d4dc80a.199b5","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 60","group":"5e497553.f26e3c","order":5,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 60","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>60</ELEVATION></PST>","payloadType":"str","topic":"","x":637,"y":1016,"wires":[["3f798fe2.0cf56"]]},{"id":"c8b78c92.a4aa7","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":797,"y":1117,"wires":[]},{"id":"7cf4bec8.7cc63","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 30","group":"5e497553.f26e3c","order":7,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 30","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>130</ELEVATION></PST>","payloadType":"str","topic":"","x":641,"y":1118,"wires":[["c8b78c92.a4aa7"]]},{"id":"b7234289.71feb","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":797,"y":1176,"wires":[]},{"id":"d58c2860.dd152","type":"ui_button","z":"7bf7b499.94f60c","name":"EL 15","group":"5e497553.f26e3c","order":9,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 15","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><ELEVATION>15</ELEVATION></PST>","payloadType":"str","topic":"","x":645,"y":1173,"wires":[["b7234289.71feb"]]},{"id":"b7add295.c3a238","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":366,"y":952,"wires":[]},{"id":"b94fb45.0ac4c48","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 330","group":"6f8664b0.f1d9b4","order":3,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 330","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>330</AZIMUTH></PST>","payloadType":"str","topic":"","x":224,"y":949,"wires":[["b7add295.c3a238"]]},{"id":"dfb8be4c.35fe98","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":363,"y":1001,"wires":[]},{"id":"a684c5b9.1c3c4","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 300","group":"6f8664b0.f1d9b4","order":5,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 300","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>300</AZIMUTH></PST>","payloadType":"str","topic":"","x":221,"y":998,"wires":[["dfb8be4c.35fe98"]]},{"id":"e9f5f130.8947","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":355,"y":1109,"wires":[]},{"id":"c867efbc.7d6b2","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 240","group":"6f8664b0.f1d9b4","order":7,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 240","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>240</AZIMUTH></PST>","payloadType":"str","topic":"","x":234,"y":1090,"wires":[["e9f5f130.8947"]]},{"id":"56d2af35.f35f","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":353,"y":1155,"wires":[]},{"id":"6a3dffdc.3fea88","type":"ui_button","z":"7bf7b499.94f60c","name":"AZ 210","group":"6f8664b0.f1d9b4","order":9,"width":3,"height":1,"passthru":true,"label":"<font size = 6> 210","tooltip":"","color":"Black","bgcolor":"Red","icon":"","payload":"<PST><AZIMUTH>210</AZIMUTH></PST>","payloadType":"str","topic":"","x":211,"y":1152,"wires":[["56d2af35.f35f"]]},{"id":"8f78fcbd.90e56","type":"ui_button","z":"7bf7b499.94f60c","name":"Park","group":"719af95d.f54d9","order":4,"width":4,"height":1,"passthru":true,"label":"<font size = 6> Park","tooltip":"","color":"Black","bgcolor":"Green","icon":"","payload":"<PST><PARK>1</PARK></PST>","payloadType":"str","topic":"","x":423,"y":663,"wires":[["7159bcb4.b1d944"]]},{"id":"7159bcb4.b1d944","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":571,"y":665,"wires":[]},{"id":"396d49fb.c2efde","type":"ui_button","z":"7bf7b499.94f60c","name":"Stop","group":"719af95d.f54d9","order":3,"width":4,"height":1,"passthru":true,"label":"<font size = 6> Stop","tooltip":"","color":"Black","bgcolor":"Blue","icon":"","payload":"<PST><STOP>1</STOP></PST>","payloadType":"str","topic":"","x":423,"y":583,"wires":[["5d84a9d5.91cd3"]]},{"id":"5d84a9d5.91cd3","type":"link out","z":"7bf7b499.94f60c","name":"","links":["5fa2b20e.873ebc"],"x":571,"y":585,"wires":[]},{"id":"719af95d.f54d9","type":"ui_group","z":"","name":"Control","tab":"b44455bb.5f0478","order":4,"disp":true,"width":4,"collapse":false},{"id":"316912ab.78153e","type":"ui_group","z":"","name":"Actions","tab":"","order":3,"disp":true,"width":"6","collapse":false},{"id":"5e497553.f26e3c","type":"ui_group","z":"","name":"Elevation","tab":"b44455bb.5f0478","order":3,"disp":true,"width":7,"collapse":false},{"id":"6f8664b0.f1d9b4","type":"ui_group","z":"","name":"Azimuth","tab":"b44455bb.5f0478","order":1,"disp":true,"width":7,"collapse":false},{"id":"b44455bb.5f0478","type":"ui_tab","z":"","name":"PST Rotor Control","icon":"dashboard","order":7,"disabled":false,"hidden":false}]
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Eric from Flex asked if I was connecting to the UDP port after I subscribe.  Not sure how Node-Red does that??

    I added a command to connect to UDP port 4991 on the Node-Red Flow and port 4991 and sent the command after I subscribed to meter 15.  Port 4991 started showing a stream of outputs.  However, the outputs do not appear, to me, to conform to the metering protocol shown in the WIKI??

    Here is the protocol from the WIKI:



    Here is the simple test flow:

    Could others give this a test drive and let me know what I am missing?

    Alan



    And here is the code

    [{"id":"d7aa779.04b2e88","type":"tab","label":"Volts","disabled":false,"info":""},{"id":"32fb7af7.64a7f6","type":"udp in","z":"d7aa779.04b2e88","name":"","iface":"","port":"4991","ipv":"udp4","multicast":"false","group":"","datatype":"buffer","x":712,"y":599,"wires":[["c9670d08.5d466"]]},{"id":"c9670d08.5d466","type":"debug","z":"d7aa779.04b2e88","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":934,"y":602,"wires":[]},{"id":"10c58da1.46e04a","type":"trigger","z":"d7aa779.04b2e88","op1":"C173|sub tx all","op2":"C173|sub tx all","op1type":"str","op2type":"str","duration":"60","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":527.01953125,"y":265.00390625,"wires":[["aaf56156.78f66"]]},{"id":"c284b3fb.8d2cf","type":"tcp out","z":"d7aa779.04b2e88","host":"","port":"","beserver":"reply","base64":false,"end":false,"name":"","x":967.01953125,"y":305.00390625,"wires":[]},{"id":"620b2256.4b23ec","type":"tcp in","z":"d7aa779.04b2e88","name":"","server":"client","host":"192.168.50.80","port":"4992","datamode":"stream","datatype":"utf8","newline":"\\n","topic":"","base64":false,"x":157.01953125,"y":265.00390625,"wires":[["10c58da1.46e04a","386c993d.0ab0c6"]]},{"id":"aaf56156.78f66","type":"function","z":"d7aa779.04b2e88","name":"SUB Meter 15","func":"// C172|sub slice all\nmsg.payload = \"C73|sub meter 15\\r\"; \nreturn msg;","outputs":1,"noerr":0,"x":744,"y":419,"wires":[["c284b3fb.8d2cf","24bcc1b6.d6dc56"]]},{"id":"a76d7dc6.99eff","type":"function","z":"d7aa779.04b2e88","name":"port 4991","func":"// C172|sub slice all\nmsg.payload = \"C73|client udpport 4991\\r\"; \nreturn msg;","outputs":1,"noerr":0,"x":794,"y":163,"wires":[["c284b3fb.8d2cf","9605b06a.281568"]]},{"id":"386c993d.0ab0c6","type":"debug","z":"d7aa779.04b2e88","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":441,"y":370,"wires":[]},{"id":"e9e6cfdb.1e52","type":"inject","z":"d7aa779.04b2e88","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":490.51171875,"y":444.94921875,"wires":[["aaf56156.78f66"]]},{"id":"24bcc1b6.d6dc56","type":"debug","z":"d7aa779.04b2e88","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1030,"y":407,"wires":[]},{"id":"2a17caf1.6ebcf6","type":"inject","z":"d7aa779.04b2e88","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":585,"y":158,"wires":[["a76d7dc6.99eff"]]},{"id":"9605b06a.281568","type":"debug","z":"d7aa779.04b2e88","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1051,"y":162,"wires":[]}]
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Eric, from Flex, has confirmed the output is correct.

    Eric said the meter packets follow the VITA-49 standard and are in the protocol as shown on the Wiki;   http://wiki.flexradio.com/index.php?title=Metering_protocol#Meter_Extension_Packet 

    So.....can anyone suggest how to use Node-Red to decode VITA-49 Packets?

    Also, we confirmed the UDP connect command must be given concurrently with or after the meter subscribe command.  My flow, for now, has you do this with a manual inject node.

    We are getting close to having meter data from the Flex if we can **** this code!

    Alan
    WA9WUD
  • Alan
    Alan Member ✭✭✭✭
    edited January 2020
    Some good news!  But still, need a community effort to get this done.  The last element is decoding the VITA49 packets.

    Doug, K3TZR, a member of the Flex Community, has written code in Swift (Mac) to input and decode the VITA49 packets, including the Meter Packets and has offered some help to the Node-Red guys to convert his code for Node-Red consumption.

    If you want to see his work, here is a link to his GitHub;  

      https://raw.githubusercontent.com/DougPA/xLib6000/master/xLib6000/Networking/Vita.swift

    Doug does not use Node-Red, but he has provided a "roadmap" which he says a knowledgable programmer could use to write a JavaScript (correct, that is what runs in our "function" node?) equivalent.

    Because we are only subscribing to the meter packets from the Flex radio, if I understand Doug correctly:
    1. Convert from Big-Endian to Little-Endian format,
    2. Parse out the first 28 bits,
    3. Test for Number of Meters
    4. Parse based on the number of meters.
    I reprinted Doug's response following this message. Also, I can send the pdf, which Doug provided, of the VITA49 Standards, via e-mail request.

    I have to believe we could all benefit by having Flex Meters available in our Node-Red flows, so if some program knowledgable person is willing to write this meter decoder, a large number of community members would be grateful.

    Alan

    WA9WUD

    =======================================

    Alan,

    Assuming that the data you are receiving has all of the UDP packet stuff stripped from it, the first 28 bytes of the Vita packet are as follows:

    packetDesc 1 byte
    timeStampDesc 4 bits
    sequenceNumber 4 bits
    packetSize 2 bytes
    streamId 4 bytes
    oui 4 bytes
    classCodes 4 bytes
    integerTimeStamp 4 bytes
    fractionalTimeStampMsb 4 bytes
    fractionalTimeStampLsb 4 bytes

    If you know that you have a Meter packet, you can basically ignore these. In my case where I’m receiving lots of other UDP streams, I need to check all of these to determine what type of packet I’ve received (e.g. panadapter, waterfall, audio, etc.). All of the multi-byte items are in Big-Endian form and may need to be converted to your host format (e.g. Little-Endian, the Mac and PC’s are Little-Endian internally).

    The remainder of the Meter packet is the so-called “payload”, i.e. the actual Meter data. The payload is a string of bytes.

    The payload of a Meter packet can contain one or more meters. You can determine the number of meters in the packet by dividing the payload size (in bytes) by 4. I.e. each meter takes up four bytes as follows:

    meterNumber 2 bytes
    meterValue 2 bytes

    Again, these multi-byte values are in Big-Endian form and may need to be converted to your host format (e.g. Little-Endian). They are unsigned 16-bit numbers.

    I hope all this helps. I’ve attached a copy of the Vita spec (it’s old but probably still correct for the things you need). Feel free to ask questions.

    There should be one correction, the meter values are signed integers.

    Good Luck.

    73’s
    Doug - K3TZR

  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Mark, at MKCM, developer of FRStack has added a new UDP broadcast feature.  Lots of thanks to Mark!

    The new "Radio Meter Info" option broadcasts a JSON formated message containing all of the meter data already contained in FRStack from the Flex Radio.

    The existing "Radio Slice Info" broadcasts an XML message that is formatted for third-party apps to use.  I use this to directly import frequency data into my HF-Auto application.




    Below is the code for my flow to receive both of the UDP broadcasts from FRStack.  

    I currently have not found a practical use for the Slice Info datastream, from within Node-Red.   Third-party applications seem happy to directly use the FRStack Slice Data.

    The FRStack Meter UDP broadcasts, on the other hand, are very useful within Node-Red.   I have incorporated the data in my dashboards and in my Grafana trend graphs. 

    The meter data portion of the flow receives the JSON data, converts it to JavaScript and then, for my use, sends it to an MQTT Server and an InfluxDB server.  Your use of the data will vary per your use case.

    Alan
    WA9WUD

    ==============================

    [{"id":"75467659.1d9028","type":"tab","label":"FR STack UDP Data","disabled":false,"info":""},{"id":"2f675157.d87f2e","type":"udp in","z":"75467659.1d9028","name":"FRStack Radio Data","iface":"","port":"12073","ipv":"udp4","multicast":"false","group":"","datatype":"utf8","x":115,"y":298,"wires":[["4509879e.0fef","95fe39b2.68a29"]]},{"id":"4509879e.0fef","type":"xml","z":"75467659.1d9028","name":"","property":"payload","attr":"","chr":"","x":324,"y":98,"wires":[["8c7dad91.1d6828"]]},{"id":"8c7dad91.1d6828","type":"debug","z":"75467659.1d9028","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":554,"y":99,"wires":[]},{"id":"968a7d15.13dad","type":"udp in","z":"75467659.1d9028","name":"FRStack Meter Data","iface":"","port":"13000","ipv":"udp4","multicast":"false","group":"","datatype":"utf8","x":123,"y":410,"wires":[["ccb0ff15.e27bf","677ae4c7.73190c"]]},{"id":"95fe39b2.68a29","type":"debug","z":"75467659.1d9028","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":368,"y":297,"wires":[]},{"id":"ccb0ff15.e27bf","type":"json","z":"75467659.1d9028","name":"","property":"payload","action":"","pretty":false,"x":221,"y":1069,"wires":[["592adb9d.f0d374","6454e486.37fe6c","af68ff1d.a25c88","e6cb4908.3f4828","367b5223.b7f286","2dc2a413.a04e2c"]]},{"id":"592adb9d.f0d374","type":"debug","z":"75467659.1d9028","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":535,"y":495,"wires":[]},{"id":"6454e486.37fe6c","type":"change","z":"75467659.1d9028","name":"PA Temp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.meters.PATEMPC","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":496,"y":711,"wires":[["5b71cc45.761544"]]},{"id":"af68ff1d.a25c88","type":"change","z":"75467659.1d9028","name":"Flex PA Voltage","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.meters[""+13.8A""]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":467,"y":1150,"wires":[["8642ac41.0f827","8f97ff13.a55c68","f3061743.6cacb8"]]},{"id":"8f1d3658.c11ac8","type":"debug","z":"75467659.1d9028","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":892,"y":1188,"wires":[]},{"id":"e4443ce1.22675","type":"influxdb out","z":"75467659.1d9028","influxdb":"b5efa8f3.874f78","name":"","measurement":"Flex_PA_Volts","precision":"","retentionPolicy":"","x":997,"y":1323,"wires":[]},{"id":"8642ac41.0f827","type":"function","z":"75467659.1d9028","name":"String to Number","func":"var c = msg.payload;
    var f;
    f = (c*1);
    msg.payload = f;
    return msg;","outputs":1,"noerr":0,"x":707,"y":1243,"wires":[["8f1d3658.c11ac8","e4443ce1.22675"]]},{"id":"c17dfb59.e5c838","type":"debug","z":"75467659.1d9028","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":971,"y":906,"wires":[]},{"id":"8c507e44.4c432","type":"influxdb out","z":"75467659.1d9028","influxdb":"b5efa8f3.874f78","name":"","measurement":"Flex_PA_Temp","precision":"","retentionPolicy":"","x":1084,"y":979,"wires":[]},{"id":"5e730e1.83c32f","type":"function","z":"75467659.1d9028","name":"String to Number","func":"var c = msg.payload;
    var f;
    f = (c*1);
    msg.payload = f;
    return msg;","outputs":1,"noerr":0,"x":687,"y":871,"wires":[["c17dfb59.e5c838","8c507e44.4c432"]]},{"id":"5b71cc45.761544","type":"function","z":"75467659.1d9028","name":"function","func":"

       //Take msg.payload of the temp celcus and save it to a var
       var tempc = msg.payload;

       //Convert temp celcus to Fahrenheit
       var tempf = tempc * 9/5 + 32;

       //round the number to get rid of all them decimals
       tempf = Math.round(tempf * 10000) / 10000;

       //set msg.payload to Fahrenheit
       msg.payload = tempf;

       //send it!!!!!!!
       return msg;
    ","outputs":1,"noerr":0,"x":808,"y":697,"wires":[["4c47631d.3f2834","5e730e1.83c32f","c9889cf2.87186"]]},{"id":"e6cb4908.3f4828","type":"change","z":"75467659.1d9028","name":"Flex FWD Power","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.meters.FWDPWR","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":473,"y":1456,"wires":[["766c8f5d.28d1c8","c08d9177.6332b"]]},{"id":"367b5223.b7f286","type":"change","z":"75467659.1d9028","name":"Flex REV Power","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.meters.REVPWR","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":472,"y":1586,"wires":[["94ef17a9.5ba5d","a7f96da0.a021"]]},{"id":"2dc2a413.a04e2c","type":"change","z":"75467659.1d9028","name":"Flex SWR","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.meters.SWR","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":444,"y":1718,"wires":[["84e594d0.11644","ab037df1.a07a8"]]},{"id":"677ae4c7.73190c","type":"debug","z":"75467659.1d9028","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":368,"y":407,"wires":[]},{"id":"c9889cf2.87186","type":"mqtt out","z":"75467659.1d9028","name":"Flex_PA_Temp","topic":"Flex PA Temp","qos":"","retain":"","broker":"1e127ffc.3be278","x":1142,"y":765,"wires":[]},{"id":"f3061743.6cacb8","type":"mqtt out","z":"75467659.1d9028","name":"Flex PA Volts","topic":"Flex_PA_Volts","qos":"","retain":"","broker":"1e127ffc.3be278","x":1178,"y":1137,"wires":[]},{"id":"c08d9177.6332b","type":"mqtt out","z":"75467659.1d9028","name":"Flex Power","topic":"Flex_Power","qos":"","retain":"","broker":"1e127ffc.3be278","x":1153,"y":1497,"wires":[]},{"id":"a7f96da0.a021","type":"mqtt out","z":"75467659.1d9028","name":"Flex Reverse Power","topic":"Flex_REV_Power","qos":"","retain":"","broker":"1e127ffc.3be278","x":1160,"y":1631,"wires":[]},{"id":"ab037df1.a07a8","type":"mqtt out","z":"75467659.1d9028","name":"Flex SWR","topic":"Flex_SWR","qos":"","retain":"","broker":"1e127ffc.3be278","x":1127,"y":1765,"wires":[]},{"id":"8f97ff13.a55c68","type":"ui_level","z":"75467659.1d9028","group":"485a61b3.73f5a8","order":1,"width":0,"height":0,"name":"Volts","label":"PA Volts","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"15","segWarn":"","segHigh":"","unit":"V","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"soft","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"peaktime":3000,"x":1159,"y":1070,"wires":[]},{"id":"4c47631d.3f2834","type":"ui_level","z":"75467659.1d9028","group":"485a61b3.73f5a8","order":1,"width":0,"height":0,"name":"PA Temp","label":"PA Temp","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"150","segWarn":"100","segHigh":"120","unit":"F","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"soft","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"peaktime":3000,"x":1116,"y":690,"wires":[]},{"id":"766c8f5d.28d1c8","type":"ui_level","z":"75467659.1d9028","group":"485a61b3.73f5a8","order":1,"width":0,"height":0,"name":"Forward Power","label":"Forward Power","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"100","segWarn":"","segHigh":"","unit":"W","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"soft","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"peaktime":3000,"x":1148,"y":1447,"wires":[]},{"id":"94ef17a9.5ba5d","type":"ui_level","z":"75467659.1d9028","group":"485a61b3.73f5a8","order":1,"width":0,"height":0,"name":"Reverse Power","label":"Reverse Power","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"25","segWarn":"","segHigh":"","unit":"W","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"soft","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"peaktime":3000,"x":1141,"y":1580,"wires":[]},{"id":"84e594d0.11644","type":"ui_level","z":"75467659.1d9028","group":"485a61b3.73f5a8","order":1,"width":0,"height":0,"name":"SWR","label":"SWR","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"15","segWarn":"","segHigh":"","unit":"","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"soft","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"peaktime":3000,"x":1109,"y":1708,"wires":[]},{"id":"b5efa8f3.874f78","type":"influxdb","z":"","hostname":"192.168.50.137","port":"8086","protocol":"http","database":"alan","name":"","usetls":false,"tls":"29143eee.ae7202"},{"id":"1e127ffc.3be278","type":"mqtt-broker","z":"","name":"","broker":"192.168.50.137","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"485a61b3.73f5a8","type":"ui_group","z":"","name":"Meters","tab":"98776d43.fc5c58","order":1,"disp":true,"width":"6","collapse":false},{"id":"29143eee.ae7202","type":"tls-config","z":"","name":"local-tls","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","verifyservercert":false},{"id":"98776d43.fc5c58","type":"ui_tab","z":"","name":"Flex","icon":"dashboard","order":7,"disabled":false,"hidden":false}]




  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited February 2020
    Awesome!  I'll have to give it a try.  

    Thanks Mark!
  • Alan
    Alan Member ✭✭✭✭
    edited February 2020
    Mike gave examples of building "interlocks" using Node-Red.   I use an HF LA-1K amp, which is not supported by any sort of remote operating utility.  I use Node-Red to operate the amp and a tuner remotely.

    I use GPIO controlled relays for 240 VAC power (via a motor starter relay), for HF Tuner on/off and to enable the PTT line to to the LA-1K amp from the Flex Aux PTT.  This way, I can tune, with the amp in "operate" without transmitting RF from the amp.  The LA-1K is frequency sensing, so that is taken care of by the amp.

    My "interlock" using Node-Red, is to not allow the PTT relay to close if the Flex TX Power Setting is greater then 50%.  I borrowed the "Flex Info" flow from others and used that to input the Flex power setting to a Node-Red Switch Node, a Change Node, and a Gate Node to allow the PTT to be energized only when the Flex power setpoint is less than 50%.

    This same method could be used on the other brands of amplifiers, which use a PTT from the Flex, and not relying on "profiles", to protect overdriving the amplifier

    I also added an LED indicator on the dashboard to show the status of the interlock.

    Here is a screenshot of the HF station controls and monitoring I have, using Node-Red.

    If anyone has an interest, I will post any of the flows.  




    Alan
    WA9WUD
  • Neal Pollack, N6YFM
    Neal Pollack, N6YFM Member ✭✭
    edited April 2020
    Does anyone know if PSTrotator can work with the Easy Rotor Controller ERC-M model?   If so, I could even adapt my cheap Yaesu G-450a to work with something similar to this.
  • Neal Pollack, N6YFM
    Neal Pollack, N6YFM Member ✭✭
    edited June 2020
    I want to find a way to monitor the output voltage of my Astron inside Node Red.   Has anyone found a voltage sensor module that both;   A.  works with the Raspberry Pi, and B.  is supported under Node Red?

    Thanks,

    Neal

  • Neal Pollack, N6YFM
    Neal Pollack, N6YFM Member ✭✭
    edited June 2020
    Question about remote power off for Flex-6xxx:

    I just completed my Node Red power switch GUI for turning on/off the Astron PS, and also the RCA contact for turning on/off the "momentary front panel button" to start or shutdown the Flex.

    QUESTION:    When you switch open (off) the RCA remote power contact for the Flex-6xxx radio, it starts a clean shutdown sequence for the Flex that takes a small amount of time before the light and fans go off.   If working remotely, how do you detect WHEN the Flex is fully done shutting down,
    BEFORE you switch off  the 12V Astron Power Supply?

    Thanks,

    Neal
  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator
    edited April 2020
    According to PSTRotator web site the Easy Rotor Control is supported.
    I have a Node Red flow to talk to PSTRotatorAZ.

    Dave wo2x
  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator
    edited April 2020
    There are commands you can send to the Flex to show the voltage measured in the radio.

    Dave wo2x
  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator
    edited April 2020
    Depending on which remote client you are using you will no longer see the radio available in the chooser screen when it shuts down. I'd wait an additional 30 seconds after the radio disappears from the chooser window.

    Dave wo2x

  • Alan
    Alan Member ✭✭✭✭
    edited April 2020
    Here is a screenshot of the PST rotor setting pulldown with the list of rotor controllers.    Perhaps the ERC controllers are what you are looking for.

    Alan
    WA9WUDimage

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.