Changing USRP subdevice on the fly

2022-11-22 Thread Moses Browne Mwakyanjala
Hi everyone,
I wrote a simple program for a usrp b210. I would like to change the RX
antenna on the fly. That is, antenna 0 should be RX2 on Subdevice A:A and
antenna 1 RX2 on Subdevice A:B as shown in the piece of code below. The
problem I face is that I can't change the subdevice on the fly. The
usrp->set_rx_subdev_spec(sRxSubDev)
call doesn't seem to have any effect if it is called more than once. How
should I proceed?

std::string sRxSubDev;
switch(m_Settings.m_nTMAntenna)
{
case 0:// Using antenna 1
sRxSubDev = std::string("A:A");
break;
case 1:// Using antenna 2
sRxSubDev = std::string("A:B");
break;
}
usrp->set_rx_subdev_spec(sRxSubDev);
usrp->set_rx_antenna("RX2");

Thanks in advance,

Moses.


Re: Changing USRP subdevice on the fly

2022-11-22 Thread Marcus D. Leech

On 22/11/2022 16:24, Moses Browne Mwakyanjala wrote:

Hi everyone,
I wrote a simple program for a usrp b210. I would like to change the 
RX antenna on the fly. That is, antenna 0 should be RX2 on Subdevice 
A:A and antenna 1 RX2 on Subdevice A:B as shown in the piece of code 
below. The problem I face is that I can't change the subdevice on the 
fly. The usrp->set_rx_subdev_spec(sRxSubDev) call doesn't seem to have 
any effect if it is called more than once. How should I proceed?


 std::string sRxSubDev;
 switch(m_Settings.m_nTMAntenna)
 {
 case 0:// Using antenna 1
 sRxSubDev = std::string("A:A");
 break;
 case 1:// Using antenna 2
 sRxSubDev = std::string("A:B");
 break;
 }
 usrp->set_rx_subdev_spec(sRxSubDev);
 usrp->set_rx_antenna("RX2");
Thanks in advance,
Moses.

You would likely have to tear down the streamer and start a new one.

Alternately, you could just stream both channels at the same time, and 
simply drop the samples from the part of the stream

  you don't care about.



QT GUI Label error in v 3.10.1.1

2022-11-22 Thread Jose Ruvalcaba
Hello,

I've been noticing an issue popping out everytime I stop running my
flowgraph and I was wondering if someone had some insight on it. I have a
flowgraph where a signal source is connected to a probe signal block. This
block is constantly updating values and are being displayed using the QT
GUI Label block. However, after running my flowgraph for about 10 minutes I
get the following error:

*Executing: /usr/bin/python3 -u
/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py*

*Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
QT_QPA_PLATFORM=wayland to run on Wayland anyway.*

*Exception in thread Thread-1 (_amp_probe):*

*Traceback (most recent call last):*

*  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 150, in _amp_probe*

*self.doc.add_next_tick_callback(functools.partial(self.set_amp,val))*

*  File "/usr/lib/python3/dist-packages/gnuradio/gr/hier_block2.py", line
88, in __getattr__*

*return getattr(self._impl, name)*

*AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no
attribute 'doc'*

*During handling of the above exception, another exception occurred:*

*Traceback (most recent call last):*

*  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner*

*self.run()*

*  File "/usr/lib/python3.10/threading.py", line 953, in run*

*self._target(*self._args, **self._kwargs)*

*  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 152, in _amp_probe*

*self.set_amp(val)*

*  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 182, in set_amp*

*self.set_variable_qtgui_label_0(self.amp)*

*  File
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py",
line 189, in set_variable_qtgui_label_0*

*Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label,
"setText", Qt.Q_ARG("QString",
str(self._variable_qtgui_label_0_formatter(self.variable_qtgui_label_0*

*RuntimeError: wrapped C/C++ object of type QLabel has been deleted*



It seems that my issue is related to the QT GUI Label block because when I
remove it and add say QT GUI Number sink, this issue doesn't appear.

Has anyone experienced this issue? If so, would anyone be able to steer me
in the direction to fix it? I am currently running on Ubuntu 22.04 and am
running GNU RADIO 3.10.1.1 which I installed using sudo apt-get install.
I've also attached the flowgraph I am talking about.

Thanks,

Jose Ruvalcaba


func_probe_test.grc
Description: Binary data


Re: QT GUI Label error in v 3.10.1.1

2022-11-22 Thread Cinaed Simson
Hi Jose - since it's complaining about wayland, check to see if the 
following software is installed


   qt6-wayland
   xwayland

On debian systems, type

  apt list --installed | grep wayland

to see what's installed.

wayland is efficient way to connect to your desktop.

-- Cinaed


On 11/22/22 19:22, Jose Ruvalcaba wrote:

Hello,

I've been noticing an issue popping out everytime I stop running my 
flowgraph and I was wondering if someone had some insight on it. I 
have a flowgraph where a signal source is connected to a probe signal 
block. This block is constantly updating values and are being 
displayed using the QT GUI Label block. However, after running my 
flowgraph for about 10 minutes I get the following error:


*/Executing: /usr/bin/python3 -u 
/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py/*


*/
/*

*/Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use 
QT_QPA_PLATFORM=wayland to run on Wayland anyway./*


*/Exception in thread Thread-1 (_amp_probe):/*

*/Traceback (most recent call last):/*

*/  File 
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", 
line 150, in _amp_probe/*


*/self.doc.add_next_tick_callback(functools.partial(self.set_amp,val))/*

*/  File "/usr/lib/python3/dist-packages/gnuradio/gr/hier_block2.py", 
line 88, in __getattr__/*


*/return getattr(self._impl, name)/*

*/AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no 
attribute 'doc'/*


*/
/*

*/During handling of the above exception, another exception occurred:/*

*/
/*

*/Traceback (most recent call last):/*

*/  File "/usr/lib/python3.10/threading.py", line 1016, in 
_bootstrap_inner/*


*/self.run()/*

*/  File "/usr/lib/python3.10/threading.py", line 953, in run/*

*/self._target(*self._args, **self._kwargs)/*

*/  File 
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", 
line 152, in _amp_probe/*


*/self.set_amp(val)/*

*/  File 
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", 
line 182, in set_amp/*


*/self.set_variable_qtgui_label_0(self.amp)/*

*/  File 
"/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", 
line 189, in set_variable_qtgui_label_0/*


*/Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label, 
"setText", Qt.Q_ARG("QString", 
str(self._variable_qtgui_label_0_formatter(self.variable_qtgui_label_0/*


*/RuntimeError: wrapped C/C++ object of type QLabel has been deleted/*

*//*


It seems that my issue is related to the QT GUI Label block because 
when I remove it and add say QT GUI Number sink, this issue doesn't 
appear.



Has anyone experienced this issue? If so, would anyone be able to 
steer me in the direction to fix it? I am currently running on Ubuntu 
22.04 and am running GNU RADIO 3.10.1.1 which I installed using sudo 
apt-get install. I've also attached the flowgraph I am talking about.



Thanks,

Jose Ruvalcaba