gnuradiomessage-passinggnuradio-companionuhd

What commands can be sent on the message port of UHD USRP Sink block?


I have been experimenting with message passing in the Signal Source block in GNU Radio companion. I can see from its source code that we can pass messages to change the frequency, amplitude, offset and phase of the source. For example, the following message PMT sent from a message strobe can change the amplitude of the signal to 0.5.

 pmt.dict_add(pmt.make_dict(), pmt.intern("ampl"), pmt.from_double(0.5))

But when I viewed the code of UHD USRP Sink, I couldn't get a clear idea as to what commands can be sent to this block or that which parameters can be changed. I have read at some places in the documentation that frequency, gain, LO offset, timestamp, center frequency and other transceiver related settings of the USRP Sink can be manipulated through command messages.

What commands can be sent to the USRP Sink block from a message strobe (in the pmt format) and which parameters (and their keys) can be modified?


Solution

  • This is officially documented:

    https://www.gnuradio.org/doc/doxygen/page_uhd.html#uhd_command_syntax

    Command name Value Type Description
    chan int Specifies a channel. If this is not given, either all channels are chosen, or channel 0, depending on the action. A value of -1 forces 'all channels', where possible.
    gain double Sets the Tx or Rx gain (in dB). Defaults to all channels.
    power_dbm double Sets the Tx or Rx power reference level (in dBm). Defaults to all channels. Works for certain devices only, and only if calibration data is available.
    freq double Sets the Tx or Rx frequency. Defaults to all channels. If specified without lo_offset, it will set the LO offset to zero.
    lo_offset double Sets an LO offset. Defaults to all channels. Note this does not affect the effective center frequency.
    tune tune_request Like freq, but sets a full tune request (i.e. center frequency and DSP offset). Defaults to all channels.
    mtune tune_request_t Like tune, but supports a full manual tune request as uhd::tune_request_t. Defaults to all channels.
    lo_freq double For fully manual tuning: Set the LO frequency (RF frequency). Conflicts with freq, lo_offset, and tune.
    dsp_freq double For fully manual tuning: Set the DSP frequency (CORDIC frequency). Conflicts with freq, lo_offset, and tune.
    direction string Used for timed transceiver tuning to ensure tuning order is maintained. Values other than 'TX' or 'RX' will be ignored.
    rate double See usrp_block::set_samp_rate(). Always affects all channels.
    bandwidth double See usrp_block::set_bandwidth(). Defaults to all channels.
    time timestamp Sets a command time. See usrp_block::set_command_time(). A value of PMT_NIL will clear the command time.
    mboard int Specify mboard index, where applicable.
    antenna string See usrp_block::set_antenna(). Defaults to all channels.
    gpio gpio PMT dictionary including bank, attr, value, mask for GPIO. See notes.