WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2014-Apr-29 05:00:41

yeowl
Member
From: Cyberjaya
Registered: 2012-May-15
Posts: 44

802.11 Reference Design and Python

Try to go through the Python example "print_node_stats.py" and encounter following errors:

Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104

Any idea on what's the problem? Ethernet too slow? No printing STATS.

Offline

 

#2 2014-Apr-29 08:29:48

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: 802.11 Reference Design and Python

Which reference design are you using? 

There have been a number of changes over the last few releases which have changed the contents of the log entries.  This means that you really need to stay in sync with the C code and Python. 

Basically, the since there were no other error messages from the transport, this means that the transaction completed with the node, but the data returned by the node was out of sync with what the Python framework was expecting.

Offline

 

#3 2014-Apr-29 20:04:02

yeowl
Member
From: Cyberjaya
Registered: 2012-May-15
Posts: 44

Re: 802.11 Reference Design and Python

I am using the latest Mango_802.11_RefDes_v0.92_beta.

Last edited by yeowl (2014-Apr-29 20:05:18)

Offline

 

#4 2014-Apr-29 21:42:22

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: 802.11 Reference Design and Python

That is strange.  I ran the example with no issues using the 0.92 beta.

What is your python path set to?  You might be picking up an older version of the framework.

Running Cygwin under windows with the python packages installed, I had the following output when I ran the script after editing it to match my node's serial number:

Code:

mango@mango-ws ~/Mango_802.11_RefDes_v0.92_beta/Mango_802.11_RefDes_v0.92_beta/Python_Reference/examples
$ PYTHONPATH=../ python print_node_stats.py

Initializing experiment

Resetting the network config for all nodes on subnet 10.0.0.
Initializing W3-a-00006 as Node 0
Initializing the time of all nodes on 10.0.0 to: 0.0

Running experiment

-------------------- ----------------------------------- -----------------------------------
                               Number of Packets                   Number of Bytes
ID                   Tx Data  Tx Mgmt  Rx Data  Rx Mgmt  Tx Data  Tx Mgmt  Rx Data  Rx Mgmt
-------------------- -------- -------- -------- -------- -------- -------- -------- --------
40:D8:55:04:21:4A           0        1        0        2        0       40        0       77

-------------------- ----------------------------------- -----------------------------------
                               Number of Packets                   Number of Bytes
ID                   Tx Data  Tx Mgmt  Rx Data  Rx Mgmt  Tx Data  Tx Mgmt  Rx Data  Rx Mgmt
-------------------- -------- -------- -------- -------- -------- -------- -------- --------
40:D8:55:04:21:4A           0        1        0        2        0       40        0       77


Ending experiment


Experiment Finished.

Offline

 

#5 2014-Apr-29 21:57:38

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: 802.11 Reference Design and Python

You can display your wlan_exp package version by opening a Python console (run 'python' at a command prompt), and run:

Code:

import wlan_exp.version
wlan_exp.version.version

The version printed here should match the version of the 802.11 ref design C code and bitstreams you're using. The current version of the package will display 'WLAN Exp v0.9.2'.

Offline

 

#6 2014-Apr-29 22:32:09

yeowl
Member
From: Cyberjaya
Registered: 2012-May-15
Posts: 44

Re: 802.11 Reference Design and Python

Yes, I am getting the "WLAN Exp v0.9.2".

Offline

 

#7 2014-Apr-29 22:59:09

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: 802.11 Reference Design and Python

In the print_node_stats.py script, did you update the NODE_SERIAL_LIST value to match your hardware serial number?

Can you copy/paste exactly what is printed when you run "python print_node_stats.py" ?

Offline

 

#8 2014-Apr-29 23:08:23

yeowl
Member
From: Cyberjaya
Registered: 2012-May-15
Posts: 44

Re: 802.11 Reference Design and Python

Yes, node list is properly defined.

---------------------------------------------------

sudo python ./examples/print_node_stats.py

Initializing experiment

Resetting the network config for all nodes on subnet 10.0.0.
Initializing W3-a-00413 as Node 0
Initializing the time of all nodes on 10.0.0 to: 0.0

Running experiment

Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
Error unpacking TXRX_STATS buffer with len 5200: unpack requires a string argument of length 104
-------------------- ----------------------------------- -----------------------------------
                               Number of Packets                   Number of Bytes           
ID                   Tx Data  Tx Mgmt  Rx Data  Rx Mgmt  Tx Data  Tx Mgmt  Rx Data  Rx Mgmt 
-------------------- -------- -------- -------- -------- -------- -------- -------- --------

Offline

 

#9 2014-Apr-30 09:11:46

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: 802.11 Reference Design and Python

Can you run the following code in your python command prompt and post the entire output?

Code:

import struct
struct.calcsize('Q Q 6s B x Q Q Q I I I I Q Q Q I I I I')

What version of Python are you using? This is displayed when running 'python' on the command line.

