WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2016-Jun-06 16:04:42

cancub
Member
Registered: 2015-Mar-06
Posts: 56

wlan_exp: problems with package code

Using two WARPs on stock 1.5.1, one as AP, one as STA, one associated with the other.

With wlan_exp, I can perform the blinking LEDs example and I can connect using the interactive node example, but any attempt to retrieve info from the WARP boards is met with an error. I can indeed see uplink and downlink traffic between my PC and the WARPs over my eth0 port.

When using the interactive_node.py file and then running the command

    nodes[0].get_bss_info()

The result is

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/node.py", line 2183, in get_network_list
    return self.send_cmd(cmds.NodeGetBSSInfo("ALL"))
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/transport/node.py", line 349, in send_cmd
    return cmd.process_resp(resp)
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/cmds.py", line 1671, in process_resp
    ret_val = info.deserialize_info_buffer(data[index:], "BSSInfo()")
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/info.py", line 868, in deserialize_info_buffer
    tmp_obj.deserialize(buffer[index:index+object_size])
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/info.py", line 657, in deserialize
    super(BSSInfo, self).deserialize(buf)
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/info.py", line 363, in deserialize
    print("Error unpacking {0} buffer with len {1}: {2}".format(self.name, len(buf), err))
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/info.py", line 390, in __getattr__
    super(InfoStruct, self).__getattr__(name)
AttributeError: 'super' object has no attribute '__getattr__'

Of note here is that both nodes were shown to be initialized by wlan_exp. Meanwhile, when attempting to run the throughput_two_nodes.py example, I get the following printout

Resetting the network config for all nodes on network 10.0.0.0.
Initializing W3-a-00662
Initializing W3-a-00324
Traceback (most recent call last):
  File "throughput_two_nodes.py", line 95, in <module>
    node1.configure_bss(ssid=SSID, channel=CHANNEL, beacon_interval=BEACON_INTERVAL)
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/node_ap.py", line 90, in configure_bss
    beacon_interval=beacon_interval, ht_capable=ht_capable))
  File "/usr/local/lib/python2.7/dist-packages/mango_wlan_exp-1.5.1-py2.7.egg/wlan_exp/cmds.py", line 1576, in __init__
    arg = struct.unpack_from('!I', data_buf[idx:idx+4])
TypeError: unpack_from() argument 1 must be string or read-only buffer, not bytearray



Any idea what might be going on. Is there a library that I'm missing?

Offline

 

#2 2016-Jun-06 16:34:33

cancub
Member
Registered: 2015-Mar-06
Posts: 56

Re: wlan_exp: problems with package code

I should mention that this is on a machine running Ubuntu 12.04 and that running the same tests on a Windows 7 machine does not result in any errors.

Offline

 

#3 2016-Jun-06 22:54:11

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

Re: wlan_exp: problems with package code

That's the sort of error we sometimes see when we overlook a Python 2/3 incompatibility. We fixed all known compatibilities in 1.5.1. What version of Python is on the Linux machine?

I notice that you're running wlan_exp via an installed .egg in dist-packages. We have not extensively tested the pip/wheel installation support for the wlan_exp package. We typically use (and recommend others use) wlan_exp by updating the PYTHONPATH environment variable to point at the Python_Reference folder in an extracted reference design .zip file. Any chance running wlan_exp this way fixes the issue above?

Offline

 

#4 2016-Jun-07 09:49:50

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

Re: wlan_exp: problems with package code

After some more Googling, I suspect the problem is an old version of Python on your Ubuntu 12.04 machine. I think the default Python for that OS is 2.7.3. This post highlights a similar issue with struct.unpack() on Python <= 2.7.3. We have not tested wlan_exp with any Python older than 2.7.5. Try updating the Python on your Linux box. Alternatively you can probably use a local Anaconda Python install without changing the OS's default Python.

Offline

 

#5 2016-Jun-07 13:37:18

cancub
Member
Registered: 2015-Mar-06
Posts: 56

Re: wlan_exp: problems with package code

Sorry for the late reply. Testing with Anaconda -- as recommended in the docs -- does indeed produce the desired results after adding the proper wlan_exp directory to the PYTHONPATH. Additionally, it looks like it was an issue with python versioning. Updating to 2.7.11 as well as adding the Python_Reference directory to all .bashrc files appears to have done the trick for running wlan_exp examples in a terminal.

Cool. Thanks for your help, Patrick.

Offline

 

Board footer