Re: [Discuss-gnuradio] Check The output of a block & input captured frames to GNURadio

2014-03-29 Thread Marcus Müller
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Don't erase stuff because it takes time...
tb.wait() is necessary to let the top block wait for all the work to
finish.
GNU Radio flowgraphs will run until a) a block signals that it's done,
or b) the flow graph is stopped.
I think you want to use the "a)" approach. Add a Head block into your
flowgraph:
http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1head.html

Your flow graph will then terminate after a specified number of
samples has passed the head block.

So what your program does is
tb.start()
tb.wait()
outpput=sink.data()

Greetings,
Marcus

On 29.03.2014 00:51, Sara Chérif wrote:
> I found that "tb.wait()" is written in the file so it takes too
> long time . Now after I erased tb.wait() .. the output on terminal
> is ---> ( ) .. I don't know why ?? Here is what is written in
> top_block.py
> 
> 
> #!/usr/bin/env python 
> ## # Gnuradio
> Python Flow Graph # Title: Top Block # Generated: Sat Mar 29
> 01:47:01 2014 ##
> 
> from gnuradio import blocks from gnuradio import eng_notation from
> gnuradio import gr from gnuradio.eng_option import eng_option from
> gnuradio.filter import firdes from grc_gnuradio import wxgui as
> grc_wxgui from optparse import OptionParser import wx
> 
> class top_block(grc_wxgui.top_block_gui):
> 
> def __init__(self): grc_wxgui.top_block_gui.__init__(self,
> title="Top Block") _icon_path =
> "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" 
> self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))
> 
> ## # Variables 
> ## self.samp_rate =
> samp_rate = 32000
> 
> ## # Blocks 
> ## 
> self.blocks_vector_source_x_0 = blocks.vector_source_b((6, 6), 
> True, 1, []) self.blocks_vector_sink_x_0 = blocks.vector_sink_b(1) 
> self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1, 
> samp_rate,True)
> 
> ## # Connections 
> ## 
> self.connect((self.blocks_vector_source_x_0, 0), 
> (self.blocks_throttle_0, 0)) self.connect((self.blocks_throttle_0,
> 0), (self.blocks_vector_sink_x_0, 0))
> 
> 4,1   Top
> 
> # QT sink close method reimplementation
> 
> def get_samp_rate(self): return self.samp_rate
> 
> def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate 
> self.blocks_throttle_0.set_sample_rate(self.samp_rate)
> 
> if __name__ == '__main__': import ctypes import sys if
> sys.platform.startswith('linux'): try: x11 =
> ctypes.cdll.LoadLibrary('libX11.so') x11.XInitThreads() except: 
> print "Warning: failed to XInitThreads()" parser =
> OptionParser(option_class=eng_option, usage="%prog: [options]") 
> (options, args) = parser.parse_args() tb = top_block() 
> tb.Start(True) print tb.blocks_vector_sink_x_0.data()
> 
> 
> 
> 2014-03-29 0:06 GMT+02:00 Sara Chérif :
> 
>> I want to make a test and see the output , I put 3 blocks ,
>> vector source , throttle and vector sink . I edited the "vector"
>> parameter in vector source block to (6,6). All 3 blocks have a
>> type "byte". I generated the flow graph. I moved to the directory
>> of grc file , I wrote in terminal vim top_block.py then I write
>> to the end of file : " print tb.blocks_vector_sink_x_0.data()" 
>> and saved the changes . Then I execute the python file by writing
>> in terminal : ./top_block.py But the output takes too long time
>> and doesn't appear ! what is the problem ? and is there any other
>> method to see the output ???As I am a beginner and someone told
>> me this method. I tried this for example 10 times but every time
>> it takes too long and doesn't appear , only one time it appears!
>> 
>> Another question : If I have captured some frames using wireshark
>> (from twinkle softphone), and  I saved them .I want to make them
>> an input to ofdm transmitter . How to make them an input?
>> 
>> Thanks :)
>> 
>> 
> 
> 
> 
> ___ Discuss-gnuradio
> mailing list Discuss-gnuradio@gnu.org 
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTNoMgAAoJEBQ6EdjyzlHtL0AH/iStidlKCfhombUBd6bHbS8t
4M8cPCIYcIecYKRdavevc+lvqSKviNuzehhhBLrOQHRgCP7XFh63Tf+newFH0bWa
O8LQx+xssVdQDPTtbBUzjDLnszJium94YrPsqXp4re+qZR341UEkf7s7UzHzWxff
CnRdzH1oiUgJ1C7oeHS3PzKu9JUEjAznhXnf99X5wysA4CRf5W5LHfHqnKL0z0Z7
EMEOrQ7vquGV6Ky6T10NxxqiTPEzw3HOgpoM6PfXSPNcfoZ+THBVdTNVStR6Em5Q
yYrDFUgGU123VoebQYtEBQxIpBjoYvwyrK3O3v/tZEMn/WSpHTiEh7REV9slA5I=
=abZB
-END PGP SIGNATURE-

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

