mitshell / cc2531 Goto Github PK
View Code? Open in Web Editor NEWIEEE 802.15.4 monitor based on TI CC2531 USB dongles
License: Other
IEEE 802.15.4 monitor based on TI CC2531 USB dongles
License: Other
Good morning,
I'm trying to use the CC2531 with a Beaglebone running Debian for the first time. Previously I used a Beaglebone running Angstrom with the CC2531 with success. Now I'm getting this error and all my efforts to solve it are in vane. Ant help would be very appreciate
root@beaglebone:~/CC2531/CC2531# python ./sniffer.py -c 25
[GPS_reader][ERR] cannot open /dev/ttyUSB0
[CC2531][17168] driving CC2531 USB Dongle @ USB bus 1 & address 2, with serial 17168
Traceback (most recent call last):
File "./sniffer.py", line 255, in
main()
File "./sniffer.py", line 240, in main
ccs = prepare_receiver(chans)
File "./sniffer.py", line 123, in prepare_receiver
ss = [receiver(cc) for cc in ccs]
File "/root/CC2531/CC2531/receiver.py", line 101, in init
self._cc.init()
File "/root/CC2531/CC2531/CC2531.py", line 232, in init
self._set_config(0)
File "/root/CC2531/CC2531/CC2531.py", line 182, in _set_config
ret = self.com.controlWrite(0x00, 9, c, 0, '\0')
File "build/bdist.linux-armv7l/egg/usb1.py", line 1350, in controlWrite
sizeof(data), timeout)
File "build/bdist.linux-armv7l/egg/usb1.py", line 1329, in _controlTransfer
mayRaiseUSBError(result)
File "build/bdist.linux-armv7l/egg/usb1.py", line 133, in mayRaiseUSBError
__raiseUSBError(value)
File "build/bdist.linux-armv7l/egg/usb1.py", line 125, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorPipe: LIBUSB_ERROR_PIPE [-9]
my cc2531 dongle can only use in windows,my linux can't find the driver for cc2531.
i had try to update my kernel configure with ti serial,but i still can't use it in linux
could you give me a firmware of cc2531 used by this project
Hi, I'm trying to use your code on Raspi. I've changed gps.py to use /dev/ttyUSB0 -> /dev/ttyAMA0, but got the following error:
$ python ./sniffer.py -d 3 -p 5 -f
[sniffer] command line arguments:
Namespace(chans=[11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], debug=3, file=True,
filesock=False, gps='/dev/ttyUSB0', ip='localhost', nofcschk=False, period=5.0, silent=False)
[interpreter] server listening on ['localhost', 2154]
[GPS_reader][ERR] cannot open /dev/ttyAMA0
[sniffer] no CC2531 dongles found`
when I do lsusb, it knows the device:
$ lsusb
Bus 001 Device 005: ID 0451:16ae Texas Instruments, Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
however usb-devices says the following:
T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1
P: Vendor=0451 ProdID=16ae Rev=96.62
S: Manufacturer=Texas Instruments
S: Product=CC2531 USB Dongle
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)`
could the Driver=(none) part be a problem? What am I missing? Thanks!
When will this be updated to use pycrate, which is the replacement of libmich?
I already reflashed my CC2531 but I want to try your project. Is it possible to get default firmware to this device? Where can I download it?
Hello mitshell,
it's working better than the last week :)
I just tried your the code, and sometimes I've got this error:
[ERR] (Layer - <class 'libmich.formats.IEEE802154.TI_CC'>) String buffer not long enough for Correl
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/mitshell/CC2531/CC2531/interpreter.py", line 189, in process
self.interpret(frame)
File "/opt/mitshell/CC2531/CC2531/interpreter.py", line 198, in interpret
msg = self._get_tlv(msg)
File "/opt/mitshell/CC2531/CC2531/interpreter.py", line 231, in _get_tlv
self._interpret_TV(T, V)
File "/opt/mitshell/CC2531/CC2531/interpreter.py", line 248, in _interpret_TV
self._interpret_TI_USB(V)
File "/opt/mitshell/CC2531/CC2531/interpreter.py", line 257, in _interpret_TI_USB
usb.map(V)
File "/usr/local/lib/python2.7/dist-packages/libmich/core/element.py", line 1519, in map
self.__map_aligned(string)
File "/usr/local/lib/python2.7/dist-packages/libmich/core/element.py", line 1564, in __map_aligned
e.map(string)
File "/usr/local/lib/python2.7/dist-packages/libmich/core/element.py", line 1519, in map
self.__map_aligned(string)
File "/usr/local/lib/python2.7/dist-packages/libmich/core/element.py", line 1551, in __map_aligned
string = self.__map_to_bitstack(string)
File "/usr/local/lib/python2.7/dist-packages/libmich/core/element.py", line 1600, in __map_to_bitstack
bit_elt.map_bit( int(s_bin[:bit_elt.bit_len()], 2) )
ValueError: invalid literal for int() with base 2: ''
It may not be a bug, but I suspect a copy/paste issue between _get_ctrl() and _set_ctrl().
The method _set_ctrl() in CC2531.py, line 216 is calling libusb with l
as the data
argument. I do not know Python very well, so I am not sure how an integer gets converted into a byte array.
Would you have a pcap capture of the USB transfers when running the Windows application ?
https://github.com/mitshell/CC2531/blob/master/CC2531/CC2531.py#L216
Mitshell,
I'm using Ubuntu 14.10. x64. sniffer.py reports "[CC2531] cannot open USB device through libusb: add yourself in the "root" group or make an udev rule" even running under sudo. I then trace the error detail to libusb1 module and found it was LIBUSB_ERROR_TIMEOUT [-7].
-Dennis
When trying to initialize the sniffer, it exits with the following error:
[GPS_reader][ERR] cannot open /dev/ttyUSB0
[CC2531][17664] driving CC2531 USB Dongle @ USB bus 2 & address 7, with serial 17664
Traceback (most recent call last):
File "CC2531/sniffer.py", line 255, in <module>
main()
File "CC2531/sniffer.py", line 240, in main
ccs = prepare_receiver(chans)
File "CC2531/sniffer.py", line 123, in prepare_receiver
ss = [receiver(cc) for cc in ccs]
File "/home/bram/Progs/CC2531/CC2531/receiver.py", line 101, in __init__
self._cc.init()
File "/home/bram/Progs/CC2531/CC2531/CC2531.py", line 232, in init
self._set_config(0)
File "/home/bram/Progs/CC2531/CC2531/CC2531.py", line 182, in _set_config
ret = self.com.controlWrite(0x00, 9, c, 0, 0)
File "build/bdist.linux-x86_64/egg/usb1.py", line 1307, in controlWrite
TypeError: object of type 'int' has no len()
This is using Python version 2.7.11
, with both libusb and libmich at the latest git version.
Hi,
Kind regards. Getting this error when trying to run sniffer on raspberry pi.
pi@raspberrypi:~/CC2531-master/CC2531-master/CC2531 $ python ./sniffer.py --help
ERROR: cannot import python libusb1 wrapper.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.