Coder Social home page Coder Social logo

cp2130's Issues

PyUSB

Great library!

For me to get it to work I had to change the order of imports in __init (https://github.com/drbild/cp2130/blob/master/cp2130/__init__.py#32) as the usb import did not raise an exception, but it then failed with LIBUSB_ERROR_NOT_SUPPORTED [-12] error. However import pyusb first worked well

I also had to remove the call to is_kernel_driver_active in https://github.com/drbild/cp2130/blob/master/cp2130/usb/pyusb.py as it was marked as NotImplemented.

I have pyusb 1.2.1 installed. (import usb, usn._version.version)

OSError: [WinError 126] The specified module could not be found

The code run fail right at the 3rd line "chip = cp2130.find()"
Below is all the log. I tried to disable "libusb1" to force it use "pyusb" but also failed to detect device.

I check the connection with hardware is OK. I also could see the SPI device in the device manager. I used the verified Application for my HW to check the SPI communication with HW, and everything is OK.

BTW, I'm using Windows 8 and python 3.6.2.

Traceback (most recent call last):
  File "31-cp2130.py", line 6, in <module>
    chip = cp2130.find()
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\cp2130\__init__.py", line 32, in find
    from cp2130.usb import libusb1 as usb
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\cp2130\usb\libusb1\__init__.py", line 17, in <module>
    from cp2130.usb.libusb1.core import *
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\cp2130\usb\libusb1\core.py", line 18, in <module>
    from cp2130.usb.libusb1.hotplug import HotplugListener, HotpluggedDevice
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\cp2130\usb\libusb1\hotplug.py", line 19, in <module>
    import usb1
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\usb1\__init__.py", line 61, in <module>
    from . import libusb1
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\usb1\libusb1.py", line 199, in <module>
    libusb = _loadLibrary()
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\usb1\libusb1.py", line 173, in _loadLibrary
    return dll_loader('libusb-1.0' + suffix, **loader_kw)
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python36-32\lib\ctypes\__i
nit__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

Help

Hi, I am using cp2130 now. A questions, the document say to configure the pin's mode (gpio, usb, spi) need a site-software named "XPRESS CONFIGURATOR", I did not know that means I must use "XPRESS CONFIGURATOR"? Can I configure it by codeing with the api? (with out XPRESS CONFIGURATOR)

Typo / Bug in spi.py

Thanks for writing and sharing such a useful python package. I just found a bug in the spi.py file.

There is an typo in the method "write" in the SPIChannel class. Lines 92 and 93 are

    op = lambda: self.chip.write(data)
    return self._do(op, data)

And, line 93 should be

    return self._do(op, cs_hold)

Cheers,
SaeWoo

array.array.to_string is deprecated in python 3 and removed in 3.9

The straightforward fix would simply be to use to_bytes instead, although this would break backwards compatibility with python 2. However, since python 2 hasn't been supported in four years, I don't think that should be a problem.

Seems this was noticed a while back and a PR was opened here. #5.
I'm quite happy to make this change myself.

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.