Comments (2)
There were other problems related to pyusb 1.0.0b2 as per #24. In the end we fixed the version to 1.0.0b1 because there didn't seem to be a workaround.
from temper-python.
So I just tried that again. Checked out master branch, essentially applied this patch:
diff --git a/setup.py b/setup.py
index ed992b7..24f7220 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ setup(
long_description=open('README.md').read(),
packages=['temperusb'],
install_requires=[
- 'pyusb==1.0.0b1',
+ 'pyusb>=1.0.0b2',
],
entry_points={
'console_scripts': [
diff --git a/temperusb/temper.py b/temperusb/temper.py
index 1e3a8ae..fef30f7 100644
--- a/temperusb/temper.py
+++ b/temperusb/temper.py
@@ -211,7 +211,7 @@ class TemperDevice(object):
"""
Read data from device.
"""
- data = self._device.read(ENDPOINT, REQ_INT_LEN, interface=INTERFACE, timeout=TIMEOUT)
+ data = self._device.read(ENDPOINT, REQ_INT_LEN, timeout=TIMEOUT)
LOGGER.debug('Read data: {0}'.format(data))
return data
Then (in a virtualenv) let setup.py install
run and then
(for i in {1..30} ; do temper-poll 2>&1 | grep -i usberror ; done) | wc -l
8
That yielded 6, 8 and 8 USBErrors for 30 runs over 3 tries.
usb.core.USBError: [Errno None] error sending control message: Broken pipe
Using pyusb 1.0.0b1
(as it is in master now) yielded 7,8 and 7 USBErrors. So after all, no real difference.
Fun fact: Using pyusb 1.0.0b1
I get libusb1
:
$ PYUSB_DEBUG=debug temper-poll 2>&1 | grep "using"
2015-12-22 14:23:37,832 INFO:usb.core:find(): using backend "usb.backend.libusb1"
Using pyusb 1.0.0b2
I get libusb0
:
$ PYUSB_DEBUG=debug temper-poll 2>&1 | grep "using"
2015-12-22 14:24:59,943 INFO:usb.core:find(): using backend "usb.backend.libusb0"
The cause seems to be an error while trying to find symbol libusb_strerror
:
2015-12-22 14:26:19,325 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend
Traceback (most recent call last):
File "build/bdist.linux-armv7l/egg/usb/backend/libusb1.py", line 880, in get_backend
_setup_prototypes(_lib)
File "build/bdist.linux-armv7l/egg/usb/backend/libusb1.py", line 453, in _setup_prototypes
lib.libusb_strerror.argtypes = [c_uint]
File "/usr/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/arm-linux-gnueabihf/libusb-1.0.so.0: undefined symbol: libusb_strerror
2015-12-22 14:26:19,416 ERROR:usb.libloader:'OpenUSB library' could not be found
2015-12-22 14:26:19,418 ERROR:usb.backend.openusb:Error loading OpenUSB backend
2015-12-22 14:26:19,439 INFO:usb.core:find(): using backend "usb.backend.libusb0"
(This is on Raspbian on a Raspberry Pi, Linux 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux)
That - in turn - stems from pyusb 1.0.0b2
trying to use an API in libusb1
that does not seem to be consistently available in all distributions of libusb: https://github.com/walac/pyusb/issues/57
Broken source in 1.0.0b2: https://github.com/walac/pyusb/blob/1.0.0b2/usb/backend/libusb1.py
The change that might have repaired it for us: walac/pyusb@c46563c
I just tried it and the unreleased version 1.0.0rc1 of pyusb does in fact let my case run with libusb1
as backend (same error rate). Have a look at (and test) #40 .
I'll close this issue for now. I guess further discussion is best directed at the pull request.
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)
- New sensor type HOT 2
- 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.