analogdevicesinc / gr-iio

IIO blocks for GNU Radio
GNU General Public License v3.0
94 stars 62 forks source link

PlutoSDR not recognized as a hardware device #68

Closed duggabe closed 4 years ago

duggabe commented 4 years ago

Ubuntu 18.04 Gnu Radio 3.8 GRC 3.8.0.0 branch: upgrade-3.8 When running a flowgraph with a PlutoSDR as the output device, I get the following warning: Generating: '/home/barry/RTTY_transmit/RTTY_Pluto.py'

Warning: This flow graph may not have flow control: no audio or RF hardware blocks found. Add a Misc->Throttle block to your flow graph to avoid CPU congestion.

It does work properly without the Throttle block.

tfcollins commented 4 years ago

The throttle flag is set correctly: https://github.com/analogdevicesinc/gr-iio/blob/upgrade-3.8/grc/iio_pluto_source.block.yml#L3

Can you provide the flowgraph?

duggabe commented 4 years ago
options:
  parameters:
    author: Barry Duggan
    category: '[GRC Hier Blocks]'
    cmake_opt: ''
    comment: ''
    copyright: ''
    description: Radioteletype transmitter
    gen_cmake: 'On'
    gen_linking: dynamic
    generate_options: qt_gui
    hier_block_src_path: '.:'
    id: RTTY_Pluto
    max_nouts: '0'
    output_language: python
    placement: (0,0)
    qt_qss_theme: ''
    realtime_scheduling: ''
    run: 'True'
    run_command: '{python} -u {filename}'
    run_options: prompt
    sizing_mode: fixed
    thread_safe_setters: ''
    title: RTTY_Pluto
    window_size: ''
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [16, 12.0]
    rotation: 0
    state: enabled

blocks:
- name: baud_period
  id: variable
  parameters:
    comment: ''
    value: '0.022'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [472, 12.0]
    rotation: 0
    state: enabled
- name: center
  id: variable
  parameters:
    comment: ''
    value: '2210'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [200, 84.0]
    rotation: 0
    state: enabled
- name: fsk_deviation
  id: variable
  parameters:
    comment: ''
    value: '170'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [296, 84.0]
    rotation: 0
    state: enabled
- name: interp
  id: variable
  parameters:
    comment: ''
    value: '10'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [296, 12.0]
    rotation: 0
    state: true
- name: repeat
  id: variable
  parameters:
    comment: ''
    value: int(samp_rate*baud_period)
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [408, 84.0]
    rotation: 0
    state: true
- name: samp_rate
  id: variable
  parameters:
    comment: ''
    value: samp_rate_T/interp
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [376, 12.0]
    rotation: 0
    state: enabled
- name: samp_rate_T
  id: variable
  parameters:
    comment: ''
    value: '2000000'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [184, 12.0]
    rotation: 0
    state: true
- name: analog_const_source_x_0
  id: analog_const_source_x
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    const: '1'
    maxoutbuf: '0'
    minoutbuf: '0'
    type: float
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [598, 236]
    rotation: 0
    state: true
- name: analog_sig_source_x_0_0
  id: analog_sig_source_x
  parameters:
    affinity: ''
    alias: ''
    amp: '0.5'
    comment: ''
    freq: center+(fsk_deviation/2)
    maxoutbuf: '0'
    minoutbuf: '0'
    offset: '0'
    phase: '0'
    samp_rate: samp_rate
    type: float
    waveform: analog.GR_COS_WAVE
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [686, 484]
    rotation: 0
    state: enabled
- name: analog_sig_source_x_0_0_0
  id: analog_sig_source_x
  parameters:
    affinity: ''
    alias: ''
    amp: '0.5'
    comment: ''
    freq: center-(fsk_deviation/2)
    maxoutbuf: '0'
    minoutbuf: '0'
    offset: '0'
    phase: '0'
    samp_rate: samp_rate
    type: float
    waveform: analog.GR_COS_WAVE
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [680, 73]
    rotation: 0
    state: enabled
- name: blocks_add_xx_0
  id: blocks_add_xx
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
    num_inputs: '2'
    type: float
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [1152, 280.0]
    rotation: 0
    state: true
