Reconfiguring with usrp2 src present

Hi All,

Is it possible to dynamically reconfigure a flow graph that has a usrp2
source?
I tested a simple lock()/unlock() from the top graph, and also from
the other parts of the graph. I always get the following error:

usrp2: channel 0 not receiving
usrp2::rx_samples() failed

If on the other hand, I don’t lock/unlock but just proceed with
disconnect/connect, it doesn’t complain, but from the way it behaves,
I can see that disconnect/connect failed to change the graph.

Thanks,

Veljko

p.s. the same happens if I use stop-wait-start instead of lock-unlock

On Tue, 2010-02-16 at 13:47 -0800, Veljko P. wrote:

Is it possible to dynamically reconfigure a flow graph that has a usrp2 source?

Yes.

I tested a simple lock()/unlock() from the top graph, and also from
the other parts of the graph. I always get the following error:

usrp2: channel 0 not receiving
usrp2::rx_samples() failed

Are you using 3.2.2? If so, I think this is a bug that was fixed in our
development since then.

Johnathan

Thanks a lot for the answer, Jonathan.

Yes, I am using 3.2.2, I’ll try with the latest trunk, although I
remember that in past I had problems with building gr-pager on Ubuntu
9.10.

cheers,

Veljko

p.s. I’m using 11370 firmware. Do I have to change the firmware too?

2010/2/16 Johnathan C. [email protected]:

On 16 February 2010 23:32, Veljko P. [email protected] wrote:

Thanks a lot for the answer, Jonathan.

Yes, I am using 3.2.2, I’ll try with the latest trunk, although I
remember that in past I had problems with building gr-pager on Ubuntu
9.10.

I have successfully built gnuradio (including gr-pager) from git few
weeks ago on Ubuntu 9.10 but I had to remove 3.2.2 from the linker
path first, otherwise it will try to link against the libraries from
3.2.2 and that fails.

Alex

Hi,

I upgraded to the latest trunk and, after brief testing, I thought
that the problem disappeared.
Unfortunately, I still see it every now and then. I’m modifying OFDM
receiver parameters, increasing modulation from “bpsk” to “qam256” and
changing the number of ofdm subcarriers after some time.

Occasionally I’d get
usrp2: channel 0 not receiving
usrp2::rx_samples() failed

And it seems that this does not depend on which
modulation/occupied-tones combination I try to use. It’s just random.
Although, It’s still better than with 3.2.2 where I used to get the
error every time.

Does anyone have an idea about how to go around this?

Thanks a lot,

Veljko

2010/2/16 Alexandru C. [email protected]:

On Wed, Apr 14, 2010 at 12:27, Andy_Long [email protected]
wrote:

I have faced the same problem. I try to received the limited samples from
USRP2 by using "head"block. It should return a -1 and the flow graph will
stop, am I right?

The flowgraph will not only stop, but will end its lifetime. Once
run() has returned, the flowgraph is no longer usable, or as we like
to say, further operations on it are “undefined.”

In general, starting and stopping an individual flowgraph should occur
at the same level of processing as application startup and shutdown.
Anything else is usually a sign of incorrect design (though not
always.) The run() method on a top block is really just a convenient
way of telling GNU Radio your application has nothing else to do until
the flowgraph exits.

Can you describe what you are trying to do?

Johnathan

Hello, Johnathan

I have faced the same problem. I try to received the limited samples
from
USRP2 by using "head"block. It should return a -1 and the flow graph
will
stop, am I right?

Then I call myblock.run() again during the while loop for several times.
However, after running the loop for more than three times, the message
repeated as below without any other output anymore.

usrp2: channel 0 not receiving
usrp2::rx_samples() failed

I am a bit confused since I have already updated all the packages in
synaptic package manager. The newest version is 3.2.2-1. Should I
updated
anything else to solve this problem? Other examples related to USRP2
such as
usrp2_fft and usrp2_display did not have such problem.

Thank you.

best regards,
Andy

Johnathan C.-2 wrote:

usrp2: channel 0 not receiving
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28247109.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hello,Johnathan

Did I have some misunderstanding about it? I still think the problem is
from
USRP2 rather than flow graph.
For example, I made some tests to change the while loop such as:

def main():

t = my_top_block()
t.run()
print t.c2mag.unmuted(): #show exceed threshold or not
time.sleep(3)

m = my_top_block()
m.run()
print m.c2mag.unmuted(): #show exceed threshold or not
time.sleep(3)

n = my_top_block()
n.run()
print n.c2mag.unmuted(): #show exceed threshold or not
time.sleep(3)

As same condition as before, after two correct outputs, the third one
start
to show the error.

Thank you.
regards,
Andy

Johnathan C.-2 wrote:


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28252256.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hello, Johnathan,

Thank you for your reply.

What I want to do is collect the samples from the usrp2 and use
gr.probe_avg_mag_sqrd_cf to check that if the one channel is free or
not. If
it is free, wait 3 second and repeat checking the samples again. I think
it
just the simple example of spectrum sensing.

