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.

Video walk through of my Remote HF station

Mike-VA3MW
Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
edited August 2020 in Remote Operation (SmartLink)

https://www.youtube.com/watch?v=ARBEaY-pyek
Operating HF Remote is an awesome experience.  Some of the things we have to consider are 

  • What happens when the modem needs resetting
  • How do you handle power failures
  • How do you turn the beam
  • Turn on the 240VAC to the amp
  • Steppir? Band changes
  • Every button that you can normally reach up and push
  • All the other single points of failure as there are a few.  
In this video, this is how I attacked it.  

73, Mike va3mw


Tagged:
«1

Comments

  • Tim VE6SH
    Tim VE6SH Member ✭✭
    edited May 2020
    Tnx! 

    Tim VE6SH
  • Adde Tjernberg
    Adde Tjernberg Member ✭✭
    edited June 2020
    Great presentation. Got hooked on the Node-RED stuff!
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited May 2020
    My hope is that we all share our NodeRed flows so it helps people get started.

    This is where most of the chat is happening https://community.flexradio.com/flexradio/topics/remote-operating-and-node-red

    Mike
  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator
    edited May 2020
    +1 on Node Red. Mike and Andreas, N6NU got me hooked when I was in the hospital, bored. I wrote flows for controlling and monitoring a KPA1500 amp, DLI Web Switch Pro, and Idiom Press serial interface for my rotor. Good stuff indeed. The DLI Web Switch Pro can be set up to ping multiple sites. If it fails ping to all sites three times then it reboots user defined outlets. (Cable modem, router, local maintenance PC). Nice thing is the switch also supports several programming languages to remotely control it. Dave wo2x
  • AA0Z
    AA0Z Member ✭✭
    edited May 2020
    I created time stamps on the YouTube page for major topics with http links to everything I could find.

    Looks like YT is slow on getting the rendered video and my comment on the site, but I'm sure it will be there soon!

    https://youtu.be/_QxapW0bMLc




  • Craig Mitchell
    Craig Mitchell Member
    edited June 2020
    Thank you Mike. I have been trying to build and design something like this for a couple of years.  I have not used Raspberry Pi before. I am familiar with Arduino.  How many I/O ports are you using there for your dashboard? I assume that you must be using a port expander such as the MCP23008?

  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited May 2020
    Hi Craig

    On the PI, none.  All my switches are controlled by HTML links.    This is the switch I use https://www.kmtronic.com/lan-ethernet-ip-8-channels-web-relay-board.html

    You can see the examples here https://info.kmtronic.com/control-kmtronic-lan-relays-using-browser-bookmarks.html

    Mike

  • Craig Mitchell
    Craig Mitchell Member
    edited May 2020
    Thanks Mike, I see that the KMtronic is fine for remote switching, but if you want to process and send back the remote status of your devices or temperature I assume that you would have a number of input ports on the Pi for Node Red to process these sensors and via HTTP posting them to a remote or even local web server? Or am I over complicating matters? 
    As I have a number of remote sites that I want to monitor I was planning on having all the sites monitor their environment and post to a central web server.

  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited May 2020
    Hi Craig

    The KMTRONICS has status XML that it echos back that I capture and that is what sets the LED colour.  So, I have some full circle communication.   As for Temp, that is done on an I2C buss.  The web server runs on the same RPI and is part of the NodeRed installation.

    If you want to monitor a bunch of sites, I would look into MQTT to manage the distribution of the information.  In the Steppir and Rotator flows that N6NU wrote, he uses MQTT to send messages to other operating stations.
  • Alan
    Alan Member ✭✭✭✭
    edited May 2020
    Hi Mike.

    Great video and many good points from your video.  I am adding a remote PTT based on what I learned from your video.

    I sent you a separate e-mail but repeating here in case you want to respond to the community.

    I am adding a Stepp IR Big Vertical to my station and am asking if you can / may share your Stepp IR Flow.

    I thought you did previously, somewhere, but I cannot find it.

    Thanks.

    Alan
    WA9WUD
  • Craig Mitchell
    Craig Mitchell Member
    edited May 2020
    Thanks very much Mike. It's starting to fall into place now. I'll look into MQTT.

  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited May 2020
    Thanks Alan.  Today was a hectic and long day and I am a bit behind on emails.  I will get to them.  73
  • Alan
    Alan Member ✭✭✭✭
    edited May 2020
    Thanks, Mike.   No problem.   I caught the end of your afternoon video and heard you also had a morning of working on your water supply in the lake.

    Alan
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited June 2020
    Here is the Steppir Flow.  I had to get it from Dave WO2X.  It is in 2 parts and you'll have to work through the flow a bit to get it to work.  You can thank Andreas N6NU for all the work he did on it.  Drop him an email and say thanks.  

    This is the core code 

    [{"id":"53077714.115b38","type":"tab","label":"SteppIR","disabled":false,"info":""},{"id":"ba2bb47d.6d8b9","type":"serial in","z":"53077714.115b38","name":"SteppIR In","serial":"fa8abc56.39fd08","x":160,"y":100,"wires":[["93ef5c11.cd532","54b0232e.5afef4","810f63d2.a56c48"]]},{"id":"8c3f99e7.0bcdb","type":"serial out","z":"53077714.115b38","name":"SteppIR Out","serial":"fa8abc56.39fd08","x":950,"y":240,"wires":[]},{"id":"bad46735.4bc95","type":"inject","z":"53077714.115b38","name":"","topic":"","payload":"?A","payloadType":"str","repeat":"1","crontab":"","once":false,"onceDelay":"","x":350,"y":180,"wires":[["e70af74c.ed1ac8","b95263d7.181fb"]]},{"id":"e70af74c.ed1ac8","type":"function","z":"53077714.115b38","name":"AddCR","func":"msg.payload=msg.payload+\"\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":180,"wires":[["8c3f99e7.0bcdb","bdbb0879.4fb8a"]]},{"id":"93ef5c11.cd532","type":"function","z":"53077714.115b38","name":"ParseSteppirBuffer","func":"var Direction = 0;\n\nvar DirectionStrings = [\"Norm\",\"BiDir\",\"180\",\"3/4\",\"BiDir\",\"5\",\"6\",\"7\"];\n\nvar Frequency =0;\n\nvar MotorFlag =0;\n\nFrequencyBuffer= new Buffer(msg.payload); \n\nFrequency =  FrequencyBuffer[3] *256 *256 ;\nFrequency =  Frequency+ FrequencyBuffer[4] *256 ;\nFrequency =  Frequency+ FrequencyBuffer[5];\n\nflow.set(\"SteppIRfromFreq\",Frequency);\n\nDirection = FrequencyBuffer[7];\nDirection = (Direction & 0b11100000) >> 5;\n\nMotorFlag = FrequencyBuffer[6];\n\nflow.set(\"SteppIRMotorFlag\",MotorFlag);\nflow.set(\"SteppirDirectionFlag\",DirectionStrings[Direction] );\n\nmsg.payload = Frequency + \",\" + DirectionStrings[Direction] + \",\" + MotorFlag;//Frequency;\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":40,"wires":[["6c3ea06f.3dacb"]]},{"id":"54b0232e.5afef4","type":"function","z":"53077714.115b38","name":"SendSteppirFrequencyOrCommand","func":"//var context = this.context().flow;\n\nvar Frequency =0;\nvar FromFrequency =0;\n\nFrequency= flow.get(\"FlexTXFreq\");\n\n\n\nFrequencyBuffer= new Buffer(msg.payload); \n\nFromFrequency =  FrequencyBuffer[3] *256 *256 ;\nFromFrequency =  Frequency+ FrequencyBuffer[4] *256 ;\nFromFrequency =  Frequency+ FrequencyBuffer[5];\n\n//flow.set(\"SteppIRfromFreq\",FromFrequency);\n\n//Frequency = 1420000;\n\nFrequencyBuffer[1] = 0x41 ;\n//FrequencyBuffer[3] = 0x15 ;\n//FrequencyBuffer[4] = 0xAA;\n//FrequencyBuffer[5] = 0xE0;\n\nFrequencyBuffer[3] = (Frequency&0xFF0000) >> 16 ;\nFrequencyBuffer[4] = (Frequency&0x00FF00) >>  8 ;\nFrequencyBuffer[5] = (Frequency&0x0000FF)  ;\n\n\n// SetDirection\n\nvar DirectionCMD = flow.get(\"SteppirDirectionCMD\");\n\nvar Direction = FrequencyBuffer[7];\n\nif (DirectionCMD == \"normal\")\n    {\n        Direction = (Direction & 0b00011111);\n        FrequencyBuffer[7]=Direction;\n        flow.set(\"SteppirDirectionCMD\",\"\");\n    }\n\nif (DirectionCMD == \"180\")\n    {\n        Direction = (Direction & 0b00011111) + 0b01000000;\n        FrequencyBuffer[7]=Direction;\n        flow.set(\"SteppirDirectionCMD\",\"\");\n    }\n\n//FrequencyBuffer[8]=0x56; // Calibrate\n//FrequencyBuffer[8]=0x53; // Home\n//FrequencyBuffer[8]=0x52; // Re-enable\n\nmsg.payload = FrequencyBuffer;//.toString('utf8'); //Frequency;\nreturn msg;\n\n","outputs":1,"noerr":0,"x":390,"y":380,"wires":[["5f2307a5.0b579","8c3f99e7.0bcdb"]]},{"id":"91123923.0a3158","type":"function","z":"53077714.115b38","name":"SendSteppirR","func":"var Frequency =0;\n\nFrequencyBuffer= new Buffer(msg.payload); \n\n//Frequency =  FrequencyBuffer[3] *256 *256 ;\n//Frequency =  Frequency+ FrequencyBuffer[4] *256 ;\n//Frequency =  Frequency+ FrequencyBuffer[5];\n\nFrequencyBuffer[1] = 0x52 ;\n//FrequencyBuffer[3] = 0x15 ;\n//FrequencyBuffer[4] = 0xAA;\n//FrequencyBuffer[5] = 0xE0;\n\n\n\nmsg.payload = FrequencyBuffer;//.toString('utf8'); //Frequency;\nreturn msg;\n\n","outputs":1,"noerr":0,"x":460,"y":240,"wires":[["8c3f99e7.0bcdb"]]},{"id":"ea87abeb.0cadd","type":"mqtt out","z":"53077714.115b38","name":"SteppIRStatus","topic":"SteppIRStatus","qos":"","retain":"","broker":"26932333.efe9bc","x":1140,"y":480,"wires":[]},{"id":"5f2307a5.0b579","type":"function","z":"53077714.115b38","name":"","func":"msg.payload= parseFloat(flow.get(\"SteppIRfromFreq\")/100).toFixed(2);\n//msg.payload= flow.get(\"SteppIRfromFreq\");\n\n\n\n\nvar MotorFlag = flow.get(\"SteppIRMotorFlag\");\nvar MotorString;\n\n\n\n\nif ( MotorFlag  == \"0\" ) MotorString=\"Ready\";\n\nelse {\n\nif ( (MotorFlag & 0b00000100) == \"4\" ) MotorString=\"D \";\nelse MotorString = \"- \";\n\nif ( (MotorFlag & 0b00000001) == \"1\" ) MotorString +=\"D \";\nelse MotorString += \"- \";\n\nif ( (MotorFlag & 0b00000010) == \"2\" ) MotorString+=\"R \";\nelse MotorString += \"- \";\n\n}\n\n\nmsg.payload= msg.payload+ \",\"+ MotorString;\n\nmsg.payload= msg.payload+ \",\"+ flow.get(\"SteppirDirectionFlag\");\n\nmsg.payload= msg.payload+\",\"+MotorFlag;\n\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":480,"wires":[["e82a908c.d46b7","eed03855.f3ea68"]]},{"id":"c5cf0ee6.857348","type":"mqtt in","z":"53077714.115b38","name":"Steppir1cmd","topic":"Steppir1cmd","qos":"2","broker":"26932333.efe9bc","x":150,"y":560,"wires":[["4e41b2e1.3b9644"]]},{"id":"4e41b2e1.3b9644","type":"function","z":"53077714.115b38","name":"SteppIRParseCMD","func":"\nvar Command = msg.payload;\n\nflow.set(\"SteppirDirectionCMD\",msg.payload);\n\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":560,"wires":[["483a9fc4.53c6e8"]]},{"id":"483a9fc4.53c6e8","type":"function","z":"53077714.115b38","name":"?A GetStatus","func":"msg.payload=\"?A\\r\";\nreturn msg;","outputs":1,"noerr":0,"x":580,"y":560,"wires":[[]]},{"id":"6c3ea06f.3dacb","type":"debug","z":"53077714.115b38","name":"","active":false,"console":"false","complete":"false","x":970,"y":40,"wires":[]},{"id":"45053d2f.8fbca4","type":"mqtt in","z":"53077714.115b38","name":"","topic":"FlexStatus","qos":"2","broker":"6bb0cae1.45f064","x":150.5,"y":680,"wires":[["64c89942.4864b8"]]},{"id":"64c89942.4864b8","type":"function","z":"53077714.115b38","name":"Update FlexStatus TX Freq","func":"msg.payload=msg.payload*100;\nflow.set(\"FlexTXFreq\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":423.5,"y":677,"wires":[[]]},{"id":"e82a908c.d46b7","type":"trigger","z":"53077714.115b38","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"10","extend":false,"units":"s","reset":"","name":"","x":846.5,"y":443,"wires":[["ea87abeb.0cadd"]]},{"id":"eed03855.f3ea68","type":"rbe","z":"53077714.115b38","name":"","func":"rbe","gap":"","start":"","inout":"out","x":825.5,"y":480,"wires":[["ea87abeb.0cadd"]]},{"id":"b95263d7.181fb","type":"delay","z":"53077714.115b38","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":550,"y":120,"wires":[["e70af74c.ed1ac8"]]},{"id":"bdbb0879.4fb8a","type":"debug","z":"53077714.115b38","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":320,"wires":[]},{"id":"9b2d8c73.50643","type":"tcp in","z":"53077714.115b38","name":"","server":"server","host":"","port":"4002","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":190,"y":840,"wires":[["810f63d2.a56c48","635d08db.be3a88","8c3f99e7.0bcdb"]]},{"id":"810f63d2.a56c48","type":"tcp out","z":"53077714.115b38","host":"","port":"","beserver":"reply","base64":false,"end":false,"name":"","x":640,"y":840,"wires":[]},{"id":"635d08db.be3a88","type":"debug","z":"53077714.115b38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":460,"y":920,"wires":[]},{"id":"fa8abc56.39fd08","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\r","bin":"bin","out":"char","addchar":false},{"id":"26932333.efe9bc","type":"mqtt-broker","z":"","broker":"10.0.1.173","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"6bb0cae1.45f064","type":"mqtt-broker","z":"","broker":"10.0.1.173","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited June 2020
    This is the 'GUI' part of the code.  MQTT is required, but you can rework it without if you wish.

    [{"id":"95a653f6.d8209","type":"tab","label":"Steppir GUI","disabled":false,"info":""},{"id":"aaafb8a7.2a3388","type":"ui_text","z":"95a653f6.d8209","group":"147ec7a6.61a838","order":9,"width":"0","height":"0","name":"","label":"SteppIR","format":"{{msg.payload.SteppirFrom}}","layout":"row-spread","x":960,"y":180,"wires":[]},{"id":"6e416837.290138","type":"mqtt in","z":"95a653f6.d8209","name":"SteppIR Status","topic":"SteppIRStatus","qos":"2","datatype":"auto","broker":"201e7171.0af3ee","x":120,"y":120,"wires":[["d2baf02c.d5cab"]]},{"id":"d2baf02c.d5cab","type":"function","z":"95a653f6.d8209","name":"blank","func":"\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":120,"wires":[["3b5f2f10.0e738"]]},{"id":"3b5f2f10.0e738","type":"csv","z":"95a653f6.d8209","name":"","sep":",","hdrin":"","hdrout":"","multi":"one","ret":"\\n","temp":"SteppirFrom,MotorFlag,Direction,MotorBits","skip":0,"strings":true,"x":470,"y":120,"wires":[["aaafb8a7.2a3388","cc82124b.02f11","fb55f219.16131","572a00dc.ba494","12f193e5.96084c","f34a9e17.30316","ad916898.a699a8","4bbab659.e9c5d8"]]},{"id":"cc82124b.02f11","type":"ui_text","z":"95a653f6.d8209","group":"147ec7a6.61a838","order":2,"width":"0","height":"0","name":"","label":"Motor","format":"{{msg.payload.MotorFlag}}","layout":"row-spread","x":950,"y":220,"wires":[]},{"id":"fb55f219.16131","type":"ui_text","z":"95a653f6.d8209","group":"147ec7a6.61a838","order":3,"width":"0","height":"0","name":"","label":"Direction","format":"{{msg.payload.Direction}}","layout":"row-spread","x":960,"y":260,"wires":[]},{"id":"81f5296c.c3b0a8","type":"ui_button","z":"95a653f6.d8209","name":"","group":"147ec7a6.61a838","order":4,"width":"2","height":"1","passthru":false,"label":"Normal","tooltip":"","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"normal","payloadType":"str","topic":"Steppir1cmd","x":960,"y":420,"wires":[["5be85755.53dd78"]]},{"id":"704ae416.63b93c","type":"ui_button","z":"95a653f6.d8209","name":"","group":"147ec7a6.61a838","order":5,"width":"2","height":"1","passthru":false,"label":"180","tooltip":"","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"180","payloadType":"str","topic":"Steppir1cmd","x":950,"y":460,"wires":[["5be85755.53dd78"]]},{"id":"5be85755.53dd78","type":"mqtt out","z":"95a653f6.d8209","name":"Steppir1cmd","topic":"Steppir1cmd","qos":"2","retain":"","broker":"201e7171.0af3ee","x":1130,"y":440,"wires":[]},{"id":"b8efad26.e1279","type":"ui_button","z":"95a653f6.d8209","name":"","group":"147ec7a6.61a838","order":6,"width":"1","height":"1","passthru":false,"label":"DIR","tooltip":"","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"str","topic":"","x":950,"y":300,"wires":[[]]},{"id":"80ae60c7.d327d","type":"ui_button","z":"95a653f6.d8209","name":"","group":"147ec7a6.61a838","order":7,"width":"1","height":"1","passthru":false,"label":"DRV","tooltip":"","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"str","topic":"","x":947.5,"y":341,"wires":[[]]},{"id":"b98cc503.e09cf8","type":"ui_button","z":"95a653f6.d8209","name":"","group":"147ec7a6.61a838","order":8,"width":"1","height":"1","passthru":false,"label":"REF","tooltip":"","color":"","bgcolor":"{{msg.background}}","icon":"","payload":"","payloadType":"str","topic":"","x":947.5,"y":381,"wires":[[]]},{"id":"572a00dc.ba494","type":"function","z":"95a653f6.d8209","name":"","func":"var Bits = msg.payload.MotorBits;\n\n\nif ( (Bits & 0b00000100) == \"4\" ) msg.payload=\"red\";\nelse msg.payload=\"green\";\n\nreturn msg;","outputs":"1","noerr":0,"x":608,"y":298,"wires":[["2e42f982.9a5336"]]},{"id":"2e42f982.9a5336","type":"change","z":"95a653f6.d8209","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"background","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":768,"y":298,"wires":[["b8efad26.e1279"]]},{"id":"a8f50e8.c49aaf","type":"change","z":"95a653f6.d8209","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"background","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":768,"y":338,"wires":[["80ae60c7.d327d"]]},{"id":"ea2acf9d.e4be6","type":"change","z":"95a653f6.d8209","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"background","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":768,"y":378,"wires":[["b98cc503.e09cf8"]]},{"id":"12f193e5.96084c","type":"function","z":"95a653f6.d8209","name":"","func":"var Bits = msg.payload.MotorBits;\n\n\nif ( (Bits & 0b00000001) == \"1\" ) msg.payload=\"red\";\nelse msg.payload=\"green\";\n\nreturn msg;","outputs":"1","noerr":0,"x":608,"y":338,"wires":[["a8f50e8.c49aaf"]]},{"id":"f34a9e17.30316","type":"function","z":"95a653f6.d8209","name":"","func":"var Bits = msg.payload.MotorBits;\n\n\nif ( (Bits & 0b00000010) == \"2\" ) msg.payload=\"red\";\nelse msg.payload=\"green\";\n\nreturn msg;","outputs":"1","noerr":0,"x":608,"y":378,"wires":[["ea2acf9d.e4be6"]]},{"id":"ad916898.a699a8","type":"function","z":"95a653f6.d8209","name":"","func":"var Direction = msg.payload.Direction;\n\nif (Direction == \"Norm\")\n    \n    msg.payload=\"orange\";\n\nelse\n    msg.payload=\"#3FADB5\";\n\n//msg.payload=Direction;\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":420,"wires":[["cab12d29.0b389"]]},{"id":"cab12d29.0b389","type":"change","z":"95a653f6.d8209","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"background","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":420,"wires":[["81f5296c.c3b0a8"]]},{"id":"4bbab659.e9c5d8","type":"function","z":"95a653f6.d8209","name":"","func":"var Direction = msg.payload.Direction;\n\nif (Direction == \"180\")\n    \n    msg.payload=\"red\";\n\nelse\n    msg.payload=\"#3FADB5\";\n    // msg.payload=\"#C0DEED\";\n\n\n//msg.payload=Direction;\n\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":460,"wires":[["9e8b403f.62ac7"]]},{"id":"9e8b403f.62ac7","type":"change","z":"95a653f6.d8209","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"background","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":460,"wires":[["704ae416.63b93c"]]},{"id":"9872cff.ac3a43","type":"comment","z":"95a653f6.d8209","name":"Authored by N6NU  ***Read Me**","info":"The Steppir Flow has 2 parts.  \n\nThere is the part that communicates with the antenna\ncontroller and the GUI part that is for the Display\n\nVA3MW added a gating function that communicates with \nThe Flex radio send RX/TX status so that tuning commandsare not sent to the antenna while the radio\nis in Transmit.  You may have to remove or bypass\nthis code although I think it should work if you \nignore it.\n\nTCP Port 4002 is from PSTRotator AZ so it can be\nused to for additional functions.\n\nMQTT is used to communicate for the TX/RX status\nand to communicate to the GUI part","x":824,"y":53,"wires":[]},{"id":"147ec7a6.61a838","type":"ui_group","z":"","name":"Steppir","tab":"d6ba9a2a.f3f0d8","order":4,"disp":true,"width":"4","collapse":true},{"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":"d6ba9a2a.f3f0d8","type":"ui_tab","z":"","name":"VA3MW Shack Control","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
  • Craig Mitchell
    Craig Mitchell Member
    edited June 2020
    Thank you very much Mike, but as I'm new to flexradio I have no idea how to send an email to Andreas (Angold) N6NU, or to you. I can't find a private message option on the portal.

  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited June 2020
    You can find his email address on his QRZ page.  :)

  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Mike

    Not sure if you sent the "completed" SteppIR code.  See my screenshot with questions noted.  If it is not finished, that OK.  I was just trying to make it work without success.  I have other options if yours is "work in progress".

    Alan

    image
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited June 2020
    Hi

    My flow is heavily modified and is not the flow I am currently using.  Dave WO2X sent me the one we received from Andreas, N6NU.

    However, let me see what I can piece together.

    TCP 4002 is from a PSTRotator output.  You can ignore that injection point.


    Steppir IN is from the RS232 Port that is connected to the Steppir.  If you open it up, you'll see more about it.  The Steppir controller is 4800 8N1 for a baud rate.

    Steppir1Status is from the MQTT server and that is where we get the frequency.  That flow, attached is a work in progress.  What it does is connect to the radio on port 4992, send a command and then look for a variety of things.  

    From Flex Queries also comes from the MQTT server that the flow (attached) sends to.   I am not sure I sent that in the beginning.

    Sorry, I know this is clear as mud.  You may have to dig into it a bit.

    Mike




    [{"id":"a5a6f35f.a0a62","type":"tab","label":"FlexRadio","disabled":false,"info":""},{"id":"5332910e.2f411","type":"tcp in","z":"a5a6f35f.a0a62","name":"","server":"client","host":"192.168.110.76","port":"4992","datamode":"stream","datatype":"utf8","newline":"\\n","topic":"","base64":false,"x":203.01953125,"y":158.00390625,"wires":[["32af30a0.da29c","784db465.9bedfc","21676014.64315","4bb65a81.899f44"]]},{"id":"9f0dc4f.232cd38","type":"tcp out","z":"a5a6f35f.a0a62","host":"","port":"","beserver":"reply","base64":false,"end":false,"name":"","x":1003.01953125,"y":198.00390625,"wires":[]},{"id":"167dc49a.68cbab","type":"split","z":"a5a6f35f.a0a62","name":"","splt":" ","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":323.01953125,"y":418.00390625,"wires":[["66b580f3.0a7a4"]]},{"id":"66b580f3.0a7a4","type":"switch","z":"a5a6f35f.a0a62","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"^freq=","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":1,"x":463.01953125,"y":418.00390625,"wires":[["8d5baf1.32b805"]]},{"id":"8d5baf1.32b805","type":"function","z":"a5a6f35f.a0a62","name":"Parse FlexTXFreq","func":"\nmsg.payload= msg.payload.split('=')[1]*100000;\n\nflow.set(\"FlexTXFreq\",msg.payload);\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":420,"wires":[["b4944ad5.44dbd8"]]},{"id":"d63d2770.e41758","type":"mqtt out","z":"a5a6f35f.a0a62","name":"","topic":"FlexStatus","qos":"","retain":"","broker":"201e7171.0af3ee","x":1110,"y":500,"wires":[]},{"id":"b4944ad5.44dbd8","type":"function","z":"a5a6f35f.a0a62","name":"Devide Frequency by 100","func":"var Frequency=msg.payload/100;\n\n\n\nmsg.payload= parseFloat(Frequency).toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":420,"wires":[["d63d2770.e41758","b2a55269.8a30c","59f3c5b7.c2fbec"]]},{"id":"32af30a0.da29c","type":"trigger","z":"a5a6f35f.a0a62","op1":"C172|sub tx all","op2":"C172|sub tx all","op1type":"str","op2type":"str","duration":"60","extend":true,"units":"min","reset":"","bytopic":"all","name":"","x":490,"y":160,"wires":[["5039d92.c1ba328","5868bc45.056d54","12af30a0.75d09f","163c43e3.a5302c"]]},{"id":"b2a55269.8a30c","type":"trigger","z":"a5a6f35f.a0a62","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"10","extend":false,"units":"s","reset":"","name":"","x":730,"y":500,"wires":[["d63d2770.e41758"]]},{"id":"5039d92.c1ba328","type":"function","z":"a5a6f35f.a0a62","name":"SUB SLICE ALL","func":"// C172|sub slice all\nmsg.payload = \"C172|sub slice all\\r\"; \nreturn msg;","outputs":1,"noerr":0,"x":793.01953125,"y":178.00390625,"wires":[["9f0dc4f.232cd38"]]},{"id":"5868bc45.056d54","type":"function","z":"a5a6f35f.a0a62","name":"SUB CLIENT ALL","func":"// C172|sub slice all\nmsg.payload = \"C173|sub client all\\r\"; \nreturn msg;","outputs":1,"noerr":0,"x":803.01953125,"y":218.00390625,"wires":[["9f0dc4f.232cd38"]]},{"id":"12af30a0.75d09f","type":"function","z":"a5a6f35f.a0a62","name":"SUB TX ALL","func":"// C172|sub slice all\nmsg.payload = \"C202|sub tx all\\r\"; \nreturn msg;","outputs":1,"noerr":0,"x":783.01953125,"y":138.00390625,"wires":[["9f0dc4f.232cd38"]]},{"id":"784db465.9bedfc","type":"switch","z":"a5a6f35f.a0a62","name":"transmit","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"|transmit","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":173.01953125,"y":418.00390625,"wires":[["167dc49a.68cbab"]]},{"id":"163c43e3.a5302c","type":"function","z":"a5a6f35f.a0a62","name":"SUB RADIO ALL","func":"// C172|sub slice all\nmsg.payload = \"C73|sub radio all\\r\"; \nreturn msg;","outputs":1,"noerr":0,"x":810,"y":260,"wires":[["9f0dc4f.232cd38"]]},{"id":"2cdb975d.660f78","type":"inject","z":"a5a6f35f.a0a62","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":410.51171875,"y":58.94921875,"wires":[["12af30a0.75d09f"]]},{"id":"59f3c5b7.c2fbec","type":"ui_text","z":"a5a6f35f.a0a62","group":"147ec7a6.61a838","order":10,"width":0,"height":0,"name":"","label":"6600 Freq","format":"{{msg.payload}}","layout":"row-spread","x":1130,"y":420,"wires":[]},{"id":"21676014.64315","type":"switch","z":"a5a6f35f.a0a62","name":"rfpower","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"|transmit","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":180,"y":560,"wires":[["35cc47b5.351a98"]]},{"id":"35cc47b5.351a98","type":"split","z":"a5a6f35f.a0a62","name":"","splt":" ","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":560,"wires":[["e7e8db4.377d128"]]},{"id":"e7e8db4.377d128","type":"switch","z":"a5a6f35f.a0a62","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"^rfpower=","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":560,"wires":[["edb3c81.600ee38"]]},{"id":"edb3c81.600ee38","type":"function","z":"a5a6f35f.a0a62","name":"ParsePWR","func":"\nmsg.payload= msg.payload.split('=')[1];\n\nflow.set(\"FlexTXPWR\",msg.payload);\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":560,"wires":[["6e9b14da.a6563c"]]},{"id":"6e9b14da.a6563c","type":"ui_text","z":"a5a6f35f.a0a62","group":"147ec7a6.61a838","order":11,"width":0,"height":0,"name":"","label":"TX Power","format":"{{msg.payload}}","layout":"row-spread","x":1140,"y":560,"wires":[]},{"id":"4d6cb5be.c9a64c","type":"comment","z":"a5a6f35f.a0a62","name":"","info":" state=TRANSMITTING\n  state=READY","x":1620,"y":200,"wires":[]},{"id":"4bb65a81.899f44","type":"switch","z":"a5a6f35f.a0a62","name":"TX/RX State","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"state","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":170,"y":660,"wires":[["50ad74fe.67e61c"]]},{"id":"50ad74fe.67e61c","type":"split","z":"a5a6f35f.a0a62","name":"","splt":" ","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":310,"y":660,"wires":[["3b771b3c.5215e4"]]},{"id":"3b771b3c.5215e4","type":"switch","z":"a5a6f35f.a0a62","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"TRANSMITTING","vt":"str"},{"t":"cont","v":"READY","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":660,"wires":[["7d3c7d0d.97c674"],["ae295af8.9e4b38"]],"inputLabels":["i/p"],"outputLabels":["PTT Requested","UnKey"]},{"id":"7d3c7d0d.97c674","type":"change","z":"a5a6f35f.a0a62","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":640,"wires":[["74bc71a6.a2d9e"]],"info":"The msg.payload is set to open or closed and\nsent to MQTT so that the Steppir controller\nwill know to open or close the gate.\n\nWhen Closed, the Steppir code will not send commands\nto the controller and hopefully not cause the \nSteppir to actually move while in TX"},{"id":"ae295af8.9e4b38","type":"change","z":"a5a6f35f.a0a62","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":680,"wires":[["74bc71a6.a2d9e"]],"info":"The msg.payload is set to open or closed and\nsent to MQTT so that the Steppir controller\nwill know to open or close the gate.\n\nWhen Closed, the Steppir code will not send commands\nto the controller and hopefully not cause the \nSteppir to actually move while in TX"},{"id":"74bc71a6.a2d9e","type":"mqtt out","z":"a5a6f35f.a0a62","name":"To Steppir Control","topic":"control","qos":"","retain":"","broker":"201e7171.0af3ee","x":1010,"y":660,"wires":[],"info":"To Steppir Code"},{"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":"147ec7a6.61a838","type":"ui_group","z":"","name":"Steppir","tab":"d6ba9a2a.f3f0d8","order":4,"disp":true,"width":"4","collapse":true},{"id":"d6ba9a2a.f3f0d8","type":"ui_tab","z":"","name":"VA3MW Shack Control","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Thanks Mike.

    I understood the inputs and outputs, just could not get the SteppIR commands to work.

    I am using the Flex API flow, above, in several of my flows.  I have learned a lot about the Flex API by understanding how the flow works.

    Thanks for working up a flow to share.  I would like to add a "retract" button to my dashboard and was looking at how to use Node-Red, alone, to get this done.  If you can share your working flow, that would be great.

    Alan
    WA9WUD
  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Hi again Mike

    I am spending some more time with Stepp IR / Node-Red/PST Rotor.   I now have the flow working with the SDA-100 SteppIR controller.   I see the buttons change color when the Stepp IR moves and  Node-Red show the SteppIR frequency.  Some questions if you have time:

    Looks like there are no actual control functions originating from the Node-Red Flow.  Rather, you are using PSTRotor's TCP server to set up PSTRotor as the controller in a server (Node-Red) client (PSTRotor) relationship.    Nice.


    Question- Is this correct? 

    The Node-Red buttons do not control anything.  It looks like there may be plans to finish this capability.


    You say this is not your working flow.  Could you share your flow?

    How do you like PST Rotor for SteppIR remote access?  I know you like the server/client aspect of PST Rotor. 

     Question- Do you have a transceiver board in your SDA-100?  If so, do you use it to input frequency into the Stepp IR controller from the Flex, or do you rely on PST Rotor to do the frequency work?  I could not see how to configure PST Rotor for using "Autotrack"....what has been your experience?


    I have been using "Autotrack" along with FRStack's SteppIR controller.  Mark has an option to use Autotrack or not.  I like the PST Rotor interface more...so I am conflicted.


    What I really want to do is add a Node-Red button to "home" the elements and was hoping to see some examples of how commands are sent to the SDA-100 from Node-Red


    Alan
    WA9WUD
  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Mike

    I am making progress with the Node-Red SteppIR flow.

    I have added the command buttons to the GUI flow for "Home", "Calibrate" and "Re-Enable".

    I added code to the flow to add the necessary HEX commands to position 8 on the 9 byte ASCII message for each of the new set command buttons.

    My flow now receives all of the status information from the Stepp IR.

    However, my SteppIR SDA100 controller will not respond to commands from Node-Red.

    The serial cable from Node-Red, in and out, both look good.

    Questions:

    How do you have the SDA100 configured with regards to serial in/out connectors and configuration?

    - are you using the "data-in" DB9 from the Flex USB cables for frequency input?
    - are you using the lower DB9, data-out, for your Node-Red Serial in and out?
    - how do you have the transceiver configuration set up on the SDA100

           >Di Baud Rate
           >Dout Baud Rate
           >Transceiver Type

    Alan

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator
    edited June 2020
    Hi Alan,

    I just loaded your SteppIR flow and going to look at the code to see if anything stands out at me. I do not have a SteppIR so will need you to test any changes. We can do it via TeamViewer whenever you have time.

    73
    Dave wo2x

  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Thanks go out to Mike, Dave and the SteppIRs developer, Andreas for helping me set up a working flow.

    I now have the SteppIR flow incorporated into my Flex 6600 Dashboard.  I had to modify the flow from a multi-element yagi to a single element vertical antenna. (mainly removing the code for "180" and adding code for "3/4" and eliminating unused  element motors).

    I have a separate tuning board in the SDA100 controller that operates the "Tuning" LED and provides a direct TX inhibit to the Flex if the SteppIR is moving.

    I also have and use the SteppIR Transceiver board.  That provides frequency information to the SteppIR SDA100 controller independent of the Node-Red Flow.  If I have "Track" selected, the Antenna will track the Flex Frequency.

    In my Flex 6600 Flow, I have a "Master" button.  When I push this button, everything shuts down including grounding the HF antenna.  I added logic from the "Master" button to "Home" the SteppIR element.  When I restart the Flex, if the Stepp IR mode is in "Track", the SteppIR will automatically go to the frequency sent directly from the Flex Radio.

    Here is a screenshot of the dashboard.

    Alan
    WA9WUD
    image
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited June 2020
    Awesome... You read my mind on the Master button.  I need to code one for Lightning that does that over a 2 minute period.  Shut down the radios, then the power supplies, etc.  Nice work!
  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Mike..... ...About that lightning.....  You have discussed that in your videos and I was wondering.....is there an API Key, like one can get from Weather Underground, to do HTTP requests for, in this case, lightning, in my (your) area?

    I already shut down the station automatically on low voltage (if I lose power and my UPS battery power is discharged).  It would be useful to add "lightning" to the ways to shut down the station.

    I have seen simple flows that use Weather Underground, for trigging Node-Red, but I have not yet looked to see if the same can be done with a Lighting API Key.

    Shutting down the station has been a neat project.  Of course, you don't just "pull the plug".  Some devices are shutdown but need power, such as the Flex.  Also, I must maintain a UPS source for the LAN infrastructure, so I can remotely get it going again.  More on that if you are interested.

    Alan
  • Mike-VA3MW
    Mike-VA3MW Administrator, FlexRadio Employee, Community Manager, Super Elmer, Moderator admin
    edited June 2020
    Hi Alan

    Good question.  I don't know enough about API's.  Would this help?

    https://www.lightningmaps.org/doc/intro?lang=en

    Mike
  • Alan
    Alan Member ✭✭✭✭
    edited June 2020
    Mike

    I found a way to get a Lightning trigger.  Full description is in the Remote Operating discussion.

    Alan
  • Keith WA0BEU
    Keith WA0BEU Member ✭✭
    Thanks Mike this was great info and super video!!!
  • Thanks for the video Mike. I have a remote station down in VK. I use the Remote Rig web switches to control stuff - very stable over the last 5 years. I also use Lantronix 240V switching unit to control LAN switches, 24V power supply, 12V power supply with a battery backup via a West Mountain Radio PSG40. I use the Microtik 4G routers/firewall which are also nice and reliable but hard to setup.


    Just got a Flex 6600 to replace the K3 and K3/0 setup.


    Questions

    How to you cope if the SteppIR SDA100 box power cycles (as it doesn't turn back on)?

    Do you concert your RS232 to a LAN Port using the Lantronics and/or Moxa products? This may I can control the rotators and the Alpha 9500 etc with out having to remote in (using Splashtop Personal)


    Thanks again for the video which had given me some more ideas

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.