- name: blocks_float_to_complex_0
  id: blocks_float_to_complex
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [1264, 368.0]
    rotation: 0
    state: true
- name: blocks_multiply_xx_0
  id: blocks_multiply_xx
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
    num_inputs: '2'
    type: float
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [976, 376.0]
    rotation: 0
    state: enabled
- name: blocks_multiply_xx_1
  id: blocks_multiply_xx
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
    num_inputs: '2'
    type: float
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [978, 224]
    rotation: 0
    state: true
- name: blocks_null_sink_0
  id: blocks_null_sink
  parameters:
    affinity: ''
    alias: ''
    bus_structure_sink: '[[0,],]'
    comment: ''
    num_inputs: '1'
    type: byte
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [424, 248]
    rotation: 0
    state: true
- name: blocks_repeat_0
  id: blocks_repeat
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    interp: repeat
    maxoutbuf: '0'
    minoutbuf: '0'
    type: byte
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [401, 337]
    rotation: 0
    state: enabled
- name: blocks_repeat_1
  id: blocks_repeat
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    interp: interp
    maxoutbuf: '0'
    minoutbuf: '0'
    type: float
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [1272, 292.0]
    rotation: 0
    state: true
- name: blocks_sub_xx_0
  id: blocks_sub_xx
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
    num_inputs: '2'
    type: float
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [810, 240]
    rotation: 0
    state: true
- name: blocks_uchar_to_float_0
  id: blocks_uchar_to_float
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [584, 341]
    rotation: 0
    state: enabled
- name: blocks_vector_source_x_0
  id: blocks_vector_source_x
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
    repeat: 'True'
    tags: '[]'
    type: byte
    vector: (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
      1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1)
    vlen: '1'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [168, 220.0]
    rotation: 0
    state: true
