# Can't set tx\_gain and examine result in rx\_ascii\_art\_dft

**URL:** <https://www.ruby-forum.com/t/cant-set-tx-gain-and-examine-result-in-rx-ascii-art-dft/215335>\
**Category:** GNU Radio\
**Created:** [December 31, 2011, 12:25am UTC](https://www.ruby-forum.com/t/cant-set-tx-gain-and-examine-result-in-rx-ascii-art-dft/215335 "2011-12-31T00:25:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 31, 2011, 12:25am UTC](https://www.ruby-forum.com/t/cant-set-tx-gain-and-examine-result-in-rx-ascii-art-dft/215335/1 "2011-12-31T00:25:23Z")

</div>

I try to change code from benchmark-rate.cpp to a transmitter program,  
and examine the result of transmission by rx\_ascii\_art\_dft.cpp

I have set up newest version of uhd/gnuradio with usrp2

I can find them and probe them and execute the benchmark program  
correctly.

But I get a problem when I try to start edit my own program.  
(actually I try to change it from benchmark-rate)

-------------- in TX part -----------------------  
What I change as shown follow :  
double TX\_RATE = 8000000;  
double TX\_FREQ = 2450000000;  
double TX\_GAIN = 5;  
usrp-\>set\_tx\_rate(TX\_RATE);  
usrp-\>set\_tx\_freq(TX\_FREQ);  
usrp-\>set\_tx\_gain(TX\_GAIN);

boost::this\_thread::sleep(boost::posix\_time::seconds(2));  
std::cout\<\<“final setting = (rate,freq,gain) \n =  
(”\<get\_tx\_rate()\<\<", “\<get\_tx\_freq()\<\<”,  
“\<get\_tx\_gain()\<\<”)"\<\<std::endl;

-------------- in RX part ------------------------  
and examine the result by running  
./rx\_ascii\_art\_dft --rate 8000000 --freq 2450000000 --gain 50

As a result, the rx shows nothing(I think it will show a peak in freq  
2.45GHz but it does not /\_)

On the other side, the dump info in tx telling me that usrp-get\_tx\_gain  
returns value of 0!!!

It is so strange~!!

Can anyone help me to figure it out~?  
It is my first time using UHD and gnuradio…  
I have spent a whole week to set them up, but it is still so hard to me  
to write program on it T\_T~

---

<div class="post-metadata">

**Author:** ![lucy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e47774/32.png) [@lucy](https://www.ruby-forum.com/u/lucy)\
**Post date:** [December 31, 2011, 12:29am UTC](https://www.ruby-forum.com/t/cant-set-tx-gain-and-examine-result-in-rx-ascii-art-dft/215335/2 "2011-12-31T00:29:37Z")

</div>

By the way, the dump result of tx is :  
UHD Warning:  
The hardware does not support the requested TX sample rate:  
Target sample rate: 8.000000 MSps  
Actual sample rate: 7.692308 MSps  
final setting = (rate,freq,gain)  
= (7.69231e+06, 2.45e+09, 0)  
Testing transmit rate 7.692308 Msps

and it remains send samples as benchmark-rate.cpp do until the timeout  
and interrupt.

Do anyone have any idea?~

Thanks
