Remote operating and Node Red

  • 1
  • Idea
  • Updated 6 days ago
I have always wanted to build a better remote station interface, but I struggle with coding anything beyond "Hello World" and usually even that has a bug or two.  

Several times, I have played with NodeRed on the PI, and I keep coming back to it.  

NodeRed is a GUI based coding platform, much like wiring, and it has great promise.  I do know 1 or 2 hams that are using it, so I am hoping they might jump in and help mentor the rest of us and share some ideas.

https://nodered.org/docs/hardware/raspberrypi

This is what it looks like controlling my simple 4 relay RPI board:



And, this is an export of the code that you can paste into a NodeRed console.  

[{"id":"6fc89136.65404","type":"rpi-gpio out","z":"2c0e83c7.f7ad2c","name":"Relay 3","pin":"31","set":true,"level":"0","freq":"","out":"out","x":380,"y":540,"wires":[]}]

Next, add MQTT to the above to send out messages to other bits, including IOT devices.

At this point, this is about as far as I have gotten, but my goal is a control panel I can read/use on a web page or an iPhone to turn things on or off.

I have seen Dashboards added, reading wattmeters and maybe even handling rotator control too.

Mike 
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes

Posted 8 months ago

  • 1
Photo of Lee

Lee, Elmer

  • 680 Posts
  • 287 Reply Likes
I've been looking at this using ESP 8266 wifi modules and the arduino environment.  Here is a node red example  

https://randomnerdtutorials.com/esp8266-and-node-red-with-mqtt/

The 8266 has multiple digital I/O and an analogue input as well plus an I2C bus and can drive an OLED display.  You can do the "relay control" from a phone or browser without MQTT but MQTT can be configured to receive as well as feed back in a publish/subscribe format with several levels of robustness to understand if the job really got done.  I would love to see I2C enabled in the radio to allow status query and thing like freq query and then set up wif AP wireless intranets around the station off the main router and maybe a rasp pi as a MQTT broker for running relays, like antenna switching or 4 square controllers or turning rotors with positive feed back of the status of the remote device.  The best dev board is the NodeMCU 12E   Here is a web based web server relay control

https://www.instructables.com/id/Control-ESP8266-Over-the-Internet-from-Anywhere/

MQTT servo controller

https://www.instructables.com/id/Simple-IoT-Remote-Switch-With-MQTT-and-ESP8266/ 

There are a million pages and youtube vids on this kind of setup 

Alternatively you could do the radio query over ethernet but more complicated 

I built a band switch capable of being run from Yaesu BCD as an experiment.  The Flex USB puts out Yaesu BCD

73  W9OY
 

Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
Thanks Lee

You are way ahead of me.

But, I did get my basic switch working and a web page built for it.  The learning curve is key, but in about an hour, I now have my basic web interface that even looks good on an iPhone.  If anyone is interested in the very very basics, I'm happy to explain further as I find getting from getting it installed to sort of working is a big jump and all the tutorials have a different focus.    Let me know and I can a video in baby step mode and how it works for us ham operators.

I even added a few hosts to ping to see if they are running.  

This is with 2 relays and I really didn't have to write a single line of code.  Relays 3 and 4 haven't been moved to display on a web page yet.

This is how I created the actual dashboard http://www.steves-internet-guide.com/node-red-dashboard/

Mike va3mw




(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
An update.

I managed to figure out the KPA500 communication and I had some help from some others for the W2 watt meter and the Rotator Controller (thanks N6NU).

The hardware is a Raspberry PI, KMTronic Web Switch, a StarTech USB to 4 Port RS232 controller, KPA500  Amp, an RC-1 RS232 Rotator Controller and a W2 wattmeter.

There is a 'little bit' of Java code for the KPA500 band detection.  I still need to do the Alarms and resets for the Wattmeter and the Amp.  The differences in the wattage are due to calibration and I need to get the Bird wattmeter out and do the calibration (right now, I don't know which one is right! LOL ).

Now I don't have multiple little applications and I can run this from a PC or a mobile device.

Mike va3mw



Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
An update on this.

I feel I have been reasonably succesful with this, especially since I'm not really a programmer and the last time I did some programming, Basic had Line numbers and my $3000 IBM PC booted off single sided floppies.  

I'm headed down the path of now being able to do things like:

  • IF Amp is turned on in Operate mode and if RF Power of Flex radio is greater than 25 watts, set drive to 25 watts on radio.
  • Or, if RF power of radio is set higher than 26 watts as example (maybe that is my maximum RF drive), send a command to move the Amp into a StandBy state
  • Or, if, in the CW portion of the band, set mode automatically to CW
  • Or, if the PA Temp on the Amp is starting to climb maybe reduce the RF drive level of the radio.
What is great with using NodeRed is the ability to make it look like 1 big RF solution.

I haven't done any of the above yet, but it can be done with limited programming skills.  Maybe over the coming days I'll get it done.

Anyone else want to play?  I know of 2 others who are working to streamline their station.

Mike va3mw 


Photo of John - K3MA

John - K3MA

  • 379 Posts
  • 127 Reply Likes
Mike

Thanks for your work and sharing.  I already have a reasonably good control interface but it can always be better.  And it fun to play with new tools.  A couple questions I have that you might be able to answer.

1) Does Node Red interface with the Digital Logger Web Switch?  https://www.amazon.com/Web-Power-Switch-Pro-Model/dp/B0765NCB2L/ref=asc_df_B0765NCB2L/?tag=hyprod-20&linkCode=df0&hvadid=228860412633&hvpos=1o1&hvnetw=g&hvrand=8963734946813561216&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1024840&hvtargid=pla-377660188761&psc=1

2) Does Node Red have capability to intercept from the Flex and send UDP info to devices like the Palstar HFAuto?

3) Is there voice control capability like Alexa control?

