How to make extension to KiwiSDR

Hello.

Is there step-by-step tutorial available how to make extension to KiwiSDR ?

I have been trying to make simple antenna switch extension which contains three buttons. If I click button, a script that send snmp command to my relay switch should be executed.  I tried to copy & modify ~/Beagle_SDR_GPS/extensions/example ->  ~/Beagle_SDR_GPS/extensions/ant_switch and ~/Beagle_SDR_GPS/web/extensions/example -> ~/Beagle_SDR_GPS/web/extensions/ant_switch. Then rename files, modify code and recompile (cd ~/Beagle_SDR_GPS; make ; make install; reboot). Compile and install gives no errors. My extension never appears in extensions dropdown list. There is just S_Meter, integrate, iq_display, loran_c and wspr. I am stuck.

Comments

  • I am working on a webpage that is a tutorial and reference for writing extensions. But it keeps getting pushed down on the priority queue by other problems. But I think things are slowly getting better.

    After you run 'make' is ant_switch listed in Beagle_SDR_GPS/extensions/ext_init.c ? This file is auto generated by the Makefile based on what it finds in the extensions/ directory. That's how your ant_switch_main() routine would get called. In ant_switch_main() is the call to ext_register(&ant_switch_ext) uncommented so ext_register() will be called? If you run the server from the command line is ant_switch listed in the extensions registered list? i.e. like the following:

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #0 "S_meter"

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #1 "example"

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #2 "integrate"

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #3 "iq_display"

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #4 "loran_c"

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #5 "s4285" (note: not released yet)

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #6 "test"  (note: not released yet)

    Tue Nov 22 22:02:27 2016 0:00:02 ....      ext_register: #7 "wspr"


    If that all looks okay you may have to put some printf()s in the C code, and/or console.log()s in the Javascript, to see what's going on.

  • >After you run 'make'
    is ant_switch listed in Beagle_SDR_GPS/extensions/ext_init.c ?

    Yes.

    >If you run the server from the command line is ant_switch listed in the extensions registered list?

    No.

    > In ant_switch_main() is the call to ext_register(&ant_switch_ext) uncommented so ext_register() will be called?

    It was commented out. Fixed now.

    I found that I have to modify ext.h and add my extension there too before got working.

    // extensions to compile
    #if 1
      #define EXT_ANT_SWITCH
    #endif


    Now my extension is visible on dropdown list.

    Solved. Thank you again!
  • Okay. I will fix these things so that starting from the example code will lead to a working extension (i.e. I'll keep the example itself out of the extension list another way besides commenting out the call to ext_register).

    You could remove the "#ifdef EXT_ANT_SWITCH" from your code. Those were only in there so I could selectively enable extension compilation during development.

Sign In or Register to comment.