Comments (3)
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.
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.
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)
- syntax error on debian buster HOT 7
- Use of Python 3.6 syntax HOT 3
- Update documentation to require Python 3.6+
- ID 0c45:7401 Temperature reading incorrect (TEMPer2V1.4) HOT 2
- New device addition HOT 2
- New release possible? HOT 6
- support for TEMPer2V1.3 request HOT 18
- Pylint? HOT 1
- Sorry, not an issue - adding V1.1 support HOT 4
- Support for TEMPerHumiV1.0 HOT 1
- Port number display is not entirely useful since it isn't guaranteed to be unique HOT 1
- Tag the source HOT 1
- Support for TEMPerGold (1a86:e025) HOT 13
- TEMPer2 not detecting devices HOT 21
- Support for TEMPerGold (3553:a001) HOT 6
- Please do a release with all the fixes from the last 2 years HOT 14
- Support for TEMPerX232 (1a86:5523)
- 0c45:7402 Temperature reading incorrect HOT 15
- No output from temper.py, but no error. HOT 1
- Suggested architecture improvement for supporting new sensors HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from temper-python.