Remote operating and Node Red

  • 1
  • Idea
  • Updated 3 weeks 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, Official Rep

  • 829 Posts
  • 235 Reply Likes

Posted 5 months ago

  • 1
Photo of Lee

Lee, Elmer

  • 680 Posts
  • 286 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, Official Rep

  • 829 Posts
  • 235 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, Official Rep

  • 829 Posts
  • 235 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, Official Rep

  • 829 Posts
  • 235 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

  • 347 Posts
  • 111 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, Official Rep

  • 829 Posts
  • 235 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 Steve K9ZW

Steve K9ZW, Elmer

  • 1466 Posts
  • 739 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, Official Rep

  • 829 Posts
  • 235 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