Thanks, John K3MA
(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1046 Posts
  • 308 Reply Likes
Hi John

If the Digital Logger Web switch can be commanded via an API or something similar, I would say yes.  You  may want to look in the NodeRed repository and see if anyone else has done it.  

Yes, it could.  I am already querying the radio for RF power and such.  This is a big advantage of the Flex  product and their API's.

No idea, as I don't do any remote connections such as that.  Again, you could ask in the NodeRed user group and I am sure someone has played with it already.

Mike va3mw
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
John

I have the DLI Web Switch Pro working fine now.

Also you can parse the radio frequency and send it out as a UDP broadcast (I haven't done it since I no longer have the HF Auto).

Dave wo2x
Photo of Joe N3HEE

Joe N3HEE

  • 459 Posts
  • 110 Reply Likes
Milke.  I am querying the radio for Mode, CW Speed, RF Power and such.  I am finding that the mode and speed messages coming from my radio never change.  They are always CW and 30 ?  Can you confirm this on your message debug.  Is this perhaps a bug in Flex messages ?  Thanks -Joe N3HEE

Also, thanks for your Node Red flows.  I imported them and learned a bunch on how to interact with the radio.  Very powerful and cool !
Photo of Steve K9ZW

Steve K9ZW, Elmer

  • 1571 Posts
  • 772 Reply Likes
@Michael - Just set up Node-Red on a Linux box to experiment with the environment.  Looks great!

Would appreciate a step-by-step guide on how you did your implementation.  Thinking this could be a very fine way to handle some of the things I want to do in an integrated fashion.

Thank you for pointing out the possibilities of Code-Red to the community and sharing you implementation!  

73

Steve
K9ZW

Blog:  http://k9zw.wordpress.com 
(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
Hi Steve

If you got it running, that is great.  

I think the next step is to build some of your own flows and see if you can get a GPIO port to turn on and off.  

Since all our HAM stuff is generally RS232 (except Flex Radios which does LAN based communication), what is it that you want to control?  Let me know and I can help you get started.  If it is RS232, there are some Palettes, you'll need to install.  

The Palettes are the plug ins to do things.  You will need the Dashboard palette.  And the Serial (RS232) one.  

See if you can get those loaded and then share with us what you want to control.

Mike
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
Hi all,

To revive the topic of Node Red, I've been out on medical leave and needed something to take my mind off my recovery. So I worked on my Node Red project.

Node Red is software I am running on a Raspberry Pi 3B plugged in my network. I've interfaced it to my Flex 6600, Elecraft KPA1500, Yaesu G1000dxa rotor with Idiom Press serial card, and my DLI Web Switch Pro network controllable outlet strip.

This gives me a simple web page to provide control and status of the various equipment. It also allows controlling equipment without the need for a PC to be on. We all know a bad Windows update can wreak havoc on a remote station depending on a PC.

The only band I need a tuner on is 80 and I set up the KPA1500 to memorize settings every 20 kHz.

My antenna switching is done via a SainSmart USB8 board connected to a W2IHY 1x4 antenna switch and antenna switching follows active TX slice on radio. So amp is set to have tuner active on 80 and only use antenna 1 out.

Here is a screenshot of Node Red as seen in a normal web browser. When using a Smartphone such as my iPhone XS each section is stacked vertically so I only need to scroll down the page to the section I want. Very handy when operating remote.

I have some more work to do and will probably add rest commands to allow shortcuts in Node Red to radio functions such as preprogrammed memories, profiles, etc.

Always fun! And thanks to Mike Walker, VA3MW and Andreas Junge, N6NU for getting me started and providing some guidance along the way.

73
Dave wo2x





Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Hi Mike

Well...you got me hooked!

I do not have a Rasberry Pi, so I loaded up Debian Linux on my Mac using Parallels which created a virtual Rasberry Pi.

Next, I loaded up Node-Red simply by running the script in Debian terminal shown on the Node-Red website.

So far using Node-Red, I connected to the Flex Server, I created a switch to control the GPIO pins on a Rasberry, loaded the Dashboard Pallet and made a simple switch on the dashboard (very ugly, not as pretty as others on this page).

I ordered a real Raspberry Pi and relay board from Amazon.

My first goal is to control eight relays for various functions in the station using a web interface.  I really do not like using Apple HomeKit and Node-Red as a more refined remote solution.

Ok, I was able to connect to the Flex 6600 Server, but could not figure out how to do anything useful.  Could you or others give me an example of how to set up Node-Red to send a Flex Command and display the result?


Alan
WA9WUD


(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1048 Posts
  • 311 Reply Likes
That is awesome!!  Nice job.  

What I liked about playing with Node-red is that it was easy to make progress and be successful.


Case in point.

I added 2 temperature probes to my RPI so that I could see and be alerted if the cooling fans in my remote case failed.  

But, first, I need to be able to read the LM75s could be imported into the Dashboard.

The LM75 uses the I2C buss and getting them working is well documented.  http://www.pibits.net/code/raspberry-pi-and-lm75-temperature-sensor-example.php

But, I needed to be able to just see the temperature.  I had to make sure I2C was working on the RPI and what 'address' they were using.  Again, Google.   There are other Temperature probes like the bmp180, bmp280, bme280 and more (https://www.adafruit.com/product/2652).  

Then, I found this code, which I could never write on my own to pull the temperature from the probe (I am going to strip this line apart so I understand it later this week).

sudo i2cget -y 1 0x48 0x00 w |awk '{printf("%0.1f C\n",(a=((("0x"substr($1,5,2)substr($1,3,1))*0.0625)+0.1) )>128?a-256:a)}'

That turned into this using the Node-red Exec box (you paste the above in the Exec).  That means you want Node-Red to Execute the command on the RPI which is a Linux operating system.  



And, then using the Dashboard tools (for others to see how it is done).  This is called a Pallet and you will need to install it https://flows.nodered.org/node/node-red-dashboard.  This is the tool that helps you to be so successful to create a web interface.

Now, I can monitor the temperature in my case, and even write some more actions to turn fans on and off.  




Here is my flow in case you want to look at it.  I added the I2C scan stuff.

[{"id":"e91d7619.a8a808","type":"tab","label":"Temps","disabled":false,"info":""},{"id":"ebd6490b.83a8d8","type":"inject","z":"e91d7619.a8a808","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":true,"onceDelay":0.1,"x":147,"y":95,"wires":[["94bd0a6b.717018","962dd4e9.d622d8"]]},{"id":"94bd0a6b.717018","type":"exec","z":"e91d7619.a8a808","command":"sudo i2cget -y 1 0x48 0x00 w |awk '{printf(\"%0.1f C\\n\",(a=(((\"0x\"substr($1,5,2)substr($1,3,1))*0.0625)+0.1) )>128?a-256:a)}'","addpay":false,"append":"","useSpawn":"false","timer":"10","oldrc":false,"name":"Temp","x":431,"y":130.5,"wires":[["3f59295f.8041e6","fb9bbee7.2754c"],[],[]]},{"id":"962dd4e9.d622d8","type":"exec","z":"e91d7619.a8a808","command":"sudo i2cget -y 1 0x4a 0x00 w |awk '{printf(\"%0.1f C\\n\",(a=(((\"0x\"substr($1,5,2)substr($1,3,1))*0.0625)+0.1) )>128?a-256:a)}'","addpay":false,"append":"","useSpawn":"false","timer":"10","oldrc":false,"name":"Temp","x":435,"y":216,"wires":[["f04cc7b4.eb6988","98197d69.8d7c3"],[],[]]},{"id":"3f59295f.8041e6","type":"ui_text","z":"e91d7619.a8a808","group":"2dbe67ac.f10de8","order":12,"width":0,"height":0,"name":"","label":"Mid Temp","format":"{{msg.payload}}","layout":"row-spread","x":784,"y":221,"wires":[]},{"id":"f04cc7b4.eb6988","type":"ui_text","z":"e91d7619.a8a808","group":"2dbe67ac.f10de8","order":11,"width":0,"height":0,"name":"","label":"Top Temp","format":"{{msg.payload}}","layout":"row-spread","x":753,"y":309,"wires":[]},{"id":"98197d69.8d7c3","type":"ui_chart","z":"e91d7619.a8a808","name":"","group":"cd1c8110.1e37e","order":1,"width":0,"height":0,"label":"Top Temp","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":778,"y":390,"wires":[[]]},{"id":"fb9bbee7.2754c","type":"ui_chart","z":"e91d7619.a8a808","name":"","group":"cd1c8110.1e37e","order":2,"width":0,"height":0,"label":"Mid Temp","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":791,"y":270,"wires":[[]]},{"id":"7de9d007.be84c","type":"i2c in","z":"e91d7619.a8a808","name":"","address":"74","command":"0","count":"1","x":432.07643127441406,"y":544.6805801391602,"wires":[["a76aec42.2ce13"]]},{"id":"c0ed8a1e.519778","type":"i2c scan","z":"e91d7619.a8a808","x":427.07643127441406,"y":443.72571563720703,"wires":[["a76aec42.2ce13"],[]]},{"id":"7222be8f.680f5","type":"inject","z":"e91d7619.a8a808","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":195.07987213134766,"y":439.9722261428833,"wires":[["c0ed8a1e.519778","7de9d007.be84c"]]},{"id":"a76aec42.2ce13","type":"debug","z":"e91d7619.a8a808","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":717.5277862548828,"y":495.94791412353516,"wires":[]},{"id":"2dbe67ac.f10de8","type":"ui_group","z":"","name":"RF Info","tab":"d6ba9a2a.f3f0d8","order":7,"disp":true,"width":"5","collapse":false},{"id":"cd1c8110.1e37e","type":"ui_group","z":"","name":"Temps","tab":"1abf24f5.9cd13b","disp":false,"width":"8","collapse":false},{"id":"d6ba9a2a.f3f0d8","type":"ui_tab","z":"","name":"VA3MW Shack Control","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"1abf24f5.9cd13b","type":"ui_tab","z":"","name":"RPi Control","icon":"dashboard","order":1}]
(Edited)
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Mike

Looks good.

Check this node out for reading temperature sensors like these;

https://www.amazon.com/gp/product/B013GB27HS/ref=ox_sc_act_title_4?smid=ADHH624DX2Q66&psc=1

and

https://www.amazon.com/DS18B20-Temperature-Waterproof-Electronic-Building/dp/B0753VSGP1/ref=as_li_ss...

On a Rasberry Pi:

https://www.youtube.com/watch?v=j7LLVkPpQ78&t=421s

Using this Node-Red Node:

https://flows.nodered.org/node/node-red-contrib-sensor-ds18b20

I found the forums and Flow Library on the Node-Red web site to contain lots of useful information and many "plugin" building blocks for flows.  You can also search for nodes; like I found the DS1820 Temperature Sensor Node.

For example, here is a flow from the Node-Red library for a configurable switch that toggles and changes color:

https://flows.nodered.org/flow/7325d06be6c8a415c877a941172dbc86

The developer incorporated the ability to configure the switch within the function node on the flow.

I looked for "ham radio" flows in the Node-Red library and found a few.  I would suggest we could start populating the Node-Red library with flows for common Flex User devices....like the KAP500 and the wattmeter flows.

The Node-Red Flow Library solves my lack of programming knowledge by allowing me to use building blocks containing code written by others.

Alan


(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1048 Posts
  • 311 Reply Likes
Hi Alan

I have used those devices on my Arduino for a weather station.  I think those require an A/D converter on the RPI and I forgot how many of those there are on  RPI3.  

I wanted the I2C ones so that I could have a whole bunch on the 'buss'.  I think with the ones I use I can more than I will ever use as there is 3 binary bits that you can solder on the board.

Lots of options too.  

We have been discussing where to host the Node-Red stuff we want to share and should it be on GIT or Node-Red Flows.  I think GIT makes more sense so that you can easily modify and share your own version.  Personally, I think I will use GIT for my stuff.

Mike
Photo of N2WQ

N2WQ

  • 30 Posts
  • 8 Reply Likes
How do you guys monitor the RX/TX state to prevent hot switching? How about some sort of conflict resolution for SO2R or when accessing from multiple clients?
Photo of Michael Walker

Michael Walker, Employee

  • 1036 Posts
  • 303 Reply Likes
Hi Rudy

I don't, but then, I am the only user and I don't hot switch.  :)  When I change bands, I stop for 10 seconds and check Antenna settings and RF power settings.  That comes from blowing a few things up at 3 in the morning.  At least any current equipment today has amazing protection built-in, and the Flex radios are no exception.  

However, since all the status of the radio is available by doing a TCP connection to the radio, you could script it then do some lockouts.

As for SO2R and multiple clients, I haven't tested that at all personally.  Others are playing with it, so you might want to ask in the main community as they might miss it in this thread.

FRStack has some of these features http://www.mkcmsoftware.com/Flex/Index.  I think that Carl N4PY's Pegasus may also have some features to help with that. http://www.n4py.com/.  And, both Authors are active on the community here and have been known to make changes to improve the user interaction.  Check out the features on both.

Both of those programs have some very slick add ons.  

I also know we have a significant number of stations that have our radios but have their own members who program.  They have done some cool stuff, but they choose not to share it since they don't want to have to support it.  With the right person, you could actually write your own GUI.


Mike
Photo of N2WQ

N2WQ

  • 30 Posts
  • 8 Reply Likes
Mike, is there a ham Node Red community? Perhaps I am over-engineering switching, but chances are others are thinking of such issues. Was thinking of using MQTT messages that go into a buffer that will take care of multi-client conflicts...but who knows, there might be easier solutions.
Photo of Michael Walker

Michael Walker, Employee

  • 1036 Posts
  • 303 Reply Likes
To the best of my knowledge, this is it but I haven't really searched.  I  posted about it once in the Facebook ham radio group that has over 20,000 members  and no one had heard about it.   

Andreas N6NUis doing the most to the best of my knowledge.  He is using MQTT to share data to muliple stations and offloading the RPI of data.  I only use MQTT to move the Rotator Data.  
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Baby Steps:

Received my Rasberry Pi from Amazon.  Set up VNC Viewer so I could work remotely.  Installed Node-Red.

Like Mike, I want to monitor the temperatures in my remote cabinet containing the Flex radio.  Bought these devices for temperature monitoring:

https://www.amazon.com/gp/product/B013GB27HS/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1

Installed this Palette from Node-Red:

https://flows.nodered.org/node/node-red-contrib-sensor-ds18b20

Note to Mike:  You mentioned earlier you thought these sensors needed an A/D converter on the pi and would limit the number one could deploy.  I learned that is not the case.  The sensor does the A/D work.  The devices are digital and each has a unique id so they can all be added to the same GPIO pin allowing a large number of devices to be deployed.

Here is a screenshot of the node showing the id numbers of the two sensors I hooked up to pin 4 of the GPIO:



I added this palette to convert the temperature units to degrees Fahrenheit:

https://flows.nodered.org/node/node-red-contrib-unit-converter

Here is the flow with the output shown in the "debug" window:



Next to set up a USB Relay Board.

I found this palette to control USB Relays using a Rasberry Pi:

https://flows.nodered.org/node/node-red-contrib-usb-hid-relay

Had to learn some basic Linux commands to add a text file to a rules folder.  The node has a pulldown menu to select the USB relay:



  Here is the Node-Red Flow:


Next, I loaded the Flex Radio, VITA49 data reader provided by Dave, WO2X.....thanks Dave!  It worked!  Received some basic data from my radio into Node-Red.  The Flex API remains a mystery for me.

That's all for now.

Alan



Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
I continue to work on flows for temperature and antenna controls.

For antenna control, I started with Rotation Control for my 2M and 70CM antennas.  There are switches mounted on each antenna allowing selection for Right-Hand or Left-Hand rotation.   Energizing the switch coil on each antenna switches the antennas from RH to LH rotation.

I am using this USB Board:

https://www.amazon.com/gp/product/B07DYNVB38/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I added this Palette to Node-Red to control the board:

https://flows.nodered.org/node/node-red-contrib-usb-hid-relay

I downloaded this flow from the Node-Red library for a toggle switch that changes state and color when pushed:

https://flows.nodered.org/flow/7325d06be6c8a415c877a941172dbc86

The first button will operate relay #1 and will “ARM” the other two polarization /rotation relays.  This will turn on/off 12 VDC to both the 2M and 70M polarization relay circuits.  I want to add a timer on the Flow to remove power from the relays if not in use for ???? amount of time.  That way I will not forget to remove power from the antenna relays when not searching for Satellites.

The second button will toggle between Right-Hand and Left-Hand Rotation for both the 2M and 70cm antennas.  The single  "Polorizaion" button operates relay #2 and #3, one USB relay for each antenna polarization switch.

Help — I want to add an interlock to not allow switching polarization if the Flex is in TX.  Can anyone help me get started with the front end part to import the Flex TX status into Node-Red?  I think N2WQ had the same kind of request..

Here is a screen shot of the flow:


Here is a screen shot of the Dashboard.  Pressing "ARM" toggles relay #1 on/off and will be in series with Relay #2 and #3 on the 12 VDC power.  Toggling the bottom button toggles relays #2 and @3 to change antenna polarization from RH to LH.  The buttons change color and text with each push/state change:


In addition, the Dashboard looks great on my iPhone.  I used the App Maker in Safari to add an icon to my iPhone home screen.

I will end here with a copy of the flow to follow.  I do not have knowledge of how or where to post flows for community use   (help).  Also, could not find how to just upload the text as a file.

Alan

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

[{"id":"8c67269f.065cd8","type":"tab","label":"USB Relay","disabled":false,"info":""},{"id":"2ce6934e.fc6844","type":"usb relay","z":"8c67269f.065cd8","name":"Arm Polorizaton","usbrelayport":"6QMBS_0","x":653,"y":547.9999847412109,"wires":[]},{"id":"f2b0ab73.90ac5","type":"function","z":"8c67269f.065cd8","name":"Push Button","func":"var state = context.get(\"STATE\")||0;\n\n//  Look for a !X message to get values.\nif (msg.payload != \"X\")     //Do this if the message is NOT \"X\"\n{\n    //\n    //  Background colours first.\n    //\n    context.set(\"ABGC\", msg.colourA);\n    context.set(\"BBGC\", msg.colourB);\n    //\n    //  Now do text.\n    //\n    context.set(\"Atxt\", msg.txtA);\n    context.set(\"Btxt\", msg.txtB);\n    //\n    //  Font colours.\n    //\n    context.set(\"AFC\",msg.txtclrA);\n    context.set(\"BFC\",msg.txtclrB);\n    //\n    //  Payloads.\n    //\n    context.set(\"PayloadA\", msg.payloadA);\n    context.set(\"PayloadB\", msg.payloadB);\n    //\n    //  Topic.\n    //\n    if (msg.topicSET !== null)\n    {\n        context.set(\"Topic\",msg.topicSET);\n    } else\n    {\n        context.set(\"Topic\",\"~\");\n    }\n    return;\n}\n//      Now on to the real stuff.\nif (msg.payload == \"X\")\n{\n    state = (state + 1)% 2;\n    //node.warn(state);\n    context.set(\"STATE\",state);\n}\nif (state === 0)\n{\n    //  Condition A\n    msg.payload = context.get(\"PayloadA\");\n    msg.colour = context.get(\"ABGC\");\n    msg.txt = context.get(\"Atxt\");\n    msg.fontclr = context.get(\"AFC\");\n} else\n{\n    //  Condition B\n    msg.payload = context.get(\"PayloadB\");\n    msg.colour = context.get(\"BBGC\");\n    msg.txt = context.get(\"Btxt\");\n    msg.fontclr = context.get(\"BFC\");\n}\nif (context.get(\"Topic\") == \"~\")\n{\n    msg.topic = \"\";\n} else\n{\n    msg.topic = context.get(\"Topic\");\n}\nreturn msg;\n","outputs":1,"noerr":0,"x":375.1358642578125,"y":236,"wires":[["66c30b92.25b98c","2ce6934e.fc6844"]]},{"id":"66c30b92.25b98c","type":"ui_button","z":"8c67269f.065cd8","name":"Polorization - Arm","group":"2f18cfd.a50b3b","order":1,"width":4,"height":2,"passthru":false,"label":"{{msg.txt}}","tooltip":"","color":"{{msg.fontclr}}","bgcolor":"{{msg.colour}}","icon":"","payload":"X","payloadType":"str","topic":"","x":163.1358642578125,"y":396,"wires":[["f2b0ab73.90ac5"]]},{"id":"e2f42dd6.93f158","type":"inject","z":"8c67269f.065cd8","name":"Setup","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"3","x":147.1358642578125,"y":155,"wires":[["74479b57.227e84"]]},{"id":"dae9a2e1.bda8d","type":"comment","z":"8c67269f.065cd8","name":"Push Button Flow","info":"This has two states:\nA and B.\nAll future refrence is to these two state names.\n\nREQUIRED:\nInputs:\nButton background colour for state A.  msg.colurA\nButton background colour for state B.  msg.colourB\nButton text for state A.               msg.txtA\nButton text for state B.               msg.txtB\nFont colour for state A.               msg.txtclrA\nFont colour for state B.               msg.txtclrB\nPayload for state A.                   msg.payloadA\nPayload for state B.                   msg.payloadB\nTopic.                                 msg.topicSET\n\nOutputs:\nmsg.payload - this is used to control what ever you need.\nmsg.topic - this is if it is needed for control of the next node.\nmsg.colour - this sets the colour of the button.\nmsg.txt - this is the text to be displayed in the button.\nmsg.fontclr - this is the colour of the text on the button.\n","x":151.1358642578125,"y":72,"wires":[]},{"id":"74479b57.227e84","type":"function","z":"8c67269f.065cd8","name":"Setup","func":"msg = {\n    \"colourA\": \"green\",\n    \"colourB\": \"red\",\n    \"txtA\": \"Arm - On\",\n    \"txtB\": \"Arm - Off\",\n    \"txtclrA\": \"black\",\n    \"txtclrB\": \"white\",\n    \"payloadA\": true,\n    \"payloadB\": false,\n    \"topicSET\": \"2M Antenna\"\n}\nreturn msg;","outputs":1,"noerr":0,"x":133.1358642578125,"y":268,"wires":[["f2b0ab73.90ac5"]]},{"id":"8886d75f.f2a1e8","type":"usb relay","z":"8c67269f.065cd8","name":"2M Polorization","usbrelayport":"6QMBS_1","x":643.8641357421875,"y":673.521728515625,"wires":[]},{"id":"efb95a37.c7a548","type":"function","z":"8c67269f.065cd8","name":"Push Button","func":"var state = context.get(\"STATE\")||0;\n\n//  Look for a !X message to get values.\nif (msg.payload != \"X\")     //Do this if the message is NOT \"X\"\n{\n    //\n    //  Background colours first.\n    //\n    context.set(\"ABGC\", msg.colourA);\n    context.set(\"BBGC\", msg.colourB);\n    //\n    //  Now do text.\n    //\n    context.set(\"Atxt\", msg.txtA);\n    context.set(\"Btxt\", msg.txtB);\n    //\n    //  Font colours.\n    //\n    context.set(\"AFC\",msg.txtclrA);\n    context.set(\"BFC\",msg.txtclrB);\n    //\n    //  Payloads.\n    //\n    context.set(\"PayloadA\", msg.payloadA);\n    context.set(\"PayloadB\", msg.payloadB);\n    //\n    //  Topic.\n    //\n    if (msg.topicSET !== null)\n    {\n        context.set(\"Topic\",msg.topicSET);\n    } else\n    {\n        context.set(\"Topic\",\"~\");\n    }\n    return;\n}\n//      Now on to the real stuff.\nif (msg.payload == \"X\")\n{\n    state = (state + 1)% 2;\n    //node.warn(state);\n    context.set(\"STATE\",state);\n}\nif (state === 0)\n{\n    //  Condition A\n    msg.payload = context.get(\"PayloadA\");\n    msg.colour = context.get(\"ABGC\");\n    msg.txt = context.get(\"Atxt\");\n    msg.fontclr = context.get(\"AFC\");\n} else\n{\n    //  Condition B\n    msg.payload = context.get(\"PayloadB\");\n    msg.colour = context.get(\"BBGC\");\n    msg.txt = context.get(\"Btxt\");\n    msg.fontclr = context.get(\"BFC\");\n}\nif (context.get(\"Topic\") == \"~\")\n{\n    msg.topic = \"\";\n} else\n{\n    msg.topic = context.get(\"Topic\");\n}\nreturn msg;\n","outputs":1,"noerr":0,"x":368,"y":675.521728515625,"wires":[["d6a3f958.db0808","8886d75f.f2a1e8","985d51a2.8d4558"]]},{"id":"d6a3f958.db0808","type":"ui_button","z":"8c67269f.065cd8","name":"Polorization - RH/LH","group":"2f18cfd.a50b3b","order":2,"width":4,"height":2,"passthru":false,"label":"{{msg.txt}}","tooltip":"","color":"{{msg.fontclr}}","bgcolor":"{{msg.colour}}","icon":"","payload":"X","payloadType":"str","topic":"","x":166,"y":835.521728515625,"wires":[["efb95a37.c7a548"]]},{"id":"4668eb4.745c994","type":"inject","z":"8c67269f.065cd8","name":"Setup","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"3","x":140,"y":594.521728515625,"wires":[["ee83b4b0.2c5ae"]]},{"id":"8966c6c4.69e42","type":"comment","z":"8c67269f.065cd8","name":"Push Button Flow","info":"This has two states:\nA and B.\nAll future refrence is to these two state names.\n\nREQUIRED:\nInputs:\nButton background colour for state A.  msg.colurA\nButton background colour for state B.  msg.colourB\nButton text for state A.               msg.txtA\nButton text for state B.               msg.txtB\nFont colour for state A.               msg.txtclrA\nFont colour for state B.               msg.txtclrB\nPayload for state A.                   msg.payloadA\nPayload for state B.                   msg.payloadB\nTopic.                                 msg.topicSET\n\nOutputs:\nmsg.payload - this is used to control what ever you need.\nmsg.topic - this is if it is needed for control of the next node.\nmsg.colour - this sets the colour of the button.\nmsg.txt - this is the text to be displayed in the button.\nmsg.fontclr - this is the colour of the text on the button.\n","x":144,"y":511.521728515625,"wires":[]},{"id":"ee83b4b0.2c5ae","type":"function","z":"8c67269f.065cd8","name":"Setup","func":"msg = {\n    \"colourA\": \"yellow\",\n    \"colourB\": \"blue\",\n    \"txtA\": \"Right\",\n    \"txtB\": \"Left\",\n    \"txtclrA\": \"black\",\n    \"txtclrB\": \"white\",\n    \"payloadA\": true,\n    \"payloadB\": false,\n    \"topicSET\": \"2M Antenna\"\n}\nreturn msg;","outputs":1,"noerr":0,"x":126,"y":707.521728515625,"wires":[["efb95a37.c7a548"]]},{"id":"985d51a2.8d4558","type":"usb relay","z":"8c67269f.065cd8","name":"70 CM Polorization","usbrelayport":"6QMBS_2","x":638.2608642578125,"y":774.6658020019531,"wires":[]},{"id":"2f18cfd.a50b3b","type":"ui_group","z":"","name":"Polorization","tab":"e2c15bb.f2346a8","order":2,"disp":true,"width":"6","collapse":false},{"id":"e2c15bb.f2346a8","type":"ui_tab","z":"","name":"Antenna","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

(Edited)
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Here is a photo of the hardware setup on the bench:

Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Update

Regarding inputting the RX status into Node-Red.

For now, solved this by using a HIT USB cable from the Flex Radio to a GPIO pin on the Rasberry Pi.  Sort of a "hardware" solution.  On the Flex side, configured the pin to be high if between 100MHZ to 500MHZ and PTT enabled.   Could have also used one of the ACC outputs as an input to a Rasberry PI GPIO pin.
Photo of Joe N3HEE

Joe N3HEE

  • 467 Posts
  • 110 Reply Likes
I have opened a ticket with Flex support to report a possible bug in the messages sent over TCP 4992.  It is always sending CW speed of 30 and mode of CW.  I am building a Node Red dashboard to display Mode, CW Speed, Frequency, etc.  -Joe N3HEE
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
Joe,

Send me your flow for the monitoring. I am guessing you built it off my FlexRadio. Flow.
I will load it and see if I can replicate the issue you have.

I have running around, er hobbling around actually til about 3 p.m. then I have plenty of time and some of my sanity back.

73
Dave wo2x
Photo of Joe N3HEE

Joe N3HEE

  • 467 Posts
  • 110 Reply Likes
Dave. Im at work right now so I cant send you my flow.  Just attach a debug node to the node that is connected to TCP 4992 on your Flex Radio tab and watch the debug window for speed and mode messages.  You will see they are always CW and 30.  Mark WS7M has also confirmed what I am seeing.
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
I will test and let you know.

Dave wo2x
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
If you are getting started, here is a simple one to play with.

This is the exact code I use for my Host monitor.  It display the Text of the ping times on one page and then the graphs of the ping times on another page.

If you haven't already, you will need to install the Dashboard via the Pallet manager.

In the screen shot of my graphs, I have 2 LM75 temperature probes that I use to keep an eye on the case the equipment is mounted in.  Yes, it was 30C at one point today as that was the air temp.




Here is the flow:

[{"id":"5654447b.7f9c7c","type":"tab","label":"Host Monitor","disabled":false,"info":""},{"id":"a523322d.dc65f","type":"ping","z":"5654447b.7f9c7c","name":"Internet","host":"8.8.8.8","timer":"20","x":150,"y":80,"wires":[["e39702ca.10652"]]},{"id":"2b6202ce.baa2ee","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":1,"width":0,"height":0,"name":"","label":"Internet","format":"{{msg.payload}}","layout":"row-spread","x":440,"y":60,"wires":[]},{"id":"e8bcd2b4.96b05","type":"ping","z":"5654447b.7f9c7c","name":"Flex 6600","host":"192.168.110.76","timer":"60","x":160.01737213134766,"y":181.01043510437012,"wires":[["d8270cab.e7c12"]]},{"id":"9bc2bc52.53a97","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":3,"width":0,"height":0,"name":"","label":"Flex 6600","format":"{{msg.payload}}","layout":"row-spread","x":440,"y":180,"wires":[]},{"id":"db65259d.670028","type":"ping","z":"5654447b.7f9c7c","name":"Flex 6500","host":"192.168.110.78","timer":"60","x":160,"y":240,"wires":[["fdc1a230.3cba7"]]},{"id":"5d3c901e.875a4","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":4,"width":0,"height":0,"name":"","label":"Flex 6500","format":"{{msg.payload}}","layout":"row-spread","x":440,"y":240,"wires":[]},{"id":"bad8987e.b97948","type":"ping","z":"5654447b.7f9c7c","name":"PC","host":"192.168.110.14","timer":"60","x":150,"y":300,"wires":[["e14c8a43.0c07b8"]]},{"id":"7ca6fcf8.7422f4","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":5,"width":0,"height":0,"name":"PC","label":"PC","format":"{{msg.payload}}","layout":"row-spread","x":430,"y":300,"wires":[]},{"id":"c055a2df.64611","type":"ping","z":"5654447b.7f9c7c","name":"Web Switch 1","host":"192.168.110.12","timer":"60","x":170,"y":360,"wires":[["db11f626.50de08"]]},{"id":"98b718ef.2e52a8","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":6,"width":0,"height":0,"name":"Web Switch 1","label":"Web Switch 1","format":"{{msg.payload}}","layout":"row-spread","x":480,"y":360,"wires":[]},{"id":"c1d8d83c.447be8","type":"ping","z":"5654447b.7f9c7c","name":"Web Switch 2","host":"192.168.110.13","timer":"60","x":170,"y":420,"wires":[["f1e53a07.86c568"]]},{"id":"a97e6083.bac93","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":7,"width":0,"height":0,"name":"Web Switch 2","label":"Web Switch 2","format":"{{msg.payload}}","layout":"row-spread","x":480,"y":420,"wires":[]},{"id":"99e37eca.e1dd1","type":"ping","z":"5654447b.7f9c7c","name":"RPI - Modem","host":"192.168.110.4","timer":"60","x":170,"y":480,"wires":[["7a2d4aa2.38fa34"]]},{"id":"7f5b8818.83b3a8","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":8,"width":0,"height":0,"name":"RPI - Modem","label":"RPI - Modem","format":"{{msg.payload}}","layout":"row-spread","x":490,"y":480,"wires":[]},{"id":"8c2b92bd.e0946","type":"ping","z":"5654447b.7f9c7c","name":"Antenna Switch","host":"192.168.110.153","timer":"60","x":180,"y":540,"wires":[["eb5ca7bd.f21808"]]},{"id":"f0d85da3.77cee","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":9,"width":0,"height":0,"name":"Antenna Switch","label":"Antenna Switch","format":"{{msg.payload}}","layout":"row-spread","x":500,"y":540,"wires":[]},{"id":"e39702ca.10652","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"1","round":"1","mult":"single","x":280,"y":80,"wires":[["65d41e6e.9ed02","2b6202ce.baa2ee"]]},{"id":"d8270cab.e7c12","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"2","round":"1","mult":"single","x":300,"y":180,"wires":[["9bc2bc52.53a97"]]},{"id":"fdc1a230.3cba7","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"2","round":"1","mult":"single","x":300,"y":240,"wires":[["5d3c901e.875a4"]]},{"id":"e14c8a43.0c07b8","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"1","round":"2","mult":"single","x":300,"y":300,"wires":[["7ca6fcf8.7422f4"]]},{"id":"db11f626.50de08","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"1","round":"2","mult":"single","x":320,"y":360,"wires":[["98b718ef.2e52a8"]]},{"id":"f1e53a07.86c568","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"2","round":"1","mult":"single","x":320,"y":420,"wires":[["a97e6083.bac93"]]},{"id":"7a2d4aa2.38fa34","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"2","round":"1","mult":"single","x":320,"y":480,"wires":[["7f5b8818.83b3a8"]]},{"id":"eb5ca7bd.f21808","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"1","round":"2","mult":"single","x":340,"y":540,"wires":[["f0d85da3.77cee"]]},{"id":"a6aa9aff.9383e8","type":"ping","z":"5654447b.7f9c7c","name":"VPN","host":"192.168.113.1","timer":"20","x":150,"y":620,"wires":[["28fff299.f60f9e"]]},{"id":"c2dadda0.6ce2d","type":"ui_text","z":"5654447b.7f9c7c","group":"e6fc9a45.855d38","order":2,"width":0,"height":0,"name":"","label":"VPN","format":"{{msg.payload}}","layout":"row-spread","x":470,"y":600,"wires":[]},{"id":"28fff299.f60f9e","type":"smooth","z":"5654447b.7f9c7c","name":"","property":"payload","action":"mean","count":"1","round":"1","mult":"single","x":320,"y":620,"wires":[["c2dadda0.6ce2d","89a97caa.6ac69"]]},{"id":"65d41e6e.9ed02","type":"ui_chart","z":"5654447b.7f9c7c","name":"","group":"e969582f.047798","order":0,"width":0,"height":0,"label":"Internet","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":440,"y":120,"wires":[[]]},{"id":"89a97caa.6ac69","type":"ui_chart","z":"5654447b.7f9c7c","name":"","group":"e969582f.047798","order":0,"width":0,"height":0,"label":"VPN","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":470,"y":660,"wires":[[]]},{"id":"e6fc9a45.855d38","type":"ui_group","z":"","name":"Hosts (ms)","tab":"1abf24f5.9cd13b","disp":true,"width":"5","collapse":false},{"id":"e969582f.047798","type":"ui_group","z":"","name":"Hosts","tab":"53920b4.5b13bf4","disp":true,"width":"6","collapse":false},{"id":"1abf24f5.9cd13b","type":"ui_tab","z":"","name":"RPi Control","icon":"dashboard","order":2},{"id":"53920b4.5b13bf4","type":"ui_tab","z":"","name":"Graphs","icon":"dashboard","order":3,"disabled":false,"hidden":false}]



Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Mike - Thanks.

I like your WAN performance graphs.  

Tried to install your flows, but my Node-Red would not allow.  Perhaps because I do not have the correct Palettes installed.

Could you give me the name of the required Palletts to run your flow?

Alan
Photo of Michael Walker

Michael Walker, Employee

  • 1048 Posts
  • 311 Reply Likes
I have a bunch installed, but the dashboard is the only one on those flows.  

Did you get an error message that might help.

This is what it looks like:

Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Well.....tried again, and this time it worked.   Maybe I did not get a full "copy".

By the way, upgraded to SDR 3.17 and all went smooth. Everything including Maestro and multiple third-party apps worked out of the box.  W10 running on Mac Parallels.  Nice!
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Thanks, Mike for encouraging me to try out Node-Red.  I am hooked.

Here is a screenshot of my LEO Satellite Tracking Screen.  I was previously using my iPhone Home Kit to control the antenna selection, pre-amps and polarity.  Now, using Node-Red, I have an on-screen antenna control panel.   Nice.

The new antenna control panel is on the right, just below Smart SDR.

The shack is in the house about 200 feet from where all of the radio and antennas are located, so remote control over the LAN is a "must" need.

Now, working on a monitor panel for the server cabinet containing all of the radios and auxiliary equipment.  The server cabinet is in a somewhat dusty environment, so I have a fan configuration to regulate air temperature while keeping a slight positive pressure inside for dust containment.  Present controls are analog and I do not plan to change.  Just want to monitor in case something fails.

The Flex API remains a mystery to me.

Will share any of my work products or point you to where got them, just ask.

Alan
WA9WUD


(Edited)
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Thanks, Dave

I am in receipt of your flows two weeks ago.  Thanks.

Please get well soon.  I too had surgery and am in the end stages of recuperation.

Back to the flows.  

I was able to get your VITA49 flow working nicely.  I see that it receives the UDP broadcasts from port 4992 of the Flex.

I have not been able to get your "flexradio" flow to work.  I see that the flow sends a request to the Flex API and looks for a response.  You then parse the response into desired parameters for Node-Red to process.  Your "flexradio" flow also uses port 4992, same as the VITA49.  Is that correct?   Node-Red is reporting an error message saying there is a port conflict??

Get well and maybe we can talk more after your recuperation.

Alan
WA9WUD
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
Hi Alan

They are sending me
Down for a nerve block. I will resend the flows as I tweaked and fixed a few things.

Make sure to edit the FlexRario flow to set the IP of the TCP send to match the IP of your radio, not PC.

There were a few tweaks. I changed VFO A Freq to TX Freq. also added some stuff to the KPA1500 flow as well as fixed the Wake On LAN feature. Added power status and power off by tons as well.

The DLI Web Switch was tweaked to increase the icon size to make it easier from a smartphone.

73
Dave wo2x
Photo of Chris DL5NAM

Chris DL5NAM

  • 680 Posts
  • 154 Reply Likes
where i cant found my missing usb relay ?  Get always "unknown Node Typ"
[that's my first steps with]
Photo of K1UO - Larry

K1UO - Larry

  • 886 Posts
  • 135 Reply Likes
Be well Mr. Dave

Larry  K1UO
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
Thanks Larry. Leave it to me to get a very rare infection in my artificial knee. Luckily I have found probably The Best doctor to deal with it. Now sitting in a hospital in Philadelphia, two hours from home..

They removed the knee joint and installed rods, plates, and cement spacers until the infection is cleared. Could be anywhere from 3 to 12 months.

Dave
(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
I have added my KMTronic flow to GitHub.

https://github.com/va3mw/node-red-KMTronic

Mike
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Mike

I tried to load your flow and only the Dashboard Node was included in the file.

Alan
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
Which flow and where did you load it from?  I have flows sort of scattered all of the place.
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Sorry

KMTronic flow on GitHub
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
ooopppps.. try it now
Photo of Stefan

Stefan

  • 3 Posts
  • 0 Reply Likes
Building my station with ESP8266 based controllers.
Link to some info, pictures and movie:

http://af6sa.com/projects/automation.html

https://photos.google.com/share/AF1QipPTfS6H3qpxggioas6Y9aGIAayQ-eyuq-YFuLbr4X0XL4mGFXooXrlWsm0b5KvP...

Currently have a antenna tuner / switch with 24 outputs and FWD/REV power meter, Amplifier controller to my home build PA and a 3x rotor controllers on Wi-Fi.
Working to integrate all the data into a single WEB page for remote control.

Stefan / AF6SA

Photo of Michael Walker

Michael Walker, Employee

  • 982 Posts
  • 281 Reply Likes
There are a number of project that use Node-Red and ESP8266 devices.  This is one example.

https://randomnerdtutorials.com/esp8266-and-node-red-with-mqtt/

Mike
Photo of Stefan

Stefan

  • 3 Posts
  • 0 Reply Likes
Thanks, They are many, and MQTT is good to turn on your lights and/or radio.
But it's to slow to read and send data in real time.
Photo of Michael Walker

Michael Walker, Employee

  • 982 Posts
  • 281 Reply Likes
Hi StefanI know of at least one contest station using MQTT. What part is too slow for you that you need sub-second response time?Can you provide some examples? Mike
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
I spent some time looking at the Flex Downloads for the API.  I did not recognize any of the file types.

On the "Description" Tab, Flex says, "SmartSDR FlexLib provides access to the SmartSDR TCP and UDP/IP APIs using .NET classes and events."

Can anyone point me to a learning source for the above?

Or....am I in the wrong category for learning how to use Node-Red with the Flex API?

Alan
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
Thanks for sharing Joe. 
I haven’t ventured into the shack yet since I got home from the hospital but plan to do so today

Dave wo2x
Photo of Joe N3HEE

Joe N3HEE

  • 464 Posts
  • 110 Reply Likes
Next steps are remote audio, tuning the radio and sending CW via Node-Red.  Then I will have a more usable web interface. 

I will publish my Node-Red code when I'm finished. 
Photo of Michael Walker

Michael Walker, Employee

  • 1048 Posts
  • 311 Reply Likes
It is awesome how these things evolve.  

I added a 24V FAN to the cabinet running on a 12V circuit.  So, next I needed a fan control to turn it on and off.   Bam.. I have a thermostat that uses one of the relays in the KMTronic.  :)  It checks the Temp as recorded by the probe on the RPI every 5 minutes.

I'm still working on smoothing it out.  I need to understand how the high and low pass filters work.  

Mike 

(Edited)
Photo of David Decoons wo2x

David Decoons wo2x, Elmer

  • 1465 Posts
  • 310 Reply Likes
I’ve been doing a lot of remote operating over the last 1 1/2 weeks. I have been using the iPad and Bose earbuds. Then bringing up Node Red GUI on my iPhone for monitoring and control of ancillary equipment. Node Red has been flawless.

If a solution for audio from radio to Android phone can be easily cobbled together then radio control and operation from an Android phone is doable. Don’t get me wrong, it is not going to be a replacement for Marcus’s excellent SmartSDR for IOS but a fun project none the less.

Just a thought.

Dave wo2x
(Edited)
Photo of Joe N3HEE

Joe N3HEE

  • 464 Posts
  • 110 Reply Likes
Sending CW and tuning the radio is pretty easy.  I need to play with the audio API commands to see if I can get audio to Node-Red.  There is a audio node for Node-Red that should work to get audio to the browser.

The guys at Beloud.US have developed a web interface for Flex on their pay for play stations.  That will be coming soon ! 
Photo of Joe N3HEE

Joe N3HEE

  • 467 Posts
  • 110 Reply Likes
Node-Red 1.0 released 9/30/19. 

https://www.youtube.com/watch?v=nIVBZQi18fQ
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
Just to share, this is what my Dashboard looks like --- today.  Tomorrow it may be different.  

I'm just looking at the 'Template' in the Dashboard so I can see what I can do there.

(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
This was on Hackables this morning.  

You can use it to incorporate weather into your Dashboard.  I have yet to try it, but I will.  I bet you could use it to auto turn your beam into the wind if needed.

https://www.instructables.com/id/Weather-Alert-Light-System/

Mike
(Edited)
Photo of Joe N3HEE

Joe N3HEE

  • 467 Posts
  • 110 Reply Likes
The sky is the limit with what you can do with this radio when it comes to software development. 
Photo of Joe N3HEE

Joe N3HEE

  • 467 Posts
  • 110 Reply Likes
I am now tuning the radio and sending CW with Node-Red.  Need to work on the text input box to send one character at a time on the fly but that seems doable. Right now I have it configured to send text after pressing the enter key. I will start working with audio this weekend.  I also plan to experiment with speech to text for CW transmision !  This will use the IBM Watson cloud service.  Should work but may have issues with latency ? 
Photo of Joe N3HEE

Joe N3HEE

  • 467 Posts
  • 110 Reply Likes
Got Speech to Morse working tonight via IBM Watson speech to text node on Node-Red !  This is really cool but will have to figure out how to send punctuation and other Morse code prosigns and abbreviations.  Good start for now.
Photo of Michael Walker

Michael Walker, Employee

  • 1052 Posts
  • 313 Reply Likes
I'm going to brag about Joe's video.  

Awesome work Joe!!!

https://www.youtube.com/watch?v=ZwYOZOm8Kio&feature=youtu.be
(Edited)
Photo of Michael Walker

Michael Walker, Employee

  • 1053 Posts
  • 313 Reply Likes
An update .. this is addictive!

Thanks to Andreas, I was able to get my Steppir added to my control console.  

The RPI running Node-Red reads the operating frequency right from the radio and then sends the required tuning commands to the Steppir.  The code is not totally done yet, but it does work.  The Steppir interface is a PITA and there is no way I would have been able to get it to work, but thanks to Andreas, he had it 98% done.

I do not have a hardware interface in line with the Steppir to prevent any tuning while transmitting, however, I was able to add a GATE, much like a hardware logic GATE to the Steppir Code.   By reading the data from the radio, it now knows the radio is in TX and it will block all commands  being sent to the Steppir.    In the screens shot below, it shows the Steppir at 1840khz.  This is the frequency being sent to the Steppir, which, or course it can't handle and it will  just ignore.  I guess I need to add a High Pass Filter so that it doesn't make it to the controller.  

I was also able to add an LED that goes red with the radio is in TX.  

This has come a long way from just controlling a few web switches.  Next, I am going to give reading the meter off the PGXL and the Radio a shot.

Mike va3mw




Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Mike

Looks nice.  I too am addicted.

I do not have a Stepir but I see two Node-Red elements you have that have has me stumped and could use your help.

You mentioned a "gate".  I have a similar situation with my satellite antenna control.  I do not want to switch any antennas if the Tx is on.  I have racked my brain to write a boolean logic, including bistables, but have not been able to get a true "gate".  Could you share your solution for the gate?

Second, getting the TX/RX status from the Flex.  I am using a Flex USB cable to operate a relay to get this status into the Rasberry.  Works OK.  Do you have a software way of getting the TX/RX status to Node-Red?

Alan
WA9WUD
Photo of Joe N3HEE

Joe N3HEE

  • 464 Posts
  • 110 Reply Likes
Alan.  I monitor the state messages to determine TX or RX status.  Then you can write a function to parse the info into something you want.  

I simply parse the message then use a change node to change READY to RECEIVING and then display on my dashboard with a text node.  

state=TRANSMITTING
state=READY
Photo of Michael Walker

Michael Walker, Employee

  • 1048 Posts
  • 311 Reply Likes
Like Joe said.   

This is what the Flow looks like and it sends the TX Status to an MQTT server (not as hard as it sounds).  This seemed to be the easier way for me to change the topic to a control topic.  



This flow is a work in progress and I use it for a lot of testing.  

Here is the code.  Give a try and see if it helps you out  I think N6NU started this and I expanded on it.  You will have to change the IP address for the radio and the MQTT server.

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":"ParseFreq","func":"\nmsg.payload= msg.payload.split('=')[1]*100000;\n\nflow.set(\"FlexTXFreq\",msg.payload);\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":650,"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":"C173|sub tx all","op2":"C173|sub tx all","op1type":"str","op2type":"str","duration":"60","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":563.01953125,"y":158.00390625,"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":"2dbe67ac.f10de8","order":9,"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":"2dbe67ac.f10de8","order":10,"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":"2dbe67ac.f10de8","type":"ui_group","z":"","name":"RF Info","tab":"d6ba9a2a.f3f0d8","order":2,"disp":true,"width":"5","collapse":false},{"id":"d6ba9a2a.f3f0d8","type":"ui_tab","z":"","name":"VA3MW Shack Control","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
Photo of Alan

Alan

  • 78 Posts
  • 10 Reply Likes
Thanks, Mike

I am able to understand everything in the flow except for how the commands to and from the Flex are formated.  Still working on that. 

I too have started using MQTT via Mosequeto on a Rasberry Pi.  It was easy to set up.

Your's and other's sharing are helping me to jump-start my understanding.  Thanks.

Alan
WA9WUD
Photo of Bob G   W1GLV

Bob G W1GLV

  • 821 Posts
  • 145 Reply Likes
BTW Node-Red works with Alexa. Go to Amazon and install Node-Red skill. Once installed you must link it to your device.
Have Fun

de W1GLV
Photo of Joe N3HEE

Joe N3HEE

  • 465 Posts
  • 110 Reply Likes
I've had no luck getting Alexa to work with Node Red.  Has anyone been successful ?