RE: [Discuss-gnuradio] libusrp C++ examples

2009-04-02 Thread Per Zetterberg
 

 -Original Message-
 From: 
 discuss-gnuradio-bounces+per.zetterberg=ee.kth...@gnu.org 
 [mailto:discuss-gnuradio-bounces+per.zetterberg=ee.kth...@gnu.
org] On Behalf Of Radha Krishna Ganti
 Sent: den 1 april 2009 19:35
 To: Discuss-gnuradio@gnu.org
 Subject: [Discuss-gnuradio] libusrp C++ examples
 
 Hi,
 Are there any examples to use USRP  just using the 
 libusrp c++ interface? I don't want to use  GNU Radio.
 My requirements are to  initialize the USRP, set a target 
 frequency, set the interpolation rate  and to 
 transmit/receive  data. I know that we will have to use the 
 libusrp, but am not able to find examples for doing so. Also 
 is it possible to use in-band signaling  library similarly?
 
 Can someone please provide me some example code as to how to 
 do this or a link to existing examples?
 
 -Regards
 Radha Krishna Ganti
 
 --
 Radha Krishna Ganti
 Dept of Elec. Engg.
 Univ of Notre Dame
 www.nd.edu/~rganti




See:
http://gnuradio.org/trac/wiki/UsrpFAQ/CppInterface 

To work with later releases at least the line :

usrp_standard_rx *urx should be changed to usrp_standard_rx_sptr urx

(there may also be other changes required).

To control the daughterboards use the tune method of usrp_standard_rx.



BR/
Per



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


[Discuss-gnuradio] Difference in gain using gnuradio 3.1.3 and the trunk (at least on RFX1800)

2009-04-02 Thread Per Zetterberg
Dear All,

I have connected a signal generator to my USRP and I am using a CW. Thus I
have a constant input power. I am running the usrp_rx_cfile.py utility
(exact command line below). If I run gnuradio 3.1.3 then the amplitude I see
is 16dB higher than if compile from the trunk (checked  out a week ago or
so). I think it has to do with the new daughterboard  code being different
from the old python one. I am using an RFX1800 daughterboard.

The signals are also conjugated with respect to each other

BR/
Per


sudo ./usrp_rx_cfile.py -d 8 -f 1902.5e6 -R A -s -g 50 -N 5000 test.dat




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


Re: [Discuss-gnuradio] gr-howto-write-a-block

2009-04-02 Thread Martin Braun
On Thu, Apr 02, 2009 at 04:55:39AM +0200, William Sherman wrote:
 However when I run a test program with:
 
 from gnuradio import howto

There's several places where this can go wrong, but my guess is you're
trying to run the line above in one of your qa_* files through make
check - right?

If so, change the line to 'import howto', as in the examples. the
run_tests script will change all the path stuff for you.

Once make check passes, see what 'make install' tells you; all make
processes are pretty verbose. It might be putting your module in the
wrong position. To see if that worked, you have to use your 'from
gnuradio ...' line above.

Hope this is what you were looking for...

MB

-- 
Dipl.-Ing. Martin Braun   Phone: +49-(0)721-608 3790
Institut fuer Nachrichtentechnik  Fax:   +49-(0)721-608 6071
Universitaet Karlsruhe (TH)   http://www.int.uni-karlsruhe.de/


pgppB0Snq7q7A.pgp
Description: PGP signature
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] LW/AM/SW radio very cheap in laptop?

2009-04-02 Thread John Gilmore
There's another chance to get kids into radio...

If a high volume kids' laptop had stereo HD audio ports available
(24-bit 192 kHz converters, 95 db input and 100 db output), how cheap
and small a circuit could you build onto that motherboard to provide
useful LW/AM radio reception?  Could you use the left output channel
to tune, the right output channel to control the gain, and feed
the resulting filtered signal to a pair of input channels?

John


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


Re: [Discuss-gnuradio] LW/AM/SW radio very cheap in laptop?

2009-04-02 Thread Firas Abbas

Hi,

--- On Thu, 4/2/09, John Gilmore g...@toad.com wrote:

 There's another chance to get kids into radio...
 
 If a high volume kids' laptop had stereo HD audio ports available
 (24-bit 192 kHz converters, 95 db input and 100 db output), how cheap
 and small a circuit could you build onto that motherboard to provide
 useful LW/AM radio reception?  
 
 John


Here is my 2 cents:

1) AM signals known to be strong, RF Gain may not be required.

2) Undersampling can be used to downconvert/digitize AM signals.

3) RF Tunning is the problem. We have to think for away to use the voltage from 
one of the audio output ports to control a bandpass filter center frequency 
(voltage controlled filter).

4) Software demodulation.

Best Regards,


Firas



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


[Discuss-gnuradio] some posts are missing in gmane.org

2009-04-02 Thread feldmaus
Hi All,

i only want to let you know, that some of the mails
i posted here are not shown in gmane.org, but in my
newsreader thunderbird(debian).
Maybe there is a problem ?

Regards Markus



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


Re: [Discuss-gnuradio] Question about latency

2009-04-02 Thread Firas A.

Hi,



Hello everyone, 

I am trying to implement some relaying schemes in gnuradio which require
fast response from 
the relay. I only know how to use flow graphs at the moment so I made my
code with flowgraphs and 
the delay from receiving a packet until I retransmit it is about 10ms. I'm
using USRP1 and the 
sampling rate is 2MSPS and I use the autotransmit capability of USRP. 

First of all I'm trying to understand where the delay comes from. I'm sure
the delay is not due to 
processing time of the packet because the processing is very simple. I don't
know about latencies in 
the kernel though. I read in a paper  that the time it takes for data  to go
from user space to kernel 
is only 200us. 

