andrewdodd / ccsniffpiper

ccsniffpiper
GNU General Public License v3.0
91 stars 40 forks source link

Exception in thread #2

Closed marciolm closed 10 years ago

marciolm commented 10 years ago

Hi Andrew I tried to run the sniffer in two Linux machines, one is a RPI with Raspbian and the other is an Ubuntu 14.04 LTS an I got the same error, just after starting the capture:


~/ccsniffpiper$ sudo python ccsniffpiper.py FIFO /tmp/ccsniffpiper exists. Using it Commands: c: Print current RF Channel n: Trigger new pcap header before the next frame h,?: Print this message [11,26]: Change RF channel s: Start/stop the packet capture q: Quit s Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(_self.args, *_self.__kwargs) File "ccsniffpiper.py", line 337, in recv bytesteam = self.dev.read(CC2531.DATA_EP, 4096, 0, CC2531.DATA_TIMEOUT) TypeError: read() takes at most 4 arguments (5 given)


Thanks, Marcio

andrewdodd commented 10 years ago

Hi Marcio,

I think it is to do with the version of pyusb that you have installed. Try changing the line to: bytesteam = self.dev.read(CC2531.DATA_EP, 4096, CC2531.DATA_TIMEOUT)

and let me know how you go.

PS: I'm not going to change this just yet, as I still have an older version of pyusb!

marciolm commented 10 years ago

Dear Andrew, Your patch worked like a charm ! I've applied the same patch in the PyCCsniffer and it also worked. I dont think is a pyusb issue, is more likely a problem with the firmware installed on my "generic" CC2531 dongle (brand Webee). I will try to replace the firmware for the official T.I. firmware later. With the T.I. sniffer I only got malformed packets, but now, with ccsniffpiper + Wireshark, I can decode all the 6lowpan packets ! Thank you, Marcio

andrewdodd commented 10 years ago

Great!

bondjames12 commented 9 years ago

I also had to make this change. Removed the extra argument from usb read function on line 337. I have installed pyusb from https://github.com/walac/pyusb along with libusb-1.0-0 on ubuntu 14.04

I get a stream of this: Received a command response with unknown code - CMD:01 byte:90] Received a command response with unknown code - CMD:01 byte:94] Received a command response with unknown code - CMD:01 byte:98] Received a command response with unknown code - CMD:01 byte:9c] Received a command response with unknown code - CMD:01 byte:a0] Received a command response with unknown code - CMD:01 byte:a4] Received a command response with unknown code - CMD:01 byte:a8] Received a command response with unknown code - CMD:01 byte:ac] Received a command response with unknown code - CMD:01 byte:b0] Received a command response with unknown code - CMD:01 byte:b4] Received a command response with unknown code - CMD:01 byte:b8] Received a command response with unknown code - CMD:01 byte:bc] Received a command response with unknown code - CMD:01 byte:c0] Received a command response with unknown code - CMD:01 byte:c4]

But other then that it seems to work great so far. Thanks for you hard work on this code! Very useful!