Custom extension creation possible?
Hello to all!
I got the KiwiSDR a few weeks ago after waiting over a year for them to become available again and I have been having a blast with it! Absolutely worth the wait and I couldn't be happier with how well it works!
As I've been getting more acquainted with the KiwiSDR from an admin perspective, I've been looking at the different extensions that are provided, many of which I use actively like the FT8/FT4. I'm wondering if it's possible to create custom extensions for the KiwiSDR that could be used locally on my own KiwiSDR or potentially shared with others? I'm not sure how extensions work here on the KiwiSDR and in a brief search through the forum I didn't see any discussion of this topic, so I figured I'd ask and see if anyone had any thoughts on this.
Thanks and 73!
Justin/W1IX
Comments
Oh it's possible. Kari OH1KK did it with the original antenna switch extension (before the recent integration of that code into the Kiwi server). But there is no documentation. So your best bet is to figure it out yourself by looking at the existing extensions as examples. E.g. the extensions/ (C code) and web/extensions (JS code) directories.
It's a little complex because there are some issues to consider. Depending on what you want to do you either have to do it on the C-side on the Beagle or you can do it on the JS-side on the browser (for example if you're only working with the audio stream). Almost always it's a combination of both. And if you do anything on the C-side you have to make sure you don't break the realtime response (i.e. cause audio drops) by running too long without calling the task preemption code (e.g. running a huge, uninterruptible FFT).
If you just want to do custom HTML stuff (e.g. showing solar conditions, DX spots, etc) there is the "iframe" extension that Kari also wrote. Also, you can embed HTML in the configuration setting on the admin webpage tab.
If you're adding stuff in the extensions/ directory beware that it will be overwritten by the next update. So be sure to keep a copy of your work and/or disable automatic updates. The correct way to deal with this is to make your extension an external extension, i.e. stored outside the Kiwi source tree. The original antenna switch extension (before integration) was done this way. Have a look at it to see how it's done (see the original antenna switch on OH1KK's Github).