Saturday, July 21, 2018

Re: [Discuss-gnuradio] Help needed with message ports

Hi Michael,

thank you for your reply. Yes your clarification is correct.

The block I'm trying is of type hier2_block. Meanwhile I found an older post

https://lists.gnu.org/archive/html/discuss-gnuradio/2015-10/msg00008.html

describing the same problem. But the gnuradio code has been modified
since then, but it seems that the proposal in this post has been
incorporated.


I tested with the current git/master and git/next. The problems are the
same.

I think it depends on the hier2 block, as I can setup a simple flowgraph
with a signal source ( this is of type sync block ) that works.

Now I'm trying to understand the code of
hier_block2_detail::msg_connect. But at the moment this is hard stuff
for me.
I'll report if I get a solution.

-- Volker


Am 21.07.2018 um 16:23 schrieb Michael Dickens:
> Hi Volker - Just to clarify:
>
> You've added an -optional- input async message port to a block that currently does just streaming. If you -do not- try to connect to this new port, then everything works as desired & as before. If you -do- try to connect to the port then you get the runtime error "insufficient connected output ports (1 needed, 0 connected)". Yes?
>
> "Once upon a time" ... there was, and as it turns out still is (just tried using the current GIT master of GR), a bug in the code that handles connections for mixed streams and -input- async messages, which results in the runtime error you're encountering. I can provide a very simplified OOT that shows this error; I tried to track it down once but got sidetracked & never figured it out. Maybe I'll give it a go again this coming week ... or, maybe you can?
>
> Sorry for the bad news! - MLD
>
> On Fri, Jul 20, 2018, at 6:28 AM, Volker Schroer wrote:
>> Hi,
>>
>> I'm trying to add an message port to my  working oot module fcdproplus
>> to be able to control the frequency by an message from a qtgui sink.
>>
>> I used the analog signal source as guide and implemented a message sink
>> in the grc description, registered the in port, and defined  a handler
>> function like described in the tutorial.
>>
>> I can run my example of a simple fm receiver as before, but when I
>> connect the message out port of a qtgui sink to my message in port of my
>> oot block,
>>
>> I get the following error message:
>>
>>
>> ./FMRadio.py
>> INFO: Audio source arch: alsa
>> Funcube Dongle Pro+ found as: plughw:3,0
>> Dongle sucessfully initialized
>> Result of Action :+++++
>> FCDAPP 20.03
>>  Lna gain enabled
>>  Mixer gain enabled
>> If gain set to: 10
>> Set Frequency to: 94.3 KHz, corrected to: 94300 Khz
>> INFO: Audio sink arch: alsa
>> Traceback (most recent call last):
>>   File "./FMRadio.py", line 277, in <module>
>>     main()
>>   File "./FMRadio.py", line 266, in main
>>     tb.start()
>>   File
>> "/usr/local/gnuradio/lib64/python2.7/site-packages/gnuradio/gr/
>> top_block.py",
>> line 109, in start
>>     top_block_start_unlocked(self._impl, max_noutput_items)
>>   File
>> "/usr/local/gnuradio/lib64/python2.7/site-packages/gnuradio/gr/
>> runtime_swig.py",
>> line 5678, in top_block_start_unlocked
>>     return _runtime_swig.top_block_start_unlocked(r, max_noutput_items)
>> RuntimeError: fcdproplus(3): insufficient connected output ports (1
>> needed, 0 connected)
>>
>> These are the connections:
>>
>>
>>        ##################################################
>>         # Connections
>>         ##################################################
>>         self.msg_connect((self.qtgui_sink_x_0, 'freq'),
>> (self.fcdproplus_fcdproplus_0, 'freq'))
>>         self.connect((self.analog_fm_demod_cf_0, 0),
>> (self.audio_sink_0, 0))
>>         self.connect((self.analog_fm_demod_cf_0, 0),
>> (self.audio_sink_0, 1))
>>         self.connect((self.fcdproplus_fcdproplus_0, 0),
>> (self.low_pass_filter_0, 0))
>>         self.connect((self.fcdproplus_fcdproplus_0, 0),
>> (self.qtgui_sink_x_0, 0))
>>         self.connect((self.low_pass_filter_0, 0),
>> (self.analog_fm_demod_cf_0, 0))
>>
>> If I remove the line
>>
>> self.msg_connect((self.qtgui_sink_x_0, 'freq'),
>> (self.fcdproplus_fcdproplus_0, 'freq'))
>>
>>
>> from my python script he error message disappears.
>>
>> What am I doing wrong?
>>
>>
>> Any help is appreciated.
>>
>> -- Volker
>>
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment