monk-dot / killerbee

Automatically exported from code.google.com/p/killerbee
0 stars 1 forks source link

zbscapy 'operation timed out' after initial packet send #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using zbsend it is possible to transmit a single packet.  Subsequent packet 
transmission returns a USB timeout error.

What steps will reproduce the problem?
$ sudo zbscapy
>>> p = Dot15d4()
>>> kbsendp(p) # OK
>>> kbsendp(p) # NOT OK

What is the expected output? What do you see instead?
>>> mypkt
<Dot15d4  fcf_frametype=Command |<Dot15d4Cmd  cmd_id=AssocReq |>>
>>> kbsendp(mypkt)
.
Sent 1 packets.
>>> kbsendp(mypkt)
DEBUG: Received operation timed out error ...attempting to continue.
Exception usb.core.USBError: USBError(19, 'No such device (it may have been 
disconnected)') in <bound method Device.__del__ of <usb.core.Device object at 
0xa4400ac>> ignored
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/killerbee/scapy_extensions.py", line 119, in kbsendp
    kb.set_channel(channel)
  File "/usr/local/lib/python2.7/dist-packages/killerbee/__init__.py", line 249, in set_channel
    self.driver.set_channel(channel)
  File "/usr/local/lib/python2.7/dist-packages/killerbee/dev_rzusbstick.py", line 375, in set_channel
    self._set_mode(RZ_CMD_MODE_AC)
  File "/usr/local/lib/python2.7/dist-packages/killerbee/dev_rzusbstick.py", line 291, in _set_mode
    self.__usb_write(RZ_USB_COMMAND_EP, [RZ_CMD_SET_MODE, mode])
  File "/usr/local/lib/python2.7/dist-packages/killerbee/dev_rzusbstick.py", line 276, in __usb_write
    if response != RZ_RESP_SUCCESS:
UnboundLocalError: local variable 'response' referenced before assignment
>>> 

Original issue reported on code.google.com by joshandr...@gmail.com on 29 Jun 2014 at 10:21

GoogleCodeExporter commented 9 years ago
zbscapy should be used after declaring a single KillerBee() instance variable, 
passed as the iface parameter to kbsendp(), kbsniff() and other Scapy-like 
functions:

# zbscapy
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.2.0-dev)
KillerBee Extension v0.6
>>> kb = KillerBee()
Warning: You are using pyUSB 1.x, support is in beta.
>>> kbsendp(Dot15d4()/Dot15d4Cmd(cmd_id=5),iface=kb)
.
Sent 1 packets.
>>> kbsendp(Dot15d4()/Dot15d4Cmd(cmd_id=5),iface=kb)
.
Sent 1 packets.
>>> kbsendp(Dot15d4()/Dot15d4Cmd(cmd_id=5),iface=kb)
.
Sent 1 packets.
>>> 

Original comment by joshandr...@gmail.com on 30 Jun 2014 at 7:21