Help using UCLA Zigbee PHY examples updated for UHD

Hello all,

I have been trying for some time now to run your code
uhd_cc2420_rxtest.py with little success on USRP N200. I am using
gnuradio 3.5 and Ubuntu 11.10. I get the messages and error below:
[email protected]:~/gr-ieee802-15-4/src/examples$
./uhd_cc2420_rxtest.py
linux; GNU C++ version 4.5.2; Boost_104200;
UHD_003.003.000-25f0bd5
cordic_freq = 2.475G
data_rate = 2M
samples_per_symbol = 2
– Opening a USRP2/N-Series device…
– Current recv frame size: 1472 bytes
– Current send frame size: 1472 bytes
Center frequency: 2475000000
>>> gr_fir_fff: using SSE
Traceback (most recent call last):
File “./uhd_cc2420_rxtest.py”, line 122, in
main ()
File “./uhd_cc2420_rxtest.py”, line 109, in main
tb = oqpsk_rx_graph(options, rx_callback)
File “./uhd_cc2420_rxtest.py”, line 67, in init
threshold=-1)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/ucla_blks/ieee802_15_4_pkt.py”,
line 241, in init
self._watcher = _queue_watcher_thread(self._rcvd_pktq,
self.callback, self.chan_num)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py”,
line 50, in getattr
return getattr(self._hb, name)
AttributeError: ‘gr_hier_block2_sptr’ object has no attribute
‘chan_num’

Has anyone successfully run this on USRP N200 instead of N210? The file
I am running is attached.
Hope to have help soon

File 

“/usr/local/lib/python2.7/dist-packages/gnuradio/ucla_blks/ieee802_15_4_pkt.py”,
line 241, in init

self._watcher = _queue_watcher_thread(self._rcvd_pktq, self.callback, 

self.chan_num)

 File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", 

line 50, in getattr

return getattr(self._hb, name)

AttributeError: ‘gr_hier_block2_sptr’ object has no attribute ‘chan_num’

Looks like a pretty strait forward error. There is no chan_num
attribute. So what class is “self” and why is it missing chan_num? How
does chan_num get initialized?

Perhaps there is a command line option you are not passing, and there
isnt any input checking/sanitation, so the error falls all the way
through to this part of the code.

-josh

Henry, If you are able to update this code for UHD, please consider
committing your changes to CGRAN so others don’t have to go through the
same process :slight_smile:

https://www.cgran.org/wiki/UCLAZigBee

Hello Josh,

I realized that the error was coming from this loop in
ieee802_15_4_pkt.py

try:

            self.callback =kwargs.pop('callback')

            self.threshold =kwargs.pop('threshold')

            self.chan_num=kwargs.pop('channel')

except KeyError:

pass

so I changed self.chan_num=kwargs.pop(‘channel’)

to self.chan_num=kwargs.get(‘channel’)

It seems to be working now with

Statistics : good 0 received 0

I hope I have not messed anything else in ieee802_15_4_pkt.py.

Respectfully,

Henry Ernest Baidoo-Williams.

GRA, University of Iowa

Hi Josh,
I do not think there is a command line input for any channel line. The
input parameters are these;
[email protected]:~/gr-ieee802-15-4/src/examples$ sudo
./uhd_cc2420_rxtest.py --help
linux; GNU C++ version 4.5.2; Boost_104200; UHD_003.003.000-25f0bd5

Usage: uhd_cc2420_rxtest.py [options]

Options:
-h, --help show this help message and exit
-a ADDRESS, --address=ADDRESS
Address of UHD device,
[default=addr=192.168.10.2]
-A ANTENNA, --antenna=ANTENNA
select Rx Antenna where appropriate
-c FREQ, --cordic-freq=FREQ
set rx cordic frequency to FREQ
-r DATA_RATE, --data_rate=DATA_RATE
-f FILENAME, --filename=FILENAME
write data to FILENAME
-g GAIN, --gain=GAIN set Rx PGA gain in dB [0,20]

If I run the script with parameters, I still get the same error

[email protected]:~/gr-ieee802-15-4/src/examples$ sudo
./uhd_cc2420_rxtest.py -c 2.45e9 -g 20
linux; GNU C++ version 4.5.2; Boost_104200; UHD_003.003.000-25f0bd5

cordic_freq = 2.45G
data_rate = 2M
samples_per_symbol = 2
– Opening a USRP2/N-Series device…
– Current recv frame size: 1472 bytes
– Current send frame size: 1472 bytes
Center frequency: 2450000000

gr_fir_fff: using SSE
Traceback (most recent call last):
File “./uhd_cc2420_rxtest.py”, line 122, in
main ()
File “./uhd_cc2420_rxtest.py”, line 109, in main
tb = oqpsk_rx_graph(options, rx_callback)
File “./uhd_cc2420_rxtest.py”, line 67, in init
threshold=-1)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/ucla_blks/ieee802_15_4_pkt.py”,
line 241, in init
self._watcher = _queue_watcher_thread(self._rcvd_pktq,
self.callback, self.chan_num)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py”,
line 50, in getattr
return getattr(self._hb, name)
AttributeError: ‘gr_hier_block2_sptr’ object has no attribute
‘chan_num’

Also there is no parameter chan_num in the python script. I am also
assuming the error is not emanating from the UCLA zigbee PHY since
others have successfully used it and besides the same script worked on
the USRP N210 as was posted on the mailing list.