Code Monkey home page Code Monkey logo

cc2531's People

Contributors

mitshell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cc2531's Issues

LIBUSB_ERROR_PIPE

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 linux can't not find cc2531 dongle

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

CC2531 with Raspberry PI?

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!

Update to pycrate

When will this be updated to use pycrate, which is the replacement of libmich?

CC2531 default firmware

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?

sniffer problem

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: ''

_set_ctrl()

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

LIBUSB_ERROR_TIMEOUT [-7] during "getManufacturer()"

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

Sniffer exits when initializing

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.

ERROR: cannot import python libusb1 wrapper

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.