self.u = usrp2.source_32fc(options.interface, options.mac_addr)
nsamples = 10
self.head = gr.head(gr.sizeof_float, int(nsamples))
self.c2mag = gr.probe_avg_mag_sqrd_cf(1, 0.001)
self.sink = gr.null_sink(gr.sizeof_float)

self.connect (self.u, self.c2mag, self.head,self.sink)

def main():
t = my_top_block()

while not t.c2mag.unmuted():
    t.run()
    print t.c2mag.unmuted(): #show exceed threshold or not
    print t.c2mag.level()        #show power
    time.sleep(3)

if name == ‘main’:
try:
main()

except KeyboardInterrupt:
    pass

But if the flow graph lifetime ended with return of “head” module, how
can I
get the print output more than twice? After that, the error message
arised.
It confused me a lot since I can not find many information about error
in
maillist

usrp2: channel 0 not receiving
usrp2::rx_samples() failed

Thank you.
regards,
Andy

Johnathan C.-2 wrote:


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28248114.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hi,

Replace all xxx.run with xxx.start() and put xxx.wait() followed by
xxx.stop() to stop the flowgraph

Best Regards,

Firas

----- Original Message ----

From: Andy_Long [email protected]
To: [email protected]
Sent: Thu, April 15, 2010 10:50:39 AM
Subject: Re: re[Discuss-gnuradio] configuring with usrp2 src present

Hello,Johnathan

Did I have some misunderstanding about it? I still

think the problem is from
USRP2 rather than flow graph.
For example, I
made some tests to change the while loop such as:

def main():

t = my_top_block()
t.run()

print t.c2mag.unmuted(): #show exceed threshold or not

time.sleep(3)

m = my_top_block()
m.run()
print m.c2mag.unmuted(): #show exceed threshold or not
time.sleep(3)

n = my_top_block()
n.run()
print n.c2mag.unmuted(): #show

exceed threshold or not
time.sleep(3)

As same

condition as before, after two correct outputs, the third one start
to show
the error.

Thank you.
regards,
Andy

Johnathan

-1 and the flow graph will
starting and stopping an individual flowgraph should occur

href=“mailto:[email protected]”>[email protected]

http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:

http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28252256.html
Sent
from the GnuRadio mailing list archive at
href=“http://Nabble.com”>Nabble.com.


Discuss-gnuradio

mailing list

href=“mailto:[email protected]”>[email protected]

Hi Firas,

But it shows the same error as before. I am doing tests like that:

def main():
t = my_top_block()

t.start()
t.wait()
t.stop()
print t.c2mag.level() #print power
time.sleep(3)

m = my_top_block()

m.start()
m.wait()
m.stop()
print m.c2mag.level() #print power
time.sleep(3)

n = my_top_block()

n.start()
n.wait()
n.stop()
print n.c2mag.level() #print power
time.sleep(3)

r = my_top_block()

r.start()
r.wait()
r.stop()
print r.c2mag.level() #print power
time.sleep(3)

Or I am doing the while loop like that

def main():

while 1:
    t = my_top_block()
    t.start()
    t.wait()
    t.stop()
    print t.c2mag.level() #print power
    time.sleep(3)

error message

StdErr: usrp2: failed to enable realtime scheduling
1.43518970096e-07
StdErr: S1.41236599021e-07
StdErr: usrp2: channel 0 not receiving
usrp2::rx_samples() failed
0.0
StdErr: usrp2: channel 0 not receiving
usrp2::rx_samples() failed
0.0

The thing is that the first output is always fine to print the received
power. After that it will print the power again as expected, however
with
error message “StdErr: S”. It sometimes can print the power for third
time,
then usrp2 collapses with “StdErr: usrp2: channel 0 not receiving
usrp2::rx_samples() failed”. However,most of time usrp2 collapses in the
second loop rather than third loop.

If it is the problem of setting the loop of flow graph, I think I can’t
get
the second output or even third output. Am I right? For example, if I
changed the usrp2 source with constant sine wave, the program runs fine.

If it is the problem of usrp2, I guess I will face the same problem even
I
am writing my own block simliary like message sink or gr-bin_statistics
sink.

Another question is that can I change the tune delay time in
gr-bin_statistics block to do the same thing such as time.sleep(3)? I
just
throw all the samples in next 3 seconds

thank you
best regards,
Andy

Firas A. wrote:

t.run() 
time.sleep(3) 

condition as before, after two correct outputs, the third one start
Corgan-2 wrote:

stop, am I right?
at the same
Can you describe what you are trying to do?
href=“mailto:[email protected]”>[email protected]
from the GnuRadio mailing list archive at
href=“http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
target=_blank
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28264537.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hello, Firas,

Yes. I have tried it like that:

def main():
t = my_top_block()

while 1:
  t.start()
  print t.c2mag.level()
  time.sleep(3)
  t.stop()
  t.wait()

The maxmum records of USRP2 output is five. After that usrp2 collapses.
I
used “head” block to limit the number of samples I want to colloct. It
will
returns a -1 to stop the flow graph. Maybe it caused the problem? But I
do
not know how to limit the samples without this block

