Re: Problems when passing messages to a source block

2021-12-09 Thread Michelle
Good morning Jeff, yes "/data/" was a double, but I already understood the problem (there was a discussion about that).  The source signal block expects the messages to be in dictionary format not pairs. Finally it works, thank you for your help :) Here is the final code: from gnuradio impo

Re: Problems when passing messages to a source block

2021-12-06 Thread Jeff Long
Is "data" a double? Thread() passes "args" to self.run() ... On Mon, Dec 6, 2021 at 6:32 PM Michelle wrote: > Hi Jeff, > > Thank you very much, all this time I didn't realize. > > Now I have the following error:*Warning: failed to XInitThreads()* > *thread[thread-per-block[0]: ]: pmt_car: wrong_

Re: Problems when passing messages to a source block

2021-12-06 Thread Michelle
Hi Jeff, Thank you very much, all this time I didn't realize. Now I have the following error:/Warning: failed to XInitThreads()// //thread[thread-per-block[0]: ]: *pmt_car: wrong_type : ampl",*/ there is something bad with the red marked line (below) , but according to what is explained in t

Re: Problems when passing messages to a source block

2021-12-06 Thread Michelle
Good evening, I wonder where the function *msg_port_pub* is defined, I do not find it anywhere. I ask because the error "/can't interpret source code: 'messageGenerator' object has no attribute 'msg_port_pub'/**" persists.  I have implemented a handler that calls the function but it doesn't

Re: Problems when passing messages to a source block

2021-12-01 Thread Michelle
Good morning Jeff, I didn't write you yesterday because the code doesn't work yet as I want and I was trying to understand why. I don't have any error message but when I execute my flowgraph the value of the amplitude doesn't change and I have the warning "failed to XInitThreads()".I have almo

Re: Problems when passing messages to a source block

2021-11-30 Thread Jeff Long
Ha! No, not emailing myself, just a user who was replying directly. But to continue my conversation (hopefully with the OP), here is some working code. It does a print() because I didn't get around to actually sending a pmt as a message, but you get the idea. Picture of flowgraph attached. import

Re: Problems when passing messages to a source block

2021-11-29 Thread GNU Radio, the Free & Open-Source Toolkit for Software Radio
Jeff, Are you mailing with yourself? wt., 30 lis 2021 o 00:46 Jeff Long napisał(a): > Sounds good. Only look at the C++ to figure out the general idea. I'd > learn Python threading first in a standalone program so you're not learning > (debugging) GR and python threading at the same time. Good l

Re: Problems when passing messages to a source block

2021-11-29 Thread Jeff Long
Sounds good. Only look at the C++ to figure out the general idea. I'd learn Python threading first in a standalone program so you're not learning (debugging) GR and python threading at the same time. Good luck - let us know how it goes. Also, please respond to the mailing list so everyone can bene

Re: Problems when passing messages to a source block

2021-11-29 Thread Jeff Long
OK, it does work, as long as there is a message port defined and connected in a flowgraph. I was trying too simple an example. You would do your thread management in the start() and stop() functions. """ Embedded Python Blocks: Each time this file is saved, GRC will instantiate the first class it

Re: Problems when passing messages to a source block

2021-11-29 Thread Jeff Long
Issue submitted: https://github.com/gnuradio/gnuradio/issues/5358 On Mon, Nov 29, 2021 at 1:58 PM Jeff Long wrote: > It does not seem that python blocks can override start() and stop(), > which they should be able to do. So, don't go too far down that path. I do > not see anywhere in the code wh

Re: Problems when passing messages to a source block

2021-11-29 Thread Jeff Long
It does not seem that python blocks can override start() and stop(), which they should be able to do. So, don't go too far down that path. I do not see anywhere in the code where this is used or would have been caught. The embedded blocks are easier, be beware that GRC calls the init function to l

Re: Problems when passing messages to a source block

2021-11-29 Thread Jeff Long
Minor correction - as is done in Message Strobe, you don't want the thread to start running until start() is called. You can create the thread in init() or start(). The Message Strobe creates its thread in start(). On Mon, Nov 29, 2021 at 11:07 AM Jeff Long wrote: > The work() functions are for

Re: Problems when passing messages to a source block

2021-11-29 Thread Jeff Long
The work() functions are for stream handling. You may have already read https://wiki.gnuradio.org/index.php/Message_Passing The approach here should be to create a separate thread in your init, and have that thread periodically public a message. There is a Message Strobe block that does this (in

Problems when passing messages to a source block

2021-11-29 Thread Michelle
Good morning, I want to generate a source controlled by voltage. Basically, I send messages to a source in order to change its amplitude. I have built a block to generate messages and pass them to the source. To do so, I created an "embedded python block " that generates and transmits a messa