Secondly I would like to know if using mblocks has any chance of reducing
this delay. By the way is there 
any documentation for the mblocks? 

Thanks
Manolis



1) The following page may be useful:
http://gnuradio.org/trac/wiki/UsrpFAQ/Latency


2) Did you tried to increase sampling rate up to 4MHz ?

3) How did you measured the delay ?


Best Regards,

Firas

-- 
View this message in context: 
http://www.nabble.com/Question-about-latency-tp22824860p22844566.html
Sent from the GnuRadio mailing list archive at Nabble.com.



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


Re: [Discuss-gnuradio] Please help building a signal processing block.

2009-04-02 Thread Mikhail Tadjikov
Thank you all for help/suggestions.

I think I was most successful in implementing it the way Karthik described
it. My code below:
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];

for (int i = 0; i  d_vlen; i++){
temp = in[i] * (i+1);
d_buffer.push_back(temp);
}
for(int j = 0; j  d_vlen; j++) {avg += d_buffer[j]; }

out[0] = avg / d_vlen;
d_buffer.clear();

It seems to work with built-in how to...block test script.  I've tried
putting in a size 512 vector and received an output vector of length 1.

Regards,
Mikhail

P.S. I've attached my code if somebody wants a look.

On Mon, Mar 30, 2009 at 11:56 PM, Eric Blossom e...@comsec.com wrote:

 On Mon, Mar 30, 2009 at 09:17:18AM +0200, Martin Braun wrote:
  On Sat, Mar 28, 2009 at 05:35:59PM -0700, Mikhail Tadjikov wrote:
   Thanks, but I'm trying to get weighted average specifically. I've
 looked at the
   code for moving_average... it's close to what I need, but its 1:1
 in/out ratio,
   but I need N:1 ratio. That's the part I'm particular unclear about.
 
  Since you're turning 1 vector into 1 output value, you could also use a
  gr_sync_block and prepend it with a gr_stream_to_vector. That
  automatically takes care of aligning etc.; if you use a sync_decimator
  you're not guaranteed to get N samples every time.

 Actually, with a sync decimator, you'll get a multiple of N input samples
 every time.

 Eric


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




-- 
Mikhail Tadjikov
Graduate Student
UCLA Department of
Electrical Engineering


cores_weighted_avg_ff.cc
Description: Binary data


cores_weighted_avg_ff.h
Description: Binary data
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Re: Using one USRP

2009-04-02 Thread Michael Dickens

On Apr 1, 2009, at 11:26 PM, William Sherman wrote:

Michael Dickens wrote:

Hi Ali - Check out the following MS thesis, by a ex-colleague of mine
here at ND:

Practical Implementation of a Cognitive Radio System for Dynamic
Spectrum Access

 http://etd.nd.edu/ETD-db/theses/available/etd-07252008-162749/ 



did the person who wrote this thesis write and develop
transmit/receive_path, with this later being incorporated into  
gnuradio,

or the other way around?


Other way around; she just used what was available from GNU Radio at  
the time and modified it to meet her needs. - MLD



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


Re: [Discuss-gnuradio] some posts are missing in gmane.org

2009-04-02 Thread Eric Blossom
On Thu, Apr 02, 2009 at 09:47:33AM +, feldmaus wrote:
 Hi All,
 
 i only want to let you know, that some of the mails
 i posted here are not shown in gmane.org, but in my
 newsreader thunderbird(debian).
 Maybe there is a problem ?
 
 Regards Markus

No clue.  We don't have anything to do with gmane.org.  
They're just a regular subscriber.

Eric


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


[Discuss-gnuradio] benchmark_rx.py in Digital-bert

2009-04-02 Thread yufeng wang
Hi, dear all,

I was trying to using the benchmark_rx.py in the digital-bert file to
receive a BPSK modulated signal from another USRP using
benchmark_tx.py, the problem is that even I did not run the
benchmark_tx.py, I am still receiving sth with benchmark_rx.py, could
anyone explain this to me? or do I have to modify some codes in
benchmark_rx.py? I'm using center frequency of 900 M. Thanks a lot!


-- 
Best wishes,

Yufeng


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


Re: [Discuss-gnuradio] benchmark_rx.py in Digital-bert

2009-04-02 Thread Eric Blossom
On Thu, Apr 02, 2009 at 10:09:19AM -0400, yufeng wang wrote:
 Hi, dear all,
 
 I was trying to using the benchmark_rx.py in the digital-bert file to
 receive a BPSK modulated signal from another USRP using
 benchmark_tx.py, the problem is that even I did not run the
 benchmark_tx.py, I am still receiving sth with benchmark_rx.py, could
 anyone explain this to me? or do I have to modify some codes in
 benchmark_rx.py? I'm using center frequency of 900 M. Thanks a lot!
 
 
 -- 
 Best wishes,
 Yufeng

You're not giving us much to work with.  Please read
http://gnuradio.org/trac/wiki/ReportingErrors
and try again.

Eric


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


Re: [Discuss-gnuradio] Access to history before there is one (Block writing question)

2009-04-02 Thread Jason Uher

 Sorry, no.

 Eric


OK,

