Re: GRC: Cannot find "RFNoC Fosphor" blocks

2023-09-06 Thread Clint Scarborough
I did muddle my response - I see all the blocks with UHD 4.4 and GR's 
main branch, as Jeff mentioned below.  However, with GR's maint-3.10 I 
did still see the RFNoC Fosphor block, but not the RFNoC Fosphor 
_display_ block.


Are you (or anyone else) using the RFNoC Fosphor display block with a 
responsive GUI?  Brian Padalino helped me out on this mailing list back 
in July, and he mentioned that the GUI wasn't responsive for him either.



On 9/5/23 12:44 PM, Jeff Long wrote:
The RFNoC Fosphor block is included in-tree on the main branch, but 
has not been backported to the maint-3.10 branch.


On Mon, Sep 4, 2023 at 7:59 AM Clint Scarborough 
 wrote:


I'm not sure about UHD 4.3, but the blocks are available for me
with UHD 4.4 and GR 3.10.

However, the RFNoC Fosphor display block bogs down the GUI so much
that it's practically unusable.  I haven't been able to look into
what's wrong, or whether I'm doing something wrong though.
-- Clint


On September 4, 2023 12:51:10 PM UTC, "Bachmaier, Luca"
 wrote:

Hi Johannes, thank you for your reply. Where can I find this
module? The gr-ettus module
(https://github.com/EttusResearch/gr-ettus) is apparently not
required for 3.10, on the site it says "Use gr-uhd directly".
That aside I'm installing GNU Radio 3.10.7 right now which
should contain the RFNoC Fosphor blocks (as opposed to my
current version 3.10.5). Regards Luca

-Ursprüngliche Nachricht- Von:
discuss-gnuradio-bounces+luca.bachmaier=iis.fraunhofer...@gnu.org

Im Auftrag von Johannes Demel Gesendet: Montag, 4.
September 2023 14:30 An: discuss-gnuradio@gnu.org Betreff:
Re: GRC: Cannot find "RFNoC Fosphor" blocks Hi Luca, you
need to install the OOT module that includes the RFNoC
version of fosphor. Cheers Johannes On 04.09.23 13:00,
Bachmaier, Luca wrote:

Hey everyone, I’m currently implementing a flowgraph
that uses RFNoC by UHD / Ettus Research. In GNU Radio
companion, I noticed that there are no blocks “RFNoC
Fosphor Block” and “RFNoC Qt Fosphor Display”
available (See this workshop
https://www.youtube.com/watch?v=M9ntwQie9vs
 @ 22:13
for a 


flowgraph

that uses them). My basic software setup is: -OS:
Debian 12 -GNU Radio 3.10.5.1 -UHD 4.3.0.0+ds1-5 I was
wondering why these blocks aren’t available or if I
need to install an additional module in order to get
them. The module gr-fosphor
(https://projects.osmocom.org/projects/sdr/wiki/Fosphor
)
just installs the “standard” version of Fosphor,
**not** the FPGA / RFNoC 


implementation.

Thank you and regards Luca 


Re: Selector error - "IndexError: output_index must be < noutputs"

2023-09-06 Thread Elmore Family
Jim,

Thanks for your comments. I think I have been going down the wrong road and 
need to refocus on using a callback to resolve my issue.

I have used callbacks all through my project which have been triggered by an 
action such as a toggle or a radio button selection. I need to trigger the 
callback in this case programmatically based on a time value. How do I do this?

In your code snippet how do you trigger the set_signal_choice callback from a 
program?

I want to set a select_wave variable used in the output_index of a selector in 
order to select the appropriate output. I want to set that variable from within 
another method. How do I do that?

Jim

From: Jim Melton
Sent: Tuesday, September 5, 2023 1:02 PM
To: discuss-gnuradio@gnu.org
Subject: RE: Re: Selector error - "IndexError: output_index must be < noutputs"

In your original,



import Receive Receive is a Hier Block which I import in to my Python file

blocks_selector_0 = Receive.blocks.selector(gr.sizeof_float*1,0,0) 
Instantiation of blocks_selector_0. The Selector block is in the Receive Hier 
Block.



I questioned the syntax. You said “Receive is a Hier Block” but then you do a 
module operation (not an instance operation), so it wasn’t clear what you are 
doing.



In your simplified example, your graph instantiates a selector, and your 
embedded python block instantiates a selector. The EPY block doesn’t connect 
the selector to anything, so selecting an output is very likely to give you an 
index error.



I created a signal generator, where I could mix in different waveforms with an 
input waveform, and used the selector to control which signal was being mixed 
in. As with a lot of my stuff, I used GRC for the initial prototype, then make 
the generated code more production-ready. I have these lines:



self.source_selector = 
blocks.selector(gr.sizeof_gr_complex*1,signal_choice,0)

self.source_selector.set_enabled(True)

// …

self.connect((self.noise_throttle, 0), (self.source_selector, 0))

self.connect((self, 0), (self.source_selector, 1))

self.connect((self.source_selector, 0), (self.live_strength, 0))

self.connect((self.source_selector, 0), (self, 2))



In your attached GRC file, you have flowgraph generated connections, but you 
don’t have any connections to the one created in your EPY block (probably your 
bug). As Paul suggested, you can use variables and callbacks to control your 
selector (which might be simpler than the EPY block). My hier block (referenced 
above) has this:



def set_signal_choice(self, signal_choice):

self.signal_choice = signal_choice

self.source_selector.set_input_index(self.signal_choice)



and the associated GRC file has:



templates:

  imports: from gnuradio import inputs

  make: "inputs.siggen(\nsignal_choice=${ signal_choice },\n)"

  callbacks:

  - set_signal_choice(${ signal_choice })



(simplified for illustrative purposes).



Hope this helps.

---

Jim Melton


Non-Sensitive



From: Elmore's 
Sent: Friday, September 1, 2023 20:28
To: discuss-gnuradio@gnu.org
Subject: [EXTERNAL] Re: Selector error - "IndexError: output_index must be < 
noutputs"



Jim,



I have attached a greatly simplified version of what I am trying to accomplish. 
I still get the same error. What am I doing wrong?



Jim



From: Jim Melton

Sent: Monday, August 28, 2023 12:01 PM

To: discuss-gnuradio@gnu.org

Subject: RE: Selector error - "IndexError: output_index must be < noutputs"



Don’t you need to instantiate “Receive”?



---

Jim Melton


Non-Sensitive



From: discuss-gnuradio-bounces+jim.melton=sncorp@gnu.org 
 On Behalf Of Elmore's
Sent: Monday, August 28, 2023 09:15
To: discuss-gnuradio@gnu.org
Subject: [EXTERNAL] Selector error - "IndexError: output_index must be < 
noutputs"



I am attempting to use a Selector block with 2 outputs. I want to select the 
output programmatically. When I run the flowgraph, I get the subject error.



The following is my abbreviated code which is pertinent to the question 
interspersed with explanatory comments:



import Receive Receive is a Hier Block which I import in to my Python file

blocks_selector_0 = Receive.blocks.selector(gr.sizeof_float*1,0,0) 
Instantiation of blocks_selector_0. The Selector block is in the Receive Hier 
Block.



blocks_selector_0.set_output_index(0) I am trying to select the 0 output. This 
is where the error occurs.



0 is certainly less than 2 so what is happening?



Jim






 Virus-free.www.avg.com




CONFIDENTIALITY NOTICE - SNC EMAIL: This email and any attachments are 
confidential, may contain proprietary, protected, or export controlled 
information, and are intended for the use of the intended recipients only. Any 
review, reliance, distribution, disclosure, or forwarding of this email and/or 
attachments outside of Sierra Nevada Corporation (SNC) without express written 
approval of the sender, except to the extent required to further pr

RE: Re: Selector error - "IndexError: output_index must be < noutputs"

2023-09-06 Thread Jim Melton
My tool uses XMLRPC integrated from a web page to change the values. That is, a 
web page displays a control (in a form, but doesn’t matter). When the form is 
submitted, the back-end makes an XMLRPC call to set the value of the affected 
parameter. I already had a Python-based web server, so adding a page (with 
backend) was trivial.

In an interactive flowgraph, you can use Qt controls to do the same thing (my 
first prototype was Qt-based, but I couldn’t deploy Qt). Paul Atreides (muaddib 
in Matrix chat) is an excellent resource, and helped me a lot.

Your embedded python block could also invoke the callbacks, but you need to 
access the graph-instantiated selector and not create a new one. The key to 
programmatic access is getting a handle to the object you want to control. 
Sometimes this means creating delegator functions in your top block (it’s been 
a while, so I don’t remember what/how GRC exposes create blocks). Another 
option is a message port.

Here is the critical problem:

  *   I want to set a select_wave variable used in the output_index of a 
selector in order to select the appropriate output. I want to set that variable 
from within another method. How do I do that?

From a basic programming perspective, the other method needs to be able to see 
the object that exposes the variable (either directly or through getter/setter 
methods). That’s on you. You can inject it (pass the other object to the one 
that needs to act on it); make it global; or have some other delegation service 
(an indirect way to do the same thing).

There are many ways to skin the cat. I’m sorry I can’t be more helpful, but my 
GRC-fu is rusty.
---
Jim Melton

Non-Sensitive

From: Elmore Family 
Sent: Wednesday, September 6, 2023 11:34
To: discuss-gnuradio@gnu.org
Subject: [EXTERNAL] Re: Selector error - "IndexError: output_index must be < 
noutputs"

Jim,

Thanks for your comments. I think I have been going down the wrong road and 
need to refocus on using a callback to resolve my issue.

I have used callbacks all through my project which have been triggered by an 
action such as a toggle or a radio button selection. I need to trigger the 
callback in this case programmatically based on a time value. How do I do this?

In your code snippet how do you trigger the set_signal_choice callback from a 
program?

I want to set a select_wave variable used in the output_index of a selector in 
order to select the appropriate output. I want to set that variable from within 
another method. How do I do that?

Jim

From: Jim Melton
Sent: Tuesday, September 5, 2023 1:02 PM
To: discuss-gnuradio@gnu.org
Subject: RE: Re: Selector error - "IndexError: output_index must be < noutputs"

In your original,


import Receive Receive is a Hier Block which I import in to my Python file

blocks_selector_0 = Receive.blocks.selector(gr.sizeof_float*1,0,0) 
Instantiation of blocks_selector_0. The Selector block is in the Receive Hier 
Block.

I questioned the syntax. You said “Receive is a Hier Block” but then you do a 
module operation (not an instance operation), so it wasn’t clear what you are 
doing.

In your simplified example, your graph instantiates a selector, and your 
embedded python block instantiates a selector. The EPY block doesn’t connect 
the selector to anything, so selecting an output is very likely to give you an 
index error.

I created a signal generator, where I could mix in different waveforms with an 
input waveform, and used the selector to control which signal was being mixed 
in. As with a lot of my stuff, I used GRC for the initial prototype, then make 
the generated code more production-ready. I have these lines:

self.source_selector = 
blocks.selector(gr.sizeof_gr_complex*1,signal_choice,0)
self.source_selector.set_enabled(True)
// …
self.connect((self.noise_throttle, 0), (self.source_selector, 0))
self.connect((self, 0), (self.source_selector, 1))
self.connect((self.source_selector, 0), (self.live_strength, 0))
self.connect((self.source_selector, 0), (self, 2))

In your attached GRC file, you have flowgraph generated connections, but you 
don’t have any connections to the one created in your EPY block (probably your 
bug). As Paul suggested, you can use variables and callbacks to control your 
selector (which might be simpler than the EPY block). My hier block (referenced 
above) has this:

def set_signal_choice(self, signal_choice):
self.signal_choice = signal_choice
self.source_selector.set_input_index(self.signal_choice)

and the associated GRC file has:

templates:
  imports: from gnuradio import inputs
  make: "inputs.siggen(\nsignal_choice=${ signal_choice },\n)"
  callbacks:
  - set_signal_choice(${ signal_choice })

(simplified for illustrative purposes).

Hope this helps.
---
Jim Melton

Non-Sensitive

From: Elmore's mailto:wa4...@comcast.net>>
Sent: Friday, September 1, 2023 20:28
To: discuss-gnura

embedded python block-Can't interpret source code: "'__name__' not in globals"

2023-09-06 Thread Jiya Johnson
Good morning community,
I was trying to create an embedded python module with the same code for fec
extended encoder in GNU RADIO 3.10.7 version .I am encountering this
problem "Param - Code(_source_code):
Can't interpret source code: "'__name__' not in globals""
it will be very helpful if someone can help me to clear this..The used code
is 
*https://github.com/gnuradio/gnuradio/blob/master/gr-fec/python/fec/extended_encoder.py#L21
*