Re: [Discuss-gnuradio] Check The output of a block & input captured frames to GNURadio

2014-03-28 Thread Sara Chérif
I found that "tb.wait()" is written in the file so it takes too long time .
Now after I erased tb.wait() .. the output on terminal is ---> ( ) .. I
don't know why ?? Here is what is written in top_block.py


#!/usr/bin/env python
##
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Sat Mar 29 01:47:01 2014
##

from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import wx

class top_block(grc_wxgui.top_block_gui):

def __init__(self):
grc_wxgui.top_block_gui.__init__(self, title="Top Block")
_icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

##
# Variables
##
self.samp_rate = samp_rate = 32000

##
# Blocks
##
self.blocks_vector_source_x_0 = blocks.vector_source_b((6, 6),
True, 1, [])
self.blocks_vector_sink_x_0 = blocks.vector_sink_b(1)
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1,
samp_rate,True)

##
# Connections
##
self.connect((self.blocks_vector_source_x_0, 0),
(self.blocks_throttle_0, 0))
self.connect((self.blocks_throttle_0, 0),
(self.blocks_vector_sink_x_0, 0))

4,1   Top

# QT sink close method reimplementation

def get_samp_rate(self):
return self.samp_rate

def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)

if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print "Warning: failed to XInitThreads()"
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
tb = top_block()
tb.Start(True)
print tb.blocks_vector_sink_x_0.data()



2014-03-29 0:06 GMT+02:00 Sara Chérif :

> I want to make a test and see the output , I put 3 blocks , vector source
> , throttle and vector sink . I edited the "vector" parameter in vector
> source block to (6,6). All 3 blocks have a type "byte". I generated the
> flow graph.
> I moved to the directory of grc file , I wrote in terminal
> vim top_block.py
> then I write to the end of file : " print tb.blocks_vector_sink_x_0.data()"
> and saved the changes . Then I execute the python file by writing in
> terminal :
> ./top_block.py
> But the output takes too long time and doesn't appear ! what is the
> problem ?
> and is there any other method to see the output ???As I am a beginner and
> someone told me this method.
> I tried this for example 10 times but every time it takes too long and
> doesn't appear , only one time it appears!
>
> Another question :
> If I have captured some frames using wireshark (from twinkle softphone),
> and  I saved them .I want to make them an input to ofdm transmitter . How
> to make them an input?
>
> Thanks :)
>
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Check The output of a block & input captured frames to GNURadio

2014-03-28 Thread Sara Chérif
I want to make a test and see the output , I put 3 blocks , vector source ,
throttle and vector sink . I edited the "vector" parameter in vector source
block to (6,6). All 3 blocks have a type "byte". I generated the flow graph.
I moved to the directory of grc file , I wrote in terminal
vim top_block.py
then I write to the end of file : " print tb.blocks_vector_sink_x_0.data()"
and saved the changes . Then I execute the python file by writing in
terminal :
./top_block.py
But the output takes too long time and doesn't appear ! what is the problem
?
and is there any other method to see the output ???As I am a beginner and
someone told me this method.
I tried this for example 10 times but every time it takes too long and
doesn't appear , only one time it appears!

Another question :
If I have captured some frames using wireshark (from twinkle softphone),
and  I saved them .I want to make them an input to ofdm transmitter . How
to make them an input?

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