Our current SDR online list: https://sdr-list.xyz/

New attempt for CATSynch on PhantomSDR+

Started by hb3xdc, Mar 17, 2025, 12:00 PM

Previous topic - Next topic

hb3xdc

I'm making another attempt on the topic of CATsync, which, from my perspective, is one of the most important features still missing in our PhantomSDR. In today's world, where local QRM is becoming more common, this feature is being used more and more frequently.

Some time ago, my colleague Wolfgang HB9RYZ received the following information from the developer of the CATsync application:

Unfortunately, my JavaScript knowledge is not sufficient to adapt this to our community PhantomSDR version. Therefore, I'd like to ask if someone could take a look at it.


-----------------------------
Hello Wolfgang

For the KiwiSDRs, the author has implemented corresponding API extensions since around 2018.

Quote: "I have started a set of API calls to be used by people writing Kiwi extensions. The calls are named "ext_*()" and are contained in ./web/extensions/ext.js
There is a routine called ext_set_mode(mode_string), which is what you need to call."

There is a facility like this to notify the extensions of changes in frequency/mode/passband/zoom/resize.

In today's update (v1.229), I will add a call to a routine that you can optionally inject to receive these notifications:
var iec_seq = 0;
function injection_environment_changed(changed)
{
   console.log('injection_environment_changed ' + iec_seq + ': ' +
      (changed.freq ? 'FREQ ' : '') +
      (changed.passband ? 'PASSBAND ' : '') +
      (changed.mode ? 'MODE ' : '') +
      (changed.zoom ? 'ZOOM ' : '') +
      (changed.resize ? 'RESIZE ' : '')
   );
   iec_seq++;
   //kiwi_trace();
}
So, you would just have to define the routine injection_environment_changed(), which is called with an object containing elements named freq/mode/passband/zoom/resize. These are either set to "1" or undefined, depending on the changes occurring. You would have to call the ext_*() routines to find out the new values, for example, the updated frequency.

CATsync is informed about changes through these "notifications," and I can then easily read the new frequency (QRG) or the new mode via an internal variable on the WebSDR.

Setting mode and frequency (i.e., the reverse direction) is done directly through two JavaScript functions—one for setting a frequency and one for setting a mode.

I hope this roughly illustrates how the Kiwi author implemented it so that CATsync and other external programs can read or control it via JavaScript injection.

If you want to better understand how Kiwi handles this, you can open a developer console in your browser with F12, run the above code on a running Kiwi WebSDR, and then see what status updates the console outputs when the frequency or mode changes.

In CATsync, I only use QRG and Mode—so it's all very simple.

73 de Oscar DJ0MY
Gianni - HB3XDC
WebSDR Lucerne
Sardinia SDR

Phil - NY4Q

Unfortunately this weekend, my rig was whacked by lightning and now the USB port is not working. As soon as I either replace the rig or repair the USB interface, I will look into this.

Powered by EzPortal