Is there a way to distinguish between an uninitialized history (which
seems to be all 0's) and a history whose data is all 0's?

Or perhaps some way that the work function knows this that it is the
first time being called (I am currently kludging it with a class
variable, 'cleared_buffer')

Thanks

Jason


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


Re: [Discuss-gnuradio] Access to history before there is one (Block writing question)

2009-04-02 Thread Eric Blossom
On Thu, Apr 02, 2009 at 09:30:47AM -0500, Jason Uher wrote:
 
  Sorry, no.
 
  Eric
 
 
 OK,
 
 Is there a way to distinguish between an uninitialized history (which
 seems to be all 0's) and a history whose data is all 0's?

No.  0 == 0 :-)

 Or perhaps some way that the work function knows this that it is the
 first time being called (I am currently kludging it with a class
 variable, 'cleared_buffer')

The instance variable should do it.

Eric


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


RE: [Discuss-gnuradio] Question about latency

2009-04-02 Thread Firas Abbas

Hi,

 On Thu, 4/2/09, Matigakis Emmanouil mmatiga...@isc.tuc.gr wrote:

 
 Hello,
 
 I did tried to increase the sampling rate and the delay
 went up to 100ms. I was getting a lot of Uo on the screen though from 
 the program. The block I've made that does the
 
 processing stores the waveform it receives in a file so I can look at it 
 from Matlab.
 
 I think what I'm trying to do is very difficult if at all possible with  
 flowgraphs. So I will  try to use in-band signaling code. Is there  
 something similar to gr-howto-write-a-block for using mbloks?
  
 
 Thanks
 
 Manolis

If you are trying to do just an RF repeater (digitally connecting TX IF and RX 
IF ), I don't think the time is much as 100msec with 4MHz. There is something 
wrong. I suggest to you to use BasicRX and Basic TX in the first.

If you want to measure the delay from end to end , I suggest the following idea 
(I didn't implement and tried it, it just came on my mind while reading your 
email):

Connect the output of Basic TX to the input of basic RX through 20 dB 
attenuator. Start grc, connect a saw tooth signal generator to usrp sink. 
Connect usrp source to oscilloscope graphical sink (channel A). For the same 
scope sink, connect the saw tooth source to its other channel (channel B). You 
should now see two saw tooth signals one that send to TX and the other is the 
received RX. Vary saw tooth frequency and measure the delay between the start 
of these two signals. This will be the end to end latency. Of course it will 
depend you your PC speed and its OS.

Let me know if it works for you.

Best Regards,

Firas



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


Re: [Discuss-gnuradio] Question about latency

2009-04-02 Thread Mattias Kjellsson


Hello everyone, 


I am trying to implement some relaying schemes in gnuradio which require
fast response from 
the relay. I only know how to use flow graphs at the moment so I made my
code with flowgraphs and 
the delay from receiving a packet until I retransmit it is about 10ms. I'm
using USRP1 and the 
sampling rate is 2MSPS and I use the autotransmit capability of USRP. 

First of all I'm trying to understand where the delay comes from. 

Hi,
I'm not entirely sure, but I think there is a sleep in the (FlexRF) 
daughter- board drivers... Try grepping usleep.


BR.
//Mattias


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


[Discuss-gnuradio] BBN 802.11b RSSI output

2009-04-02 Thread Cocuzzo, Daniel C.
Hi,

 

I'm successfully running the demo scripts supplied with the BBN 802.11b
code on USRP1, with typical output:

 

PKT: len=59, rssi=-21, src=00:1f:3c:a5:EF:52, time=1277411936, rate=1
Mbps

PKT: len=42, rssi=-21, src=00:1f:3c:a5:EF:52, time=1277413056, rate=1
Mbps

PKT: len=59, rssi=-24, src=00:1f:3c:a5:EF:52, time=1280761840, rate=1
Mbps

 

I found an earlier (8/3/06) post in the discussion list from a BBN
developer stating :

 

Note that our GNU Radio IEEE 802.11 receive code currently reports
signal strength in dB with respect to an arbitrary baseline. We haven't
yet calibrated this to dBm.

 

Does anyone know if this calibration to dBm was ever implemented? What
units are the RSSI output?

 

Thanks.

Dan

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


[Discuss-gnuradio] Software Communication Architecture (SCA) and GNU Radio

2009-04-02 Thread sheng
Hi,

Basically, SCA and GNU Radio are two different methods to implement SDR. 
However, SCA has CORBA as software bus to add different applications. I am 
thinking if I can treat GNU Radio as non-CORBA modem applications and plug GNU 
Radio into the SCA core framework through a adapter. I think that I need some 
guides at this moment to figure out if this direction is possible. If anyone 
has comments, please tell me!! Thank you so much for your time and help!!!

Sheng



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


Re: [Discuss-gnuradio] NotImplementedError: Wrong number of arguments for overloade

2009-04-02 Thread Johnathan Corgan
On Tue, Mar 31, 2009 at 5:23 AM, Jay Kumar li...@ruby-forum.com wrote:

 I have installed gnuradio-3.1.3 on RHEL4 with i686 architecture.I have
 loaded the firmware in the usrp.But whenever i try to run
 ./usrp_oscope.py  i get the following error:

We have discovered a bug in usrp_oscope.py, but it may be unrelated to
what you are reporting.  Once that is fixed, would you be able to use
the GNU Radio trunk software via Subversion to test if your problem
still exists?

Johnathan


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


[Discuss-gnuradio] Swig Error

2009-04-02 Thread gohar anwar
Hi,
I am getting the following error while running a programme. Programme is fine. 
I have checked it on other PC.
I think there is some thing wrong with the installation of SWIG or else.

Traceback (most recent call last):
  File ./gsm_scan.py, line 21, in module
from gnuradio import usrp
  File /usr/local/lib/python2.5/site-packages/gnuradio/usrp/__init__.py, line 
25, in module
from usrp_swig import *
  File /usr/local/lib/python2.5/site-packages/gnuradio/usrp/usrp_swig.py, 
line 6, in module
import _usrp_swig
ImportError: /usr/local/lib/libgnuradio-usrp.so.0: undefined symbol: 
_ZN7db_base4dbidEv
#

Line 6 is: import _usrp_swig
line 25 is: from usrp_swig import *

I am on Ubuntu 8.10
GNU Radio 3.1.3

Best Regards,
Gohar



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


Re: [Discuss-gnuradio] Difference in gain using gnuradio 3.1.3 and the trunk (at least on RFX1800)

2009-04-02 Thread Johnathan Corgan
On Wed, Apr 1, 2009 at 11:45 PM, Per Zetterberg
per.zetterb...@ee.kth.se wrote:

 I have connected a signal generator to my USRP and I am using a CW. Thus I
 have a constant input power. I am running the usrp_rx_cfile.py utility
 (exact command line below). If I run gnuradio 3.1.3 then the amplitude I see
 is 16dB higher than if compile from the trunk (checked  out a week ago or
 so). I think it has to do with the new daughterboard  code being different
 from the old python one. I am using an RFX1800 daughterboard.

In other words, the magnitude of the samples in the captured .dat
files are different by a factor of 16dB?  Do they otherwise look the
same spectrally?

 The signals are also conjugated with respect to each other

Conjugated, as in a+bi = a-bi , or as in a+bi = b+ai?

Johnathan


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


Re: [Discuss-gnuradio] Swig Error

2009-04-02 Thread Eric Blossom
On Thu, Apr 02, 2009 at 11:02:23AM -0700, gohar anwar wrote:
 Hi,
 I am getting the following error while running a programme. Programme is 
 fine. I have checked it on other PC.
 I think there is some thing wrong with the installation of SWIG or else.
 
 Traceback (most recent call last):
   File ./gsm_scan.py, line 21, in module
 from gnuradio import usrp
   File /usr/local/lib/python2.5/site-packages/gnuradio/usrp/__init__.py, 
 line 25, in module
 from usrp_swig import *
   File /usr/local/lib/python2.5/site-packages/gnuradio/usrp/usrp_swig.py, 
 line 6, in module
 import _usrp_swig
 ImportError: /usr/local/lib/libgnuradio-usrp.so.0: undefined symbol: 
 _ZN7db_base4dbidEv
 #
 
 Line 6 is: import _usrp_swig
 line 25 is: from usrp_swig import *
 
 I am on Ubuntu 8.10
 GNU Radio 3.1.3
 
 Best Regards,
 Gohar
 


  $ c++filt _ZN7db_base4dbidEv
  db_base::dbid()


Given the missing symbol, it appears that at least part of your
installation is from a relatively recent copy of the trunk, since
db_base is part of the C++ daughterboard code.

I suggest that you remove all traces of GNU Radio from /usr/local,
then remake and install a known version (from svn or a tarball).

Eric


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


[Discuss-gnuradio] transmitting from file stored by usrp_rx_cfile.py

2009-04-02 Thread Jaze Dalton
I am trying to transmit from a file stored using usrp_rx_cfile.py (or
usrp_rx_cfile created using usrp_rx_cfile.cc/h).  I have been able to
successfully do this using a usrp_tx_cfile.cc/h program derived from the rx
version.  I can't, however, get similar functionality using python.  I am
new to python, so I am hoping I have just missed some key insight.  I have
listed below the source for my cc and py versions of usrp_tx_cfile and the
associated command line output from the transmit side.  I am running on Mac
OS X with gnuradio code pulled down on Feb 13, 2009.  My daughterboards are
RFX2400 and I am receiving on two other machines with the same USRP set up,
but different hardware and OS (Linux).  I am using usrp_fft and usrp_oscope
on the receiving side.  To test functionality, I stored data on the Mac
using usrp_rx_cfile while running usrp_siggen -f 25 on one of the
other machines.

Also, I noticed that when I use the subdev-gain_min() and
subdev-gain_max() functions, both return 0 instead of correct values.

C++ code is shown below first, followed by the non-working python code.  Any
help is much appreciated!
-Jaze


So, when I compile and run this code, I see the waveform on the receiver:

/*
 * usrp_tx_cfile.cc  - code based on usrp_rx_cfile.cc
 */

#include usrp_tx_cfile.h
#include gr_io_signature.h
#include gr_head.h
#include stdexcept
#include iostream
#include boost/program_options.hpp

namespace po = boost::program_options;

usrp_subdev_spec
str_to_subdev(std::string spec_str)
{
  usrp_subdev_spec spec;
  if(spec_str == A || spec_str == A:0 || spec_str == 0:0) {
spec.side = 0;
spec.subdev = 0;
  }
  else if(spec_str == A:1 || spec_str == 0:1) {
spec.side = 0;
spec.subdev = 1;
  }
  else if(spec_str == B || spec_str == B:0 || spec_str == 1:0) {
spec.side = 1;
spec.subdev = 0;
  }
  else if(spec_str == B:1 || spec_str == 1:1) {
spec.side = 1;
spec.subdev = 1;
  }
  else {
throw std::range_error(Incorrect subdevice specifications.\n);
  }

  return spec;
}


// Shared pointer constructor
usrp_tx_cfile_sptr make_usrp_tx_cfile(int which, usrp_subdev_spec spec,
  int interp, double freq, float gain,
  bool width8, bool nohb,
  bool output_shorts, int nsamples,
  const std::string filename)
{
  return gnuradio::get_initial_sptr(new usrp_tx_cfile(which, spec,
  interp, freq, gain,
  width8, nohb,
  output_shorts,
  nsamples,
  filename));
}

// Hierarchical block constructor, with no inputs or outputs
usrp_tx_cfile::usrp_tx_cfile(int which, usrp_subdev_spec spec,
 int interp, double freq, float gain,
 bool width8, bool nohb,
 bool output_shorts, int nsamples,
 const std::string filename) :
  gr_top_block(usrp_tx_cfile),
  d_which(which),  d_spec(spec), d_interp(interp), d_freq(freq),
  d_gain(gain), d_width8(width8), d_nohb(nohb), d_nsamples(nsamples),
  d_filename(filename)
{
  usrp_sink_c_sptr usrp = usrp_make_sink_c(d_which, d_interp);

  // standard fpga firmware std_2rxhb_2tx.rbf contains
  // 2 Rx paths with halfband filters and 2 tx paths
  //(the default) min decimation 8
  //usrp = usrp_make_source_c(d_which, d_decim);

  /* Get subdevice and process it */
  db_base_sptr subdev = usrp-selected_subdev(d_spec);
  printf(\nSubdevice name is %s\n, subdev-side_and_name().c_str());
  printf(Subdevice freq range: (%g, %g)\n,
 subdev-freq_min(), subdev-freq_max());

  unsigned int mux = usrp-determine_tx_mux_value(d_spec);
  printf(mux: %#08x\n,  mux);
  usrp-set_mux(mux);

  float gain_min = subdev-gain_min();
  float gain_max = subdev-gain_max();
  printf (gain min is %g.  gain max is %g.\n, gain_min, gain_max);
  if(d_gain == -1) {
//d_gain = (gain_min + gain_max)/2.0;
printf(No gain specified.  Setting to max gain.\n);
d_gain = gain_max;
d_gain = 90;
  }
  printf(gain: %g\n, d_gain);
  subdev-set_gain(d_gain);

  float input_rate = usrp-dac_freq() / usrp-interp_rate();
  printf(baseband rate: %g\n,  input_rate);

  /* Set the USRP/dboard frequency */
  usrp_tune_result r;
  //bool ok = usrp-tune(0, subdev, freq, r); //DDC 0
  bool ok = usrp-tune(subdev-which(), subdev, d_freq, r);

  if(!ok) {
throw std::runtime_error(Could not set frequency.);
  }

  subdev-set_enable(true);

  /* The rest */
  d_src = gr_make_file_source(sizeof(gr_complex), d_filename.c_str());



  //if(d_nsamples == -1) {
  connect(d_src, 0, usrp, 0);
  //}
  //else {
  //  d_head = gr_make_head(sizeof(gr_complex), d_nsamples*2);
  //  connect(usrp, 0, d_head, 0);
  //  connect(d_head, 0, d_dst, 0);
  //}
}


int main(int argc, char *argv[])
{
  int which = 0;   // specify which USRP board
  usrp_subdev_spec spec(0,0);  // specify the d'board side
  int 

Re: [Discuss-gnuradio] transmitting from file stored by usrp_rx_cfile.py

2009-04-02 Thread Eric Blossom
On Thu, Apr 02, 2009 at 03:59:22PM -0400, Jaze Dalton wrote:
 I am trying to transmit from a file stored using usrp_rx_cfile.py (or
 usrp_rx_cfile created using usrp_rx_cfile.cc/h).  I have been able to
 successfully do this using a usrp_tx_cfile.cc/h program derived from the rx
 version.  I can't, however, get similar functionality using python.  I am
 new to python, so I am hoping I have just missed some key insight.  I have
 listed below the source for my cc and py versions of usrp_tx_cfile and the
 associated command line output from the transmit side.  I am running on Mac
 OS X with gnuradio code pulled down on Feb 13, 2009.  My daughterboards are
 RFX2400 and I am receiving on two other machines with the same USRP set up,
 but different hardware and OS (Linux).  I am using usrp_fft and usrp_oscope
 on the receiving side.  To test functionality, I stored data on the Mac
 using usrp_rx_cfile while running usrp_siggen -f 25 on one of the
 other machines.
 
 Also, I noticed that when I use the subdev-gain_min() and
 subdev-gain_max() functions, both return 0 instead of correct values.

Those are the right values.  min == max - not adjustable


 C++ code is shown below first, followed by the non-working python code.  Any
 help is much appreciated!
 -Jaze
 
 
 Here is the python version, which doesn't seem to transmit anything:
 
 #!/usr/bin/env python
 
 
 Read samples a file and transmit using USRP
 
 
 
 from gnuradio import gr, eng_notation
 from gnuradio import audio
 from gnuradio import usrp
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
 import sys
 
 class my_top_block(gr.top_block):
 
 def __init__(self):
 gr.top_block.__init__(self)
 
 usage=%prog: [options] output_filename
 parser = OptionParser(option_class=eng_option, usage=usage)
 parser.add_option(-R, --tx-subdev-spec, type=subdev,
 default=(0, 0),
   help=select USRP tx side A or B (default=A))
 parser.add_option(-i, --interp, type=int, default=128,
   help=set fgpa decimation rate to INTERP
 [default=%default])
 parser.add_option(-f, --freq, type=eng_float, default=None,
   help=set frequency to FREQ, metavar=FREQ)
 parser.add_option(-g, --gain, type=eng_float, default=None,
   help=set gain in dB (default is midpoint))
 (options, args) = parser.parse_args ()
 if len(args) != 1:
 parser.print_help()
 raise SystemExit, 1
 filename = args[0]
 
 if options.freq is None:
 parser.print_help()
 sys.stderr.write('You must specify the frequency with -f
 FREQ\n');
 raise SystemExit, 1
 
 # build the graph
 self.u = usrp.sink_c(interp_rate=options.interp)

Try:

 self.u = usrp.sink_c(0, interp_rate=options.interp)
  
Eric


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


[Discuss-gnuradio] Re: gr-howto-write-a-block

2009-04-02 Thread William Sherman
I did not run make install before.

When I ran make install I get the following messages:

curve: [~/Masters/ren_static/gr-howto-ren-3.1.3] % make install
Making install in config
Making install in src
Making install in lib
make  install-am
test -z 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/include/gnuradio
 
|| ../.././install-sh -c -d 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/include/gnuradio
 /usr/bin/install -c -m 644 'howto_square_ff.h' 
'/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/include/gnuradio/howto_square_ff.h'
 /usr/bin/install -c -m 644 'howto_square2_ff.h' 
'/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/include/gnuradio/howto_square2_ff.h'
 /usr/bin/install -c -m 644 'howto_ren_bin_statistics_mean_f.h' 
'/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/include/gnuradio/howto_ren_bin_statistics_mean_f.h'
test -z 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio
 
|| ../.././install-sh -c -d 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c 
'_howto.la' 
'/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio/_howto.la'
libtool: install: /usr/bin/install -c .libs/_howto.so 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio/_howto.so
libtool: install: /usr/bin/install -c .libs/_howto.lai 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio/_howto.la
libtool: install: warning: remember to run `libtool --finish 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3'
make: don't know how to make howto_square_ff.py. Stop

make: stopped in 
/am/state-opera/home1/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/src/lib
*** Error code 2

make install begins to fail here,
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3/lib/python2.5/site-packages/gnuradio/_howto.la
libtool: install: warning: remember to run `libtool --finish 
/u/students/renyu/Masters/ren_static/gr-howto-write-a-block-3.1.3'
make: don't know how to make howto_square_ff.py. Stop

I did not modify howto_square_ff so I am unsure why it is complaining 
that it can't make howto_square_ff.

This warning, install: warning: remember to run `libtool --finish is 
interesting. Googling this it appears to be related with where make 
tries to locate libraries / directory it makes the library to?

Does anyone know why the make install fails and I can't make a new 
block?

Martin Braun wrote:
 On Thu, Apr 02, 2009 at 04:55:39AM +0200, William Sherman wrote:
 However when I run a test program with:
 
 from gnuradio import howto
 
 There's several places where this can go wrong, but my guess is you're
 trying to run the line above in one of your qa_* files through make
 check - right?
 
 If so, change the line to 'import howto', as in the examples. the
 run_tests script will change all the path stuff for you.
 
 Once make check passes, see what 'make install' tells you; all make
 processes are pretty verbose. It might be putting your module in the
 wrong position. To see if that worked, you have to use your 'from
 gnuradio ...' line above.
 
 Hope this is what you were looking for...
 
 MB

-- 
Posted via http://www.ruby-forum.com/.


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


Re: [Discuss-gnuradio] [Douglas Geiger BBN 802.11b] Porting code on USRP2 problems

2009-04-02 Thread Tiago Rogério Mück
Hi all,

I'm trying to port the tx code to the usrp2 based on Colby's branch and i'm
having some problems. The program freezes when the 3rd packet is being sent.

The program uses a gr.message_source to buffer the packets and convert them
into a data flow to the modulator, and the problem is that, for some reason,
the data flow isn't flowing and the packets are accumulating in the
msg_source. Since the msg_source's queue size is 2, the method to add the
3rd packet to the queue blocks because the queue is full.

I didn't figured out whats the problem with my code. The bbn80211b_test.py
woks, so  the problem is probably related to the connection of the modulator
block with the usrp2 sink or to the configuration of the usrp2.

I'm sending the files i have modified.

2009/3/31 Colby Boyer csbo...@berkeley.edu

 Hi all,

 I created a branch on the cgran server for the usrp2 code. If anyone is
 interested in still using the usrp with the hier_block2, just dont use the
 rx/tx.py files. The rest of the files should work with the usrp1.

 Cheers,
 Colby


 On Mon, Mar 30, 2009 at 3:58 PM, George Nychis gnyc...@cmu.edu wrote:

 Hi all,

 CGRAN's trac has a core dumping issue that I still have not figured out
 how to address yet.  So, if you're using the wiki and get blank pages or a
 500 internal server error, sorry.   I've been trying to sort it out, but no
 luck yet:
 http://www.gossamer-threads.com/lists/trac/users/40954

 It should not affect the svn server though.

 - George


 2009/3/30 Colby Boyer csbo...@berkeley.edu

  The cgran server seems to be down. I'll let you know when I am able to
 get an account.

 On Mon, Mar 30, 2009 at 8:36 AM, Colby Boyer colby.bo...@gmail.comwrote:

 Sure. I will try to get a cgran account and upload my code to their SVN.
 It would then be easy to see the changes I made.


 On Mon, Mar 30, 2009 at 2:21 AM, Costantini, Andrea 
 costant...@ftw.atwrote:

 Hi Colby,

 I am glad that I am not the only one trying to port the code.
 I guess you are in a more advanced state. I wasn't even able to run the
 test.py. ;-)

 Would you like to share your modified code (even if it is not
 finished)? so that I try to understand your modifications.

 Best Regards,
 Andrea

 P.S. For the USRP2 api, I usually compare the USRP2 and USRP swig code
 (e.g. usrp2.py and usrp_swig.py).


 Colby Boyer wrote:

 Hi Andrea,

 I am also working to port the 802.11b code to the USRP2. I have
 finished converting the code to hier_block2, and the bbn_80211b_test.py
 script works correctly and it can send packets in simulation. I am 
 currently
 working on modifying the rx, and tx files to connect to the USRP2, but 
 been
 struggling to make progress. I have not had much luck finding any
 documentation for the USRP2 function calls, so I am sorta lost on what to
 change in rx, tx and tx transmit path files. Does anyone have any links 
 to
 the usrp2 api?

 I would be more than happy to share the modifications I made (built
 largly upon Douglas's work) with rest of the GNU radio community.

 Regards,
 Colby Boyer





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




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


#
# Copyright 2005 Free Software Foundation, Inc.
#
# Copyright (c) 2006 BBN Technologies Corp.  All rights reserved.
# Effort sponsored in part by the Defense Advanced Research Projects
# Agency (DARPA) and the Department of the Interior National Business
# Center under agreement number NBCHC050166.
# 
# This file is part of GNU Radio
# 
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# 

from gnuradio import gr, gru, blks2
from gnuradio import usrp2
from bbn_80211b_pkt import *

# /
#  transmit path
# /

class bbn_80211b_transmit_path(gr.hier_block2):
  def __init__(self, interp, spb, use_barker, interface=, mac_addr=None):

gr.hier_block2.__init__(self, bbn_80211b_transmit_path, gr.io_signature(0,0,0), gr.io_signature(0,0,0))

self.normal_gain 

[Discuss-gnuradio] Are these Ramsey modules compatible with the USRP?

2009-04-02 Thread Bahn, William L Ctr USAFA/DFCS
I am considering purchasing the following items from Ramsey Electronics for
use with the USRP and would like some feedback regarding whether they are
compatible. I figure there are probably folks here that have either used
these items or have at least considered them at some point.

The first item is a pre-amplifier: 

http://www.ramseyelectronics.com/cgi-bin/commerce.exe?preadd=actionkey=PR-S
ERIES

My main concern is I don't want to blow out the front end of the USRP. 

The other item is a power amplifier:

http://www.ramseyelectronics.com/cgi-bin/commerce.exe?preadd=actionkey=LPA1

Presently I am planning on using the VERT400 antenna that was purchased
along with the USRP. Does anyone know how much power I can dump into it
safely? I would like to use a better antenna subject to needing to stay
omnidirectional and being limited to a length of less than 18. Any
suggestions?

I'm assuming that I can use the TX/RX output of the Flex400 to drive the RF
amp and one antenna and use a second antenna feeding the pre-amp and then
the RX input of the same Flex400 board. Does this sound reasonable, or am I
overlooking something?

I am cleared to transmit with up to 100W of power centered at 447MHz with up
to 20MHz of signal bandwidth. While I would love to at least get up to 10W,
it looks like my beer budget is more along the lines of 1W. Does anyone know
how to get into the 5W or higher range for under $250 each? I need a pretty
lightweight DC-powered amplifier as this will be mounted in an RC airplane.

TIA




smime.p7s
Description: S/MIME cryptographic signature
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Sanity check - BPSK/FSK and IQ sample stream

2009-04-02 Thread Bahn, William L Ctr USAFA/DFCS
I'm finally getting back to working with the USRP and would like a sanity
check on if I am thinking about something correctly.

Let's say that I want to generate a BPSK signal at a data rate of, say, 1000
bits per second. Is all I have to do is generate an antipodal (+/-V where V
is some constant amplitude) baseband signal at 1000 bps and send that as the
I data (or the Q) and leave the other one all zeros?

Does that result in a BPSK waveform at the carrier frequency? If not, what
does it result in?

If I wanted to do 4PSK, would I just use +/-V on the I and +/-V on the Q as
my four data values thus doubling my data rate for the same sampling rate.
In theory, if I can support 4MSa/s (I/Q samples) across the USB link then I
could get 8Mb/s transmitted. Does this sound right (ignoring issues
associated with receiving and demodulating it)?

What about if I want to do FSK? For example, let's say that I want to use
the frequencies 450MHz +/- 1MHz (so 449MHz and 451MHz). Is there a way to
tune the USRP to a center frequency of 450MHz and send it a corresponding IQ
sample stream? If so, what would that sample stream need to look like? They
way I am presently visualizing it, I would need to tune the USRP to, say,
448MHz and then generate 1MHz and 2MHz waveforms placed on the I (or Q)
leaving the other zero. I suppose I could tune to 449MHz and use a DC value
and a 1 MHz waveform, but that seems like it would result in a pretty good
degree of asymmetry if there weren't very many samples in the bit period.
I'm also concerned about asymmetry in the other case, as well, although it
seems like it would be better. 
 

TIA - Bill




smime.p7s
Description: S/MIME cryptographic signature
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Software Communication Architecture (SCA) and GNU Radio

2009-04-02 Thread Jakub Moskal
Sheng,

are you familiar with OSSIE project (http://ossie.mprg.org) ? It's an
open source SCA implementation and they use USRP as their RF front
end. Perhaps that could be a better place to start. However, I'm not
sure what is your ultimate goal.

Jakub

2009/4/2 sheng sheng...@yahoo.com:
 Hi,

 Basically, SCA and GNU Radio are two different methods to implement SDR.
 However, SCA has CORBA as software bus to add different applications. I am
 thinking if I can treat GNU Radio as non-CORBA modem applications and plug
 GNU Radio into the SCA core framework through a adapter. I think that I need
 some guides at this moment to figure out if this direction is possible. If
 anyone has comments, please tell me!! Thank you so much for your time and
 help!!!

 Sheng


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




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


[Discuss-gnuradio] Re: usrp1 harmonic issue

2009-04-02 Thread Markus Feldmann

Markus Feldmann schrieb:

Eric Blossom schrieb:

On Wed, Apr 01, 2009 at 07:32:04AM +, feldmaus wrote:

Eric Blossom eb at comsec.com writes:


To disable automatic ADC control on all ADC's:

  u.set_dc_offset_cl_enable(0x0, 0xf)

Then set the offset that you want for each ADC using:

  u.set_adc_offset(0, offset0)
  u.set_adc_offset(1, offset1)
  u.set_adc_offset(2, offset2)
  u.set_adc_offset(3, offset3)


And if i only want to diable the automatic dc offset loop at
ADC_0 and ADC_1, then:
u.set_dc_offset_cl_enable(0x3, 0x3)

Is this correct ???


No, you'd want

  u.set_dc_offet_cl_enable(0x0, 0x3)

The mask specifies which of the bits will be touched.  value is the
value you want for those bits.

Hi and thanks for your answer,

but then i didn't understand what you try with,
u.set_adc_offset(0, offset0)
u.set_adc_offset(1, offset1)
u.set_adc_offset(2, offset2)
u.set_adc_offset(3, offset3)

As you wrote above, the mask is the bits you want to touch
and the bits is the value you want to store, but why do you
want to store a value of int(2) and int(3).
As i understand you, there are only 2 logically
values for the bits we store int(0) and int(1).

Is this correct ?

My mistake i mixed up the both methods. :-)

Regards Markus



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


RE: [Discuss-gnuradio] uspr2 working intermittently/segmentation fault

2009-04-02 Thread Pham, Thanh
It seems to run a lot better now after I reinstalled the latest firmware
on the SD Card. 
Thank you. 

Thanh


-Original Message-
From: Eric Blossom [mailto:e...@comsec.com] 
Sent: Wednesday, April 01, 2009 3:15 PM
To: Pham, Thanh
Cc: discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] uspr2 working
intermittently/segmentation fault

On Wed, Apr 01, 2009 at 03:00:57PM -0600, Pham, Thanh wrote:
 Hello, 
 
 I am running gnuradio on a Linux x86_64 box, fedora10. I downloaded
the
 code from the development trunk on 2/26/09.  Lately I notice that my
 uspr2 has been working intermittently.  Sometimes, even running the
 example code would give me a segmentation fault error or errors like
the
 one listed below. 
 
 If I turn the uspr2 off and back on then rerun the program, the
program
 will run again okay.  
 
 Has someone seen this behavior before or had any explanation for why
it
 behaves that way. 
 
 Also, is there a command to reboot/reset the uspr2 instead of turning
 the power off and on? 
 
 Thanks!

It appears that you do not have the current firmware (and possibly
FPGA image) installed on the SD Card.  Please grab the latest from:
http://gnuradio.org/releases/usrp2-bin/trunk/

Eric


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


[Discuss-gnuradio] timestamp counter-extra ticks in 1st frame

2009-04-02 Thread Pham, Thanh
I am using the two lines in the rx_nop_handler.h to print out the
timestamp. 
 printf(W0: %08x  TS: %08x\n, metadata-word0,
metadata-timestamp);
   printf(I0: %08x\n, items[0]);


Looking at the timestamp that was printed out from usrp2_fft.py, I
notice that there is always a few extra ticks in the first frame.
I'm trying to understand why. Does someone have an explanation? Thanks!



TS (hex)TS(decimal) # of ticks in frame
(decim_rate=16)
507c5e551350327893  
507c75941350333844  5951(1st frame has 15 extra ticks,
this number changes with decimation rate but not consistent)
507c8cc41350339780  5936
507ca3f41350345716  5936
507cbb241350351652  5936
507cd2541350357588  5936
507ce9841350363524  5936
507d00b41350369460  5936
507d17e41350375396  5936
507d2f141350381332  5936
507d46441350387268  5936
507d5d741350393204  5936
507d74a41350399140  5936
507d8bd41350405076  5936
507da3041350411012  5936
507dba341350416948  5936
507dd1641350422884  5936
507de8941350428820  5936
507dffc41350434756  5936
507e16f41350440692  5936
507e2e241350446628  5936



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


[Discuss-gnuradio] hier block inside a hier block

2009-04-02 Thread Kieran Brownlees
Hello all,

I am not sure whether this is strange behaviour or I am misunderstanding
what you can do with hier_blocks.

Problem is best described with an example:

from gnuradio import gr
class h_block(gr.hier_block2):
def __init__(self):
gr.hier_block2.__init__(self,
h_block,
gr.io_signature(1,1,gr.sizeof_float),
gr.io_signature(0,0,0))

hblock2 = h_block2()
self.connect(self, hblock2)

class h_block2(gr.hier_block2):
def __init__(self):
gr.hier_block2.__init__(self,
h_block2,
gr.io_signature(1,1,gr.sizeof_float),
gr.io_signature(0,0,0))
self.connect(self, gr.multiply_const_ff(1), gr.null_sink(4))

class temp(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
source = gr.null_source(4)
hblock = h_block()
self.connect(source, hblock)
self.start()

if __name__ == __main__:
app = temp()

When I run the above example I get:

sd...@sdrts:~/sdrts/test$ python gr3.2_test.py
Traceback (most recent call last):
  File gr3.2_test.py, line 29, in module
app = temp()
  File gr3.2_test.py, line 26, in __init__
self.start()
  File
/opt/gnuradio/trunk//lib/python2.5/site-packages/gnuradio/gr/top_block.py,
line 95, in start
self._tb.start()
  File
/opt/gnuradio/trunk//lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py,
line 1411, in start
return _gnuradio_swig_py_runtime.gr_top_block_sptr_start(*args,
**kwargs)
RuntimeError: multiply_const_ff(4): insufficient connected output ports (1
needed, 0 connected)
sd...@sdrts:~/sdrts/test$

There is no error if in h_block2 the connect line is just self.connect(self,
gr.null_sink(4)).

I am running an ubuntu 8.10 server, same output on 3.1.3, 3.2 and trunk.
Thoughts?

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


Re: [Discuss-gnuradio] hier block inside a hier block

2009-04-02 Thread Eric Blossom
On Thu, Apr 02, 2009 at 10:11:38PM -0700, Johnathan Corgan wrote:
 On Thu, 2009-04-02 at 22:05 -0700, Josh Blum wrote:
 
  Im not sure if there is a ticket about this, maybe 
  http://gnuradio.org/trac/ticket/161 is related.
 
 It is related, and the solution to 161 will fix this issue as well.
 
 Johnathan

I just opened ticket:383 on this.  I'm not sure that these are the
same problem.  We definitely need more QA code for this area of the
code.

Eric


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