Thank you.

best regards,
Andy

Error message:

StdErr: usrp2: failed to enable realtime schedulingStdErr:
2.51469463974e-07
StdErr: S2.75961855481e-07
StdErr: S2.76194623337e-07
StdErr: S2.76736606134e-07
StdErr: S2.67613864975e-07
StdErr: usrp2: channel 0 not receiving
usrp2::rx_samples() failed
2.67613864975e-07
StdErr: usrp2: channel StdErr: 0StdErr: not receivingStdErr:
StdErr: usrp2::rx_samples() failedStdErr:

Firas A. wrote:

    time.sleep(3)    
    n.stop()

t.start()
error
0.0
After that it will print the power again as expected, however with
setting the loop of flow graph, I think I can’t get
sink.
best
Firas A. wrote:

href=“mailto:[email protected]”>[email protected]"

limited samples from

GNU Radio your application has nothing else to do until

href=“mailto:[email protected]”>[email protected]">

href=“mailto:[email protected]”>[email protected]">

ymailto=“mailto:[email protected]
View this message in context:

http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28271684.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hi,

The xxx.stop() and xxx.wait() should be called after time.sleep(xxx)

see:
http://gnuradio.org/redmine/wiki/gnuradio/TutorialsWritePythonApplications

Best Regards,

Firas

----- Original Message ----

From: Andy_Long [email protected]
To: [email protected]
Sent: Fri, April 16, 2010 11:52:57 AM
Subject: Re: re[Discuss-gnuradio] configuring with usrp2 src present

Hi Firas,

But it shows the same error as before. I am doing tests

like that:

def main():
t =

my_top_block()

t.start()

t.wait()
t.stop()

print t.c2mag.level() #print power
time.sleep(3)    

m = my_top_block()

    m.start()
m.wait()

m.stop()
print m.c2mag.level() #print
power
time.sleep(3)

    n =

my_top_block()

n.start()

n.wait()
n.stop()

print n.c2mag.level() #print power
time.sleep(3)        
    r =

my_top_block()

r.start()

r.wait()
r.stop()

print r.c2mag.level() #print power
time.sleep(3)        

Or I am doing the while loop like that

def

main():

    while

1:
t =
my_top_block()

t.start()

t.wait()

t.stop()
print
t.c2mag.level() #print power

time.sleep(3)

error

message

StdErr: usrp2: failed to enable realtime
scheduling
1.43518970096e-07
StdErr: S1.41236599021e-07
StdErr: usrp2:
channel 0 not receiving
usrp2::rx_samples() failed
0.0
StdErr: usrp2:
channel 0 not receiving
usrp2::rx_samples() failed
0.0

The

thing is that the first output is always fine to print the received
power.
After that it will print the power again as expected, however with
error
message “StdErr: S”. It sometimes can print the power for third time,
then
usrp2 collapses with “StdErr: usrp2: channel 0 not
receiving
usrp2::rx_samples() failed”. However,most of time usrp2 collapses
in the
second loop rather than third loop.

If it is the problem of

setting the loop of flow graph, I think I can’t get
the second output or even
third output. Am I right? For example, if I
changed the usrp2 source with
constant sine wave, the program runs fine.

If it is the problem of

usrp2, I guess I will face the same problem even I
am writing my own block
simliary like message sink or gr-bin_statistics
sink.

Another

question is that can I change the tune delay time in
gr-bin_statistics block
to do the same thing such as time.sleep(3)? I just
throw all the samples in
next 3 seconds

thank you
best

regards,
Andy

Firas A. wrote:

href=“mailto:[email protected]”>[email protected]"

limited samples from

GNU Radio your application has nothing else to do until

href=“mailto:[email protected]”>[email protected]">

href=“mailto:[email protected]”>[email protected]">
href=“http://lists.gnu.org/mailman/listinfo/discuss-gnuradio” target=_blank

href=“http://lists.gnu.org/mailman/listinfo/discuss-gnuradio” target=_blank

http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:

http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28264537.html
Sent
from the GnuRadio mailing list archive at
Nabble.com.


Discuss-gnuradio

mailing list

href=“mailto:[email protected]”>[email protected]

Hello, Johnathan,

I am wandering whether I should uninstall every gnuradio pack in Ubuntu
9.04
and use source
code to install it again? Or I just need to use source code install
update
for new version?

If I need to remove all binary package. How can I check that I have
removed
the gnuradio binary package completely in Synaptic Package Manager and
keep
the system clean enough for source code insall?

thank you
regards,
Andy

Johnathan C.-2 wrote:

Johnathan


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/reconfiguring-with-usrp2-src-present-tp27615622p28273084.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Fri, Apr 16, 2010 at 13:56, Andy_Long [email protected]
wrote:

The maxmum records of USRP2 output is five. After that usrp2 collapses.

Andy, I did forget to mention to you that the USRP2 specific problem
has been fixed in the git master branch since the 3.2.2 release.
You’ll need to switch from the binary install you have now to a source
code install from the git tree to get the fix.

Johnathan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs