• Tag Archives cat
  • Remote control of SDRuno with MQTT and Node-RED

    This page is out of date.
    Please go to my GitHub site: https://thebaldgeek.github.io/

    Getting back to looking at HF ACARS messages again and so with that comes the need to tune to the best HF frequency. (Best is still based on propagation and is a topic for another blog).
    My HF station is in Arizona, and San Francisco is the best ground station for it to hear. New York is a close second.
    SF mostly runs on two frequencies, 6559KHz and 13276KHz with 5508KHz thrown in from time to time. NY is sort of the same but different.
    So, the question (or goal) is to be able to switch between those frequencies on some sort of time schedule. (Sort of based on day and night – ie, follow the HF propagation).

    For the longest time I got fixated on getting SDRuno to do the memory channel switching for me. Spent waaaaay to long looking for plug-ins that would do the job.
    Thought about trying to set up squelch-less scanning to do the job.
    Spent some time looking to get the RSP2 working under SDR# since it seemed to have more plug-ins and options.
    Turns out this was the wrong way of looking at the problem…. All very well to get the program to do the automatic switching – which it can’t do – but what if I want some other frequency at some other time?
    Better to have web site (Node-RED dashboard) control right?
    I mean the decoded data (the ACARS message) is displayed there anyway, so putting a button there just makes sense.
    We spent hours trying to figure out how to make it work, and minutes getting it working once we turned the problem around.

    So, long intro long.
    The key is to remove control from SDRuno and put it in the hands of the website / user / Node-RED.
    Press a button on the dashboard in one location and have it change the VFO frequency in another. Here is how we do that do.

    SDRuno can use a serial protocol called CAT. The software emulates a small subset of those CAT commands for a Kenwood TS-480 transceiver.
    What we need to do is setup a serial connection to SDRuno to send those CAT commands as needed.
    Start with a virtual serial cable. I downloaded and used http://com0com.sourceforge.net/ Simple and free. Hard to beat.
    Set up something like com3 and com4 in that program.
    Go into SDRuno and set up com3 as the CAT serial port. I just accepted the default baud, it does not really matter as even 300 baud will be overkill for changing a few frequencies. It should connect straight away.
    Now, in Node-RED running on the same computer as SDRuno add a serial node that is configured to com4.
    To prove it works, put down 2 debug nodes if you like and use them to change the frequencies back and forth.
    In short, what ever CAT commands you pump into com4 via Node-RED will come out of com3 and thus into SDRuno and the VFO will change frequency.

    Now with that working, add an MQTT node configured to your broker and connect it to your serial node.
    So now, when ever a payload is published to that topic it will be sent to com4.
    On the instance of Node-RED that is running the dashboard then, you add a button that publishes its value to the broker on that topic.
    Done.
    You now have control of the SDRuno VFO A frequency from your web page.