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

2018-08-27 Thread Michael Dickens
Hi Volker - You're welcome & so glad that we got the issue figured out! Which 
reminds me that I never put together a PR for the changes that would give 
programmers a clue that a hier2 block isn't meant to do actual "work". I'll add 
that to my queue & try to get it in before GRCon ... Cheers! - MLD

On Mon, Aug 27, 2018, at 8:50 AM, Volker Schroer wrote:
> Just to report the solution, as it me be usefull for others.
> 
> My block was an hier2 block. Hier2 blocks can't handle messages 
> directly, they only can serve as a proxy.
> 
> So I added a gr::block with no inputs and outputs ( yes, this is 
> possible, I did not know before ) that could handle the message.
> 
>  From my hier2 block I routed the message to my new block and everything 
> works fine.
> 
> The details can be seen on github
> 
> https://github.com/dl1ksv/gr-fcdproplus/tree/gnuradio3.8
> 
> Many thanks to MLD, who pointed me into the right direction.
> 
> -- Volker

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


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

2018-08-27 Thread Volker Schroer

Just to report the solution, as it me be usefull for others.

My block was an hier2 block. Hier2 blocks can't handle messages 
directly, they only can serve as a proxy.


So I added a gr::block with no inputs and outputs ( yes, this is 
possible, I did not know before ) that could handle the message.


From my hier2 block I routed the message to my new block and everything 
works fine.


The details can be seen on github

https://github.com/dl1ksv/gr-fcdproplus/tree/gnuradio3.8

Many thanks to MLD, who pointed me into the right direction.

-- Volker



Am 20.07.2018 um 12:28 schrieb Volker Schroer:

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 
     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