discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(gnuradio3.8) module 'gnuradio.blocks' has no attribute 'message_sink'


From: Ting Wu
Subject: (gnuradio3.8) module 'gnuradio.blocks' has no attribute 'message_sink'
Date: Thu, 7 Jan 2021 12:46:37 +0900
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

Hi!

I recently upgraded to gnuradio 3.8 and my old code threw the following error:

module 'gnuradio.blocks' has no attribute 'message_sink'

Is the 'message_sink' has been deprecated in the recent version of gnuradio? If so, what should I use now for the message source and sink? I really do not want to rewrite all the codes, so I would be really grateful if there is a simple way to make the following code work with the recent version of gnuradio. The code simply gets data stream from a USRP N200 (LFRX daughterboard).

=================================================
 class my_block(gr.top_block):
    def __init__(self):
        gr.top_block.__init__(self)
        self.source = uhd.usrp_source(device_addr="", stream_args=uhd.stream_args('sc16', 'sc16', args="scalar=1024"))

        self.source.set_samp_rate(samp_rate)
        self.source.set_gain(gain)
        self.source.set_center_freq(0)

        self.queue = gr.msg_queue()
        self.sink = blocks.message_sink(gr.sizeof_short*2, self.queue, False)  #This line throws the error
        self.connect(self.source, self.sink)
===================================================

Thanks in advance!

Ting Wu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]