Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Frequency polling


Good morning all,

I'm using Node-red to have my PW-1 amplifier follow my 6600. The first part - changing the bands on the PW-1 works FB.

However, I'm having trouble finding the command to simply poll the radio for the frequency the slice is using all by itself. Once I have that, I can issue the appropriate command to the amplifier using Node-red as a bridge. Probably a noob mistake, or I'm looking in the wrong place. Obviously people have done this, but perhaps I'm trying to make it too simple.

Best Answers

  • Alan
    Alan Member ✭✭✭✭
    Answer ✓


    You do not "poll" the Flex Radio. Rather, you subscribe to status messages, and Flex will send you the initial values when you subscribe and any changes when they occur.

    For frequency, you want to subscribe to "sub slice all". Ref: https://github.com/flexradio/smartsdr-api-docs/wiki/TCPIP-sub

    Now, set up to listen for "Slice" status messages. You can filter on the desired slice.

    Attached is a set of nodes to extract the frequency for slice A and convert the same to the band. Change the prefix to .json, from .txt.

    Alan. WA9WUD

  • KD0RC
    KD0RC Member, Super Elmer Moderator
    Answer ✓

    Hi Michael, to add on to what Alan said, you might also want to know which slice is the TX slice so that you only change the amp for the TX slice.

    Once you subscribe to the data source (slice in this case), you will receive messages that start with the handle for that connection followed by the object of the subscription (slice 0 in this case. Here is an example of what you get from the sub slice:

    S868F5F9|slice 0 in_use=1 sample_rate=24000 RF_frequency=14.329000 client_handle=0x660C952E index_letter=A rit_on=0 rit_freq=0 xit_on=0 xit_freq=0 rxant=ANT1 mode=USB wide=0 filter_lo=200 filter_hi=2400 step=100 step_list=1,10,50,100,500,1000,2000,3000 agc_mode=med agc_threshold=33 agc_off_level=10 pan=0x40000000 txant=ANT1 loopa=0 loopb=0 qsk=0 dax=1 dax_clients=1 lock=0 tx=1 active=1 audio_level=26 audio_pan=50 audio_mute=1 record=0 play=disabled record_time=0.0 anf=1 anf_level=17 nr=1 nr_level=14 nb=0 nb_level=50 wnb=1 wnb_level=34 apf=0 apf_level=0 squelch=1 squelch_level=20 diversity=0 diversity_parent=0 diversity_child=0 diversity_index=1342177293 ant_list=ANT1,ANT2,RX_A,XVTA mode_list=LSB,USB,AM,CW,DIGL,DIGU,SAM,FM,NFM,DFM,RTTY fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 rtty_mark=2125 rtty_shift=170 digl_offset=2210 digu_offset=1500 post_demod_bypass=0 rfgain=0 tx_ant_list=ANT1,ANT2,XVTA

    Here is SmartSDR changing the frequency:

    S2E87F93C|slice 0 RF_frequency=14.328900 wide=0 lock=0

    Note that you can parse RF_frequency= to get the frequency, whether it is from the sub slice response or when you change frequency from a client (like SmartSDR).

    Note also that the handle for the process that did the sub slice is different from the handle of the process that changed the frequency (SmartSDR in this case). For your purposes, you probably don't need to keep track of handles. Any time that you parse a message that has slice 0, you are safe to then parse the rest of the message for RF_frequency=.

    The TX slice can be parsed for tx=. For example, when slice 0 is set to the TX slice:

    S2E87F93C|slice 0 pan=0x40000000 mode=USB qsk=0 tx=1

    I hope this was informative and not overwhelming...

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.