Rx and Tx on same antenna

Hello,

I’m starting to play around with gnuradio and the USRP1. I have the
RFX400 daughterboard but only one antenna. I used the examples
usrp_wfm_rcv.py and usrp_nbfm_rcv.py for testing and it worked (I only
had to change the center frequencies for the use with the FRX400). For
emitting I used gnuradio-companion and the WBFM transmit block that also
worked fine. Now, I’m trying to set up a transceiver that uses for both
the receive and emit path the TX/RX antenna of the RFX400. I made a
first (simple) flowgraph using different classes for the Rx and Tx paths
(classes copied from working grc flowgraphs). I used the same parameters
than for the receiver and emitter alone but I set the transmit parameter
of the USRP sink to Auto T/R. Now, my plan is to remain in the reception
mode all the time and to switch to transmission mode only if I want to
speak. In order to do this, I added this code to my python script:

if name == ‘main’:
parser = OptionParser(option_class=eng_option, usage="%prog:
[options]")
(options, args) = parser.parse_args()
tr = usrp_wbfm_receive_nogui()
tt = usrp_wbfm_emit_rfx400()
while 1:
tr.start()
raw_input('Press Enter to emit: ')
tr.stop()
tt.start()
raw_input('Press Enter to stop emitting ')
tt.stop()

And both the reception and transmission seem to work in first place. But
if I press Enter the second time, I get this error message:

RuntimeError: top_block::start: top block already running or wait() not
called after previous stop()

Assuming that it’s impossible to restart a block after stopping it
without executing the wait() call, I added tr.wait() and tt.wait() after
the respective stop calls. But then I get another error message:

audio_alsa_sink[plughw:0,0]: snd_pcm_hw_params failed: File descriptor
in bad state
RuntimeError: check topology failed on audio_alsa_sink(1) using
ninputs=1, noutputs=0

It seems to be linked to the fact that the alsa driver won’t switch back
to it’s receive config after the transmission. Is there a possibility to
make my script work or am I doing it all the wrong way?

Thanks for your help

Mirko

PS: I’ve joined the complete code to show the context of my script

On Thu, May 20, 2010 at 02:46:38PM +0200, Mirko Heukemes wrote:

different classes for the Rx and Tx paths (classes copied from
tr = usrp_wbfm_receive_nogui()
But if I press Enter the second time, I get this error message:

RuntimeError: top_block::start: top block already running or wait()
not called after previous stop()

Assuming that it’s impossible to restart a block after stopping it
without executing the wait() call, I added tr.wait() and tt.wait()
after the respective stop calls. But then I get another error
message:

Hi Mirko,

I haven’t read your code (excuse my laziness), but here’s some input:
You can’t stop and restart a flow graph (just recently, there was a
similar discussion on this topic). Once it’s stopped, its state is
undefined. You need two separate flow graphs for Tx and Rx. If you want
them both in one application, you will have to put them both into one
top_block (see the Python-Applications tutorial on the wiki, it also
happens in usrp_nbfm_ptt.py). Also, tunnel.py by default manages to tx
and rx on one antenna by using the auto-tr feature which you’ve already
discovered.
Hope this is useful,

MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-3790
Fax: +49 721 608-6071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Am 21.05.2010 10:12, schrieb Martin B.:

transceiver that uses for both the receive and emit path the TX/RX
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")

discovered.
Hope this is useful,

MB

Hello,

Thank you for pointing me to the usrp_nbfm_ptt.py, that is exeactly what
I was looking for and it gave me some good insight on how to implement a
radio with only one antenna.

Best regards

Mirko