Giter VIP home page Giter VIP logo

Comments (3)

jussihirvi avatar jussihirvi commented on August 19, 2024

Same here. I am on CentOS 6. I found no python-usb package from my yum repositories, so I installed pyusb from source (SourceForge). But this did not affect the error I get when I try to run temper-poll.

from temper-python.

amorphic avatar amorphic commented on August 19, 2024

I have the same problem using temperusb 1.1.2 installed from PyPi. An old version (0.2) discovers devices fine but using 1.1.2 I get the ValueError above.

from temper-python.

amorphic avatar amorphic commented on August 19, 2024

This issue is caused by line 38 in temper.py:

37  bus_id = int(bus.dirname)

bus is a parameter to TemperDevice(). It is generated like this:

156         busses = usb.busses()
157         self._devices = []
158         for bus in busses:
159             self._devices.extend([TemperDevice(x, bus) for x in bus.devices if (x.idVendor,x.idProduct) in VIDPIDs])

However on the linux distros that I've tested (CentOS 6.x, Ubunto 13.04, Debian Wheezy) the values returned by the generator usb.busses() look like this:

{'dirname': '', 'location': 0, 'devices': [<usb.legacy.Device object at 0xb664a68c>, <usb.legacy.Device object at 0xb664a70c>, <usb.legacy.Device object at 0xb664a76c>, <usb.legacy.Device object at 0xb664a7cc>]}
{'dirname': '', 'location': 0, 'devices': [<usb.legacy.Device object at 0xb663fd6c>]}
{'dirname': '', 'location': 0, 'devices': [<usb.legacy.Device object at 0xb663f94c>]}

Notice that dirname is an empty string? So as far as I can see, this will always throw a ValueError when cast to an int.

I'm not sure why the bus object need be passed as a parameter to TemperDevice() at all. The device object being passed already contains a bus member which is apparently an integer defining the bus number.

The TemperDevice() class also defines a get_bus() method which is never actually called.

All of this was part of PR #2 in an attempt to identify individual devices for calibration purposes. I'll take a look and see if I can't get this tidied up and working again.

from temper-python.

Related Issues (20)

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.