Search code examples
gnuradio-companion

GNURadio companion 3.10.4.0 error with "Protocol Formatter"


enter image description hereenter image description herewhile using "Protocol Formatter" in my OFDM design, I got the following error:

TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
  1. gnuradio.digital.digital_python.protocol_formatter_bb(format: gnuradio.digital.digital_python.header_format_base, len_tag_key: str = 'packet_len')
Invoked with: <gnuradio.digital.digital_python.packet_header_ofdm object at 0x000001CA1B820EF0>, 'packet_len'

and the parameters I passed to this block are as below:

Format Obj. : header_formatter.base()

Length Tag name: "Packet_len"

enter image description here

Any help/suggestion is highly appreciated !!


Solution

  • I tried to reproduce your graph, and I got the following error:

    TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    
    gnuradio.digital.digital_python.protocol_formatter_bb(format: gnuradio.digital.digital_python.header_format_base, len_tag_key: str = 'packet_len')
    

    So the two parameters for the block are of the type: header_format_base and string.

    But the message that you get is invoked with: <gnuradio.digital.digital_python.packet_header_ofdm object which is not the right type.

    If you use the following for the Format Obj (type it in or create a variable with it): digital.header_format_ofdm(occupied_carriers, 1, length_tag_key,) it should work (occupied_carriers and length_tag_key are variable in your graph) as it returns a header_format_base object

    I found this example on github, as linked from the gnuradio wiki, but you have to dig a bit in the github history, as the protocol formatter block was removed from the lasted version