- name: epy_block_0_0
  id: epy_block
  parameters:
    _source_code: "\"\"\"\nBaudot code vector source\n\"\"\"\n\nimport numpy as np\n\
      from gnuradio import gr\n\nimport pmt\n\nITA2 = [ 0x00, 'E', '\\n', 'A', ' ',\
      \ 'S', 'I', 'U', '\\r', 'D', 'R', 'J', 'N', 'F', 'C', 'K',\n            'T',\
      \ 'Z', 'L', 'W', 'H', 'Y', 'P', 'Q', 'O', 'B', 'G', 0x0e, 'M', 'X', 'V', 0x0f,\n\
      \            0x00, '3', '\\n', '-', ' ', 0x07, '8', '7', '\\r', '$', '4', '\\\
      '', ',', '!', ':', '(',\n            '5', '\\\"', ')', '2', '#', '6', '0', '1',\
      \ '9', 0x3f, 0x26, 0x0e, '.', '/', ';', 0x0f ]\n\ntextboxValue = \"\"\n_figs\
      \ = 0x1b\n_ltrs = 0x1f\n_shift = 0\nbit_stream = []\nCQita2 =  []\n\nclass mc_sync_block(gr.sync_block):\n\
      \    \"\"\"\n    reads input from a message port\n    generates a vector of\
      \ Baudot code bits\n    \"\"\"\n    def __init__(self):\n        gr.sync_block.__init__(self,\n\
      \            name = \"Baudot code vector source\",\n            in_sig = None,\n\
      \            out_sig = [np.byte])\n        self.message_port_register_in(pmt.intern('msg_in'))\n\
      \        self.message_port_register_out(pmt.intern('clear_input'))\n       \
      \ self.set_msg_handler(pmt.intern('msg_in'), self.handle_msg)\n\n    def handle_msg(self,\
      \ msg):\n        global textboxValue\n        textboxValue = pmt.symbol_to_string\
      \ (msg)\n        # print (textboxValue)\n    \n    def work(self, input_items,\
      \ output_items):\n        global ITA2\n        global textboxValue\n       \
      \ global _figs\n        global _ltrs\n        global _shift\n        global\
      \ bit_stream\n        global CQita2\n\n#       convert UTF-8 to ITA2 (Baudot)\n\
      \        if (len (textboxValue) > 0):\n            bit_stream = [ 1, 1, 1, 1,\
      \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n            CQita2 = []\n          \
      \  for in0 in textboxValue:\n                # get next char\n             \
      \   inChar = str (in0)\n                # convert to upper case\n          \
      \      ch = inChar.upper()\n                # test for character in ITA2\n \
      \               if (ch in ITA2):\n                    _idx = ITA2.index (ch)\n\
      #                   if (not space)\n                    if (ch != ' '):\n# \
      \                      if index > 31       // figures\n                    \
      \    if (_idx > 31):\n                            if (_shift == 0):\n      \
      \                          CQita2.append (0x1b)    # send 'figures' code\n \
      \                               _shift = 0x20\n                        else:\
      \                    # letters\n                            if (_shift > 0):\n\
      \                                CQita2.append (0x1f)     # send 'letters' code\n\
      \                                _shift = 0\n#                   store ITA2\
      \ char\n                    _idx &= 0x1F\n                    CQita2.append\
      \ (int(_idx))\n                else:\n                    CQita2.append (4)\
      \    # space\n            CQita2.append (8)    # CR\n            CQita2.append\
      \ (2)    # LF\n#            print (\"CQita2:\")\n#            print (CQita2)\n\
      \n#           serialize data LSB first\n            for _out in CQita2:\n  \
      \              outDat = _out\n                _bit_count = 0\n             \
      \   while _bit_count < 8:\n                    if (_bit_count == 0):\n     \
      \                   bit_stream.append (int(0))    # start bit\n            \
      \        elif (_bit_count > 5):\n                        bit_stream.append (int(1))\
      \    # stop bits\n                    else:\n                        bit_stream.append\
      \ (int(outDat & 1))\n                        outDat >>= 1\n                \
      \    _bit_count += 1\n#            print (\"bit_stream:\")\n#            print\
      \ (bit_stream)\n\n            # get length of string\n            _num_elem\
      \ = len(bit_stream)\n#            print (\"num elements = \", _num_elem)\n\n\
      \            # copy bit_stream to output array\n            for x in range (_num_elem):\n\
      \                output_items[0][x] = bit_stream[x]\n\n            # clear input\
      \ line\n            textboxValue = \"\"\n            self.message_port_pub(pmt.intern('clear_input'),\
      \ pmt.intern(''))\n        else:\n            _num_elem = 0\n\n        return\
      \ (_num_elem)\n"
    affinity: ''
    alias: ''
    comment: ''
    maxoutbuf: '0'
    minoutbuf: '0'
  states:
    _io_cache: ('Baudot code vector source', 'mc_sync_block', [], [('msg_in', 'message',
      1)], [('0', 'byte', 1), ('clear_input', 'message', 1)], '\n    reads input from
      a message port\n    generates a vector of Baudot code bits\n    ', [])
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [96, 341]
    rotation: 0
    state: true
- name: iio_pluto_sink_0
  id: iio_pluto_sink
  parameters:
    affinity: ''
    alias: ''
    attenuation1: '10.0'
    auto_filter: 'True'
    bandwidth: '1000000'
    buffer_size: '32768'
    comment: ''
    cyclic: 'False'
    filter: ''
    frequency: '902400000'
    samplerate: samp_rate_T
    uri: ip:192.168.3.1
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [1312, 476.0]
    rotation: 0
    state: true
- name: low_pass_filter_0
  id: low_pass_filter
  parameters:
    affinity: ''
    alias: ''
    beta: '6.76'
    comment: ''
    cutoff_freq: '200'
    decim: '1'
    gain: '1'
    interp: '1'
    maxoutbuf: '0'
    minoutbuf: '0'
    samp_rate: samp_rate
    type: fir_filter_fff
    width: '1000'
    win: firdes.WIN_HAMMING
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [768, 324.0]
    rotation: 0
    state: true
- name: qtgui_edit_box_msg_0
  id: qtgui_edit_box_msg
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    gui_hint: ''
    is_pair: 'False'
    is_static: 'False'
    key: '"text"'
    label: Input
    maxoutbuf: '0'
    minoutbuf: '0'
    type: string
    value: '""'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [120, 445]
    rotation: 180
    state: true
- name: qtgui_time_sink_x_0
  id: qtgui_time_sink_x
  parameters:
    affinity: ''
    alias: ''
    alpha1: '1.0'
    alpha10: '1.0'
    alpha2: '1.0'
    alpha3: '1.0'
    alpha4: '1.0'
    alpha5: '1.0'
    alpha6: '1.0'
    alpha7: '1.0'
    alpha8: '1.0'
    alpha9: '1.0'
    autoscale: 'False'
    axislabels: 'True'
    color1: blue
    color10: dark blue
    color2: red
    color3: green
    color4: black
    color5: cyan
    color6: magenta
    color7: yellow
    color8: dark red
    color9: dark green
    comment: ''
    ctrlpanel: 'True'
    entags: 'True'
    grid: 'False'
    gui_hint: ''
    label1: Signal 1
    label10: Signal 10
    label2: Signal 2
    label3: Signal 3
    label4: Signal 4
    label5: Signal 5
    label6: Signal 6
    label7: Signal 7
    label8: Signal 8
    label9: Signal 9
    legend: 'True'
    marker1: '-1'
    marker10: '-1'
    marker2: '-1'
    marker3: '-1'
    marker4: '-1'
    marker5: '-1'
    marker6: '-1'
    marker7: '-1'
    marker8: '-1'
    marker9: '-1'
    name: '""'
    nconnections: '2'
    size: '32768'
    srate: samp_rate
    stemplot: 'False'
    style1: '1'
    style10: '1'
    style2: '1'
    style3: '1'
    style4: '1'
    style5: '1'
    style6: '1'
    style7: '1'
    style8: '1'
    style9: '1'
    tr_chan: '0'
    tr_delay: '0'
    tr_level: '0.5'
    tr_mode: qtgui.TRIG_MODE_NORM
    tr_slope: qtgui.TRIG_SLOPE_NEG
    tr_tag: '""'
    type: float
    update_time: '0.10'
    width1: '1'
    width10: '1'
    width2: '1'
    width3: '1'
    width4: '1'
    width5: '1'
    width6: '1'
    width7: '1'
    width8: '1'
    width9: '1'
    ylabel: Amplitude
    ymax: '1.5'
    ymin: '-1'
    yunit: '""'
  states:
    bus_sink: false
    bus_source: false
    bus_structure: null
    coordinate: [932, 563]
    rotation: 0
    state: enabled

connections:
- [analog_const_source_x_0, '0', blocks_sub_xx_0, '0']
- [analog_sig_source_x_0_0, '0', blocks_multiply_xx_0, '1']
- [analog_sig_source_x_0_0_0, '0', blocks_multiply_xx_1, '0']
- [blocks_add_xx_0, '0', blocks_repeat_1, '0']
- [blocks_add_xx_0, '0', qtgui_time_sink_x_0, '1']
- [blocks_float_to_complex_0, '0', iio_pluto_sink_0, '0']
- [blocks_multiply_xx_0, '0', blocks_add_xx_0, '1']
- [blocks_multiply_xx_1, '0', blocks_add_xx_0, '0']
- [blocks_repeat_0, '0', blocks_uchar_to_float_0, '0']
- [blocks_repeat_1, '0', blocks_float_to_complex_0, '0']
- [blocks_sub_xx_0, '0', blocks_multiply_xx_1, '1']
- [blocks_uchar_to_float_0, '0', low_pass_filter_0, '0']
- [blocks_vector_source_x_0, '0', blocks_null_sink_0, '0']
- [epy_block_0_0, '0', blocks_repeat_0, '0']
- [epy_block_0_0, clear_input, qtgui_edit_box_msg_0, val]
- [low_pass_filter_0, '0', blocks_multiply_xx_0, '0']
- [low_pass_filter_0, '0', blocks_sub_xx_0, '1']
- [low_pass_filter_0, '0', qtgui_time_sink_x_0, '0']
- [qtgui_edit_box_msg_0, msg, epy_block_0_0, msg_in]

metadata:
  file_format: 1
tfcollins commented 4 years ago

Fixed here: https://github.com/analogdevicesinc/gr-iio/commit/26fa31ecf3cd6e3ffce18ca3a64972a731550c09

duggabe commented 4 years ago

I confirm that PR 69 fixed this issue.