And what OS are you using?

Offline

 

#10 2014-May-02 03:33:25

yeowl
Member
From: Cyberjaya
Registered: 2012-May-15
Posts: 44

Re: 802.11 Reference Design and Python

I am using Ubuntu machine.

Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.calcsize('Q Q 6s B x Q Q Q I I I I Q Q Q I I I I')
104

By the way, I have managed to solve this by doing some changes on the python code. I replace the original one with following:
dataTuple = unpack(self.fields_fmt_struct, buffer(buf[index:index+entry_size]))

And also limit the printing to valid host name and mac address used by WARP board.

The strange thing is that I have observed a huge number of MAC addresses which is not actually associated with the WARP AP. I can send you the Ethernet capture file if you want.

Let me know.

Offline

 

#11 2014-May-02 10:34:36

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: 802.11 Reference Design and Python

Interesting.  There must be some subtle difference in slicing between Python 2.7.3 and Python 2.7.5.  Currently we required Python 2.7.5 or later (see "For Python Experts" section) and have not been testing on 2.7.3.   Therefore, we cannot guarantee there will not be other errors like this in the code.  While I understand that Ubuntu 12.04 LTS comes with python 2.7.3, it would be best to locally install a later version and use that for your work with the WLAN Exp framework.

In terms of the large number of MAC addresses in the statistics printing, this is actually a feature that can be configured in the framework.  As part of the statistics collection, by default, we collect "promiscuous statistics".  This means that any packet heard by the node whether from an associated device or not will be logged in the statistics maintained by the node for each device up to MAX_NUM_PROMISC_STATS devices, which is defined in the C code.  If packets from more than MAX_NUM_PROMISC_STATS devices are heard, then the statistic structure with the oldest 'last_timestamp' will be replaced.  If you only want to collect statistics from associated nodes, then you can configure statistics collection using the 'stats_configure_txrx(promisc_stats=False)' node command.

Offline

 

#12 2014-May-06 22:34:24

yeowl
Member
From: Cyberjaya
Registered: 2012-May-15
Posts: 44

Re: 802.11 Reference Design and Python

I try to configure statistics collection using the 'stats_configure_txrx(promisc_stats=False)' as you mentioned but this is not working. I still receive the whole stats including those "hear" STAs.

By the way, there is an error on built-in function "super" and I have a patch to fix this:
https://github.com/chunyeow/warp-80211- … 67a4f38b1f

Offline

 

#13 2014-May-07 08:48:35

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: 802.11 Reference Design and Python

Thanks for pointing out that obvious error. 

Since the node comes up with promiscuous statistics enabled by default, there is a window of time between when the AP/STA comes on-line and when the command is issued to disable promiscuous statistics.  Once promiscuous statistics is turned off, that just disables collection of further statistics, but does not purge any statistics that were collected before the command was issued.  Therefore, what you are seeing are statistics that were collected during that window of time described above (and you should see that the statistics being shown are not updated).  The way to clear these statistics is reset the statistics after you disable promiscuous statistics:

Code:

    # Set the promiscuous statistics
    for node in nodes:
        node.stats_configure_txrx(promisc_stats=False)
        node.reset(txrx_stats=True)

However, doing this uncovered a bug in the way we were resetting the statistics.  If you update the C code to fix this bug and use the above python code (see the updated print_node_stats.py as an example of how to do this; just update PROMISCUOUS_STATISTICS to the value you want), then the example will work like you intend.

NOTE:  There are other changes in wlan_mac_high.c since the last release, so please just modify your copy locally and do not do an SVN update.  This fix will be in the next release.  Thanks for your help.

Offline

 

#14 2015-Feb-25 07:37:09

kanchan
Member
Registered: 2015-Feb-24
Posts: 22

Re: 802.11 Reference Design and Python

hi I am first time trying to implement 802.11 Reference Design,but after doing the program FPGA and setup of python I am not getting what to do next.please help.

following error showing


Initializing experiment

Resetting the network config for all nodes on network 10.0.0.0.
ERROR:  Node W3-a-00548
    Node is not responding.  Please ensure that the
    node is powered on and is properly configured.

I have set IP address of my PC as 10.0.0.250   mask  as 255.255.255.0

Last edited by kanchan (2015-Feb-25 07:44:45)

Offline

 

#15 2015-Feb-25 09:49:26

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: 802.11 Reference Design and Python

Are the WARP v3 node and PC both connected to a gigabit Ethernet switch?

What does the WARP v3 node print on its UART (via the USB-UART interface) when it boots? Does it print anything when you run the Python script?

What version of the reference design are you using?

Offline

 

#16 2015-Mar-10 14:44:15

kanchan
Member
Registered: 2015-Feb-24
Posts: 22

Re: 802.11 Reference Design and Python

hi murphpo,
    sorry for late. I have solved all the problem.it is working correctly

Offline

 

Board footer