Possible to pass arguments to an extension using kiwirecorder?

Is there any (undocumented ?) way to pass arguements to kiwi extensions using kiwrecorder?

Glenn n6gn

Comments

  • You can't even start a Kiwi extension from kiwirecorder. Kiwi extensions only work from the browser-based interface, e.g. extensions most often contain a javascript component that needs to run on the browser. With kiwirecorder there is no place for the javascript to run. Kiwirecorder only gets the audio and waterfall data. None of the HTML and javascript.

    The only other scenario I could imagine was an existing connection from a browser, running an extension, having its extension parameters modified by a subsequent, unrelated kiwirecorder connection. Is that what you meant? There is no provision for this. It would be a huge security problem if there were.
  • Thanks John, too bad but I now understand the issue. I was looking for a light weight method to control lines coming out of the Kiwi. Since I already have these brought out, decoded and used for the antenna switch, I was hoping that there would be a way to quickly select a different "antenna". In this present case, I was wanting to measure the noise at the input of a resistive termination followed rapidly by measurement of the noise from a reference antenna pointed straight up. This effectively creates a "poor man's Dicke receiver" and if done at upper HF with an LNA should allow measurement of galactic noise even when it is significantly below the system noise floor. I believe that the increase as the center of our galaxy passes overhead will/should be quite measurable. I have an LNA/kiwi reporting -171 dBm/1-Hz noise and typical (matched) antenna noise of about 20 dB bigger than this so wanted to control an input PIN switch.

    I think this is essentially how the 3 degree cosmic background gets measured since antenna temperatures, even at microwave, aren't usually that low. Rapid switching is an advantage since it minimizes the effect of any systemic gain drift errors that might be present. This is why I was looking for a way to do it more easily/quickly than the full-on heavy-weight browser approach, but now that I understand the problem I'll proceed along that avenue.

    The only other way I can think of to do it is to write an extension designed to do the whole thing which may not be worth the return, though perhaps if I started with the ant_switch extension and modified it, it would easier.

    Thanks for letting me know.

    Glenn n6gn
  • You're just using Beagle GPIOs for your antenna switching, right? If so you can just send shell commands to Linux on the Beagle to control the GPIOs. This is what some of the "backends" of the existing antenna switch extension do. You don't need to involve anything Kiwi related at all.
  • Have a look at https://github.com/OH1KK/KiwiSDR-antenna-switch-extension/blob/master/backends/ant-switch-backend-beagle-gpio
    Shell scripts are not the easiest thing to understand. But basically what you want to do is the "echo V > /sys/class/gpio/gpioNN/value" where V is 0 or 1 and NN is one of the SAFEGPIOS values. On Linux use the rsh command to send it to the Kiwi. I don't know what you have to do on Windows.
  • Thank you again, John. That seems to work well, I can toggle it remotely a couple of times/second now. I'm sorting out correct values and pins but it's already able to solve the problem, even in parallel with the antenna switch running normally. I'll let you know if my kiwi can hear the center of our galaxy.
  • edited July 2019
    While " /sys/class/gpio/gpioNN/value" did allow toggling the lines, it seems that it is toggling more than one. I haven't studied the class to understand it and there may be a way around this, however, Gwyn G3ZIL, kindly pointed me to another way that seems to do exactly what I want even more directly. It is:

    rsh root@[kiwi IP address] "/root/extensions/ant_switch/frontend/ant-switch-frontend N;" 2>/dev/null

    where N is the Antenna N selection desired and 2>/dev/null throws away the return text from the BB resulting from the remote shell call. I expect using this method requires compiling the ant_switch extension into the Kiwi but that is well documented and only takes a few minutes.

    This seems to work precisely as hoped and allows setting the GPIO lines of the ant_extension one-at-a-time. I measured 600 ms/setting across my local network.

    If someone simply wants a few control lines to use to programatically control an external device on a kiwi - whether an antenna switch or something else - this seems to be a quick, easy and effective way to do it remotely.

    I've only tested from a remote computer running Ubuntu Linux but perhaps someone more familiar with Windows can provide an equivalent method for that OS.

    See https://github.com/OH1KK/KiwiSDR-antenna-switch-extension/blob/master/docs/antenna-schedules-using-crontab.txt
    for automating this with crontab from the kiwi itself.
    Powernumpty
Sign In or Register to comment.