You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
|
2008 |
Jan
(1) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(8) |
Jun
(4) |
Jul
|
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
(20) |
2009 |
Jan
(16) |
Feb
(7) |
Mar
(9) |
Apr
(4) |
May
(6) |
Jun
(17) |
Jul
(3) |
Aug
(4) |
Sep
(5) |
Oct
(10) |
Nov
(16) |
Dec
|
2010 |
Jan
(22) |
Feb
(18) |
Mar
(9) |
Apr
(102) |
May
(29) |
Jun
(40) |
Jul
(80) |
Aug
(21) |
Sep
(47) |
Oct
(13) |
Nov
(19) |
Dec
(45) |
2011 |
Jan
(82) |
Feb
(20) |
Mar
(47) |
Apr
(25) |
May
(18) |
Jun
(24) |
Jul
(24) |
Aug
(47) |
Sep
(23) |
Oct
(22) |
Nov
(69) |
Dec
(20) |
2012 |
Jan
(56) |
Feb
(42) |
Mar
(43) |
Apr
(27) |
May
(18) |
Jun
(11) |
Jul
(61) |
Aug
(19) |
Sep
(13) |
Oct
(49) |
Nov
(32) |
Dec
(37) |
2013 |
Jan
(46) |
Feb
(14) |
Mar
(13) |
Apr
(20) |
May
(20) |
Jun
(3) |
Jul
(19) |
Aug
(7) |
Sep
(4) |
Oct
(33) |
Nov
(7) |
Dec
(15) |
2014 |
Jan
(5) |
Feb
(21) |
Mar
(3) |
Apr
(3) |
May
(30) |
Jun
(1) |
Jul
(30) |
Aug
(2) |
Sep
(22) |
Oct
(14) |
Nov
(22) |
Dec
(6) |
2015 |
Jan
(7) |
Feb
(4) |
Mar
(16) |
Apr
(9) |
May
(17) |
Jun
(28) |
Jul
(3) |
Aug
(18) |
Sep
(3) |
Oct
|
Nov
(6) |
Dec
(3) |
2016 |
Jan
(15) |
Feb
(18) |
Mar
(12) |
Apr
(14) |
May
(15) |
Jun
(3) |
Jul
(3) |
Aug
(42) |
Sep
(24) |
Oct
(6) |
Nov
(5) |
Dec
(6) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(12) |
Apr
|
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(5) |
Dec
(7) |
2018 |
Jan
|
Feb
(9) |
Mar
(7) |
Apr
|
May
(10) |
Jun
(20) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(20) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
(8) |
Dec
(2) |
2021 |
Jan
(16) |
Feb
(1) |
Mar
|
Apr
(9) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2022 |
Jan
|
Feb
(7) |
Mar
|
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jay N. <ja...@ne...> - 2015-06-19 01:54:45
|
Ok, I have a new problem. I am using libusb-win32-bin-1.2.6.0. I am using the libusb0.dll and libusb0.sys. I am communicating to a ZebraKR403 printer checking for the status. On my dev PC this is working and I have packaged my program with py2exe and installed it on my first target PC along with the libusb-win32-bin-1.2.6.0 and it is working fine. On my second PC I am getting an error when the program runs. Traceback (most recent call last): File "ZebraKR403PaperStatus1.0.py", line 1, in <module> File "usb\__init__.pyc", line 97, in <module> File "usb\legacy.pyc", line 29, in <module> File "usb\core.pyc", line 50, in <module> ImportError: No module named _objfinalizer The only difference between the PC's is the windows OS, both Windows 7, one 64 bit and the one not working is 32 bit. The exe package was created on a 32 bit machine with py2exe. Any idea? Jay |
From: Wander L. C. <wan...@gm...> - 2015-06-18 12:30:03
|
2015-06-17 5:11 GMT-03:00 Hermann Hamann <her...@we...>: > > I want to suggest a small change to pyusb to improve speed. > Currently you can only provide an array.array buffer to put the USB data > into. > I use the multiprocessing feature and the final destination of the USB data > is a mmap.mmap > Object. I would like to specify this as a receive buffer to save a pickle > and > unpickle operation. > It is not so difficult to use the pyapi.PyObject_GetBuffer function to > retrieve address and length > of any buffer protocol compliant object. > So this array restriction should be lifted, I assume there are more users > who would > appreciate this change. I would not like to distribute my software with a > modified pyusb. > Sincerely > Hermann Hamann > > Here follows the modifications I made: > ----------------------------------------- > # in backend1.py, similar for other backends > from ctypes import * > from struct import unpack > getBuffer = pythonapi.PyObject_GetBuffer > getBuffer.argtypes = [py_object, c_void_p, c_int] > view = create_string_buffer(11*sizeof(int)) > def getBufferInfo(someObject): > pointer_to_sO = py_object(someObject) > result = getBuffer(pointer_to_sO,view,1) # flag writeable > ### this call can raise an Exception. However this would be a > consequence > ### of an invalid caller, so no recovery is possible and simply let it > ### crash, the message is helpful. > > if result != 0 : return None,None > > bufadr,objadr,buflen,itemsize,readonly,ndim,bformat,shape,strides,\ > suboffsets,internal = unpack("11I",view) > > result = pythonapi.PyBuffer_Release(string_buffer) > return (bufadr,buflen) > > # and some lines later > def __read(self, fn, dev_handle, ep, intf, buff, timeout): > ### !!!! changed address, length = buff.buffer_info() > address,length = getBufferInfo(buff) > ##length *= buff.itemsize changed > > ---------------------------------- > # in core.py > if isinstance(size_or_buffer,int): > Hi, Could you please open a Pull Request or, if you are not willing to supply a patch, an issue detailing your proposal? -- Best Regards, Wander Lairson Costa |
From: Hermann H. <her...@we...> - 2015-06-17 08:11:48
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div> </div> <div>I want to suggest a small change to pyusb to improve speed.</div> <div>Currently you can only provide an array.array buffer to put the USB data into.<br/> I use the multiprocessing feature and the final destination of the USB data is a mmap.mmap<br/> Object. I would like to specify this as a receive buffer to save a pickle and<br/> unpickle operation.</div> <div>It is not so difficult to use the pyapi.PyObject_GetBuffer function to retrieve address and length<br/> of any buffer protocol compliant object.</div> <div>So this array restriction should be lifted, I assume there are more users who would<br/> appreciate this change. I would not like to distribute my software with a modified pyusb.</div> <div>Sincerely<br/> Hermann Hamann</div> <div><br/> Here follows the modifications I made:</div> <div>-----------------------------------------</div> <div># in backend1.py, similar for other backends</div> <div>from ctypes import *<br/> from struct import unpack</div> <div>getBuffer = pythonapi.PyObject_GetBuffer</div> <div>getBuffer.argtypes = [py_object, c_void_p, c_int]</div> <div>view = create_string_buffer(11*sizeof(int))</div> <div>def getBufferInfo(someObject):</div> <div> pointer_to_sO = py_object(someObject)</div> <div> result = getBuffer(pointer_to_sO,view,1) # flag writeable</div> <div> ### this call can raise an Exception. However this would be a consequence<br/> ### of an invalid caller, so no recovery is possible and simply let it<br/> ### crash, the message is helpful.<br/> <br/> if result != 0 : return None,None<br/> <br/> bufadr,objadr,buflen,itemsize,readonly,ndim,bformat,shape,strides,\<br/> suboffsets,internal = unpack("11I",view)<br/> <br/> result = pythonapi.PyBuffer_Release(string_buffer)</div> <div> return (bufadr,buflen)<br/> <br/> # and some lines later</div> <div> def __read(self, fn, dev_handle, ep, intf, buff, timeout):<br/> ### !!!! changed address, length = buff.buffer_info()<br/> address,length = getBufferInfo(buff)<br/> ##length *= buff.itemsize changed<br/> <br/> ----------------------------------<br/> # in core.py</div> <div> if isinstance(size_or_buffer,int):<br/> </div> </div></div></body></html> |
From: Xiaofan C. <xia...@gm...> - 2015-06-15 03:36:52
|
On Fri, Jun 12, 2015 at 10:40 PM, Jay Newens <ja...@ne...> wrote: > I have the LibUSB-Win32 installed and the test program is > connected to my Zebra KR403 printer and I can see the > configuration info for the printer so I think my driver package > is ok. I am curious though about the libusb0.dll. I see that it > is installed in C:\Windows\System32\Config\ and I do not think > my program is looking for it there. I put a copy of the dll file in > the root of System32 and my program now works on my target PC. Then your driver installation is not correct. You should use Zadig to install libusb-win32 driver (or WinUSB driver). http://zadig.akeo.ie/ -- Xiaofan |
From: Xiaofan C. <xia...@gm...> - 2015-06-15 03:34:59
|
On Sun, Jun 14, 2015 at 7:21 PM, Matthias Grabowski <em...@ma...> wrote: > Hey, > > my version that i downloaded from sourceforge seems to have indeed been > quite old. I got the latest version from github now. After some more > googling, im now using this code: > > On that last line i (again) get a undefined symbol error: > AttributeError: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so: undefined > symbol: libusb_strerror > > Whats happening now? As mentioned before, your libusb is old. Please download latest version of libusb (1.0.19) from Sourceforge. http://libusb.info/ http://sourceforge.net/projects/libusb/ -- Xiaofan |
From: Matthias G. <em...@ma...> - 2015-06-14 11:21:36
|
Hey, my version that i downloaded from sourceforge seems to have indeed been quite old. I got the latest version from github now. After some more googling, im now using this code: import usb.backend.libusb1 as libusb backend = libusb.get_backend(find_library=lambda x: "usr/lib/arm-linux-gnueabihf/libusb-1.0.so") dev = usb.core.find(idVendor=VENDOR, idProduct = PRODUCT, backend=backend) This works, the kernel_driver functions dont throw errors anymore. I can even send data to my device and get a valid return code. However, when reading from the device, there still seem to be problems. ret = endpoint_out.write(message, 1000) print(ret) ret = endpoint_in.read(16) On that last line i (again) get a undefined symbol error: AttributeError: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so: undefined symbol: libusb_strerror Whats happening now? Heres the log file: 2015-06-14 13:14:00,122 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", line 880, in get_backend _setup_prototypes(_lib) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", line 453, in _setup_prototypes lib.libusb_strerror.argtypes = [c_uint] File "/usr/lib/python3.2/ctypes/__init__.py", line 366, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.2/ctypes/__init__.py", line 371, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so: undefined symbol: libusb_strerror 2015-06-14 13:14:00,166 DEBUG:usb.backend.libusb1:_LibUSB.__init__(<CDLL '/usr/lib/arm-linux-gnueabihf/libusb-1.0.so', handle 10bb3c8 at 769023f0>) 2015-06-14 13:14:00,169 INFO:usb.core:find(): using backend "usb.backend.libusb1" 2015-06-14 13:14:00,170 DEBUG:usb.backend.libusb1:_LibUSB.enumerate_devices() 2015-06-14 13:14:00,176 DEBUG:usb.backend.libusb1:_LibUSB.get_device_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>) 2015-06-14 13:14:00,178 DEBUG:usb.backend.libusb1:_LibUSB.get_device_descriptor(<usb.backend.libusb1._Device object at 0x766e44d0>) 2015-06-14 13:14:00,181 DEBUG:usb.backend.libusb1:_LibUSB.get_device_descriptor(<usb.backend.libusb1._Device object at 0x766e4450>) 2015-06-14 13:14:00,183 DEBUG:usb.backend.libusb1:_LibUSB.get_device_descriptor(<usb.backend.libusb1._Device object at 0x766e44f0>) 2015-06-14 13:14:00,185 DEBUG:usb.backend.libusb1:_LibUSB.get_device_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>) 2015-06-14 13:14:00,189 DEBUG:usb.backend.libusb1:_LibUSB.open_device(<usb.backend.libusb1._Device object at 0x766e43f0>) 2015-06-14 13:14:00,190 DEBUG:usb.backend.libusb1:_LibUSB.is_kernel_driver_active(<usb.backend.libusb1._DeviceHandle object at 0x769d8d50>, 0) 2015-06-14 13:14:00,192 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,194 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,196 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,198 DEBUG:usb.backend.libusb1:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0, 0) 2015-06-14 13:14:00,200 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,201 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,203 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,205 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,206 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,208 DEBUG:usb.backend.libusb1:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 1, 0, 0, 0) 2015-06-14 13:14:00,209 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,210 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,212 DEBUG:usb.backend.libusb1:_LibUSB.claim_interface(<usb.backend.libusb1._DeviceHandle object at 0x769d8d50>, 0) 2015-06-14 13:14:00,214 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration(<usb.backend.libusb1._DeviceHandle object at 0x769d8d50>) 2015-06-14 13:14:00,217 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,220 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,222 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,226 DEBUG:usb.backend.libusb1:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0, 0) 2015-06-14 13:14:00,228 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,230 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,233 DEBUG:usb.backend.libusb1:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 1, 0, 0, 0) 2015-06-14 13:14:00,235 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,236 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,239 DEBUG:usb.backend.libusb1:_LibUSB.intr_write(<usb.backend.libusb1._DeviceHandle object at 0x769d8d50>, 2, 0, array('B', [40, 68, 42, 54, 52, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32]), 1000) 2015-06-14 13:14:00,498 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,500 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,502 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,504 DEBUG:usb.backend.libusb1:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0, 0) 2015-06-14 13:14:00,505 DEBUG:usb.backend.libusb1:_LibUSB.get_interface_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0, 0, 0) 2015-06-14 13:14:00,506 DEBUG:usb.backend.libusb1:_LibUSB.get_configuration_descriptor(<usb.backend.libusb1._Device object at 0x766e43f0>, 0) 2015-06-14 13:14:00,508 DEBUG:usb.backend.libusb1:_LibUSB.intr_read(<usb.backend.libusb1._DeviceHandle object at 0x769d8d50>, 129, 0, array('B', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 1000) Am 14.06.2015 um 02:54 schrieb Wander Lairson Costa: > 2015-06-13 8:33 GMT-03:00 Matthias Grabowski <em...@ma...>: >> hey guys, >> > Hi, so what's going on here is a chain of unfortunate events. > >> i got it now, thanks :) The log follows below, it seems that pyusb was >> unable to load the propper backend? when installing i did all the steps >> in the documentation: >> sudo apt-get install python libusb-1.0-0 >> sudo python setup.py install >> >> Both run fine. >> >> Heres the Log dump: >> 2015-06-12 16:38:05,805 ERROR:usb.backend.libusb1:Error loading libusb >> 1.0 backend >> Traceback (most recent call last): >> File >> "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", >> line 880, in get_backend >> _setup_prototypes(_lib) >> File >> "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", >> line 453, in _setup_prototypes >> lib.libusb_strerror.argtypes = [c_uint] >> File "/usr/lib/python3.2/ctypes/__init__.py", line 366, in __getattr__ >> func = self.__getitem__(name) >> File "/usr/lib/python3.2/ctypes/__init__.py", line 371, in __getitem__ >> func = self._FuncPtr((name_or_ordinal, self)) >> AttributeError: /lib/arm-linux-gnueabihf/libusb-1.0.so.0: undefined >> symbol: libusb_strerror > So, you have a pretty old libusb 1.0 version installed, which does not > implement libusb_strerror yet. I solved this issue recently in PyUSB, > either upgrading libusb 1.0 or using git version of PyUSB must solve > the problem > >> 2015-06-12 16:38:06,407 ERROR:usb.libloader:'OpenUSB library' could not >> be found >> 2015-06-12 16:38:06,408 ERROR:usb.backend.openusb:Error loading OpenUSB >> backend >> 2015-06-12 16:38:06,439 INFO:usb.core:find(): using backend >> "usb.backend.libusb0" > But you have libusb 0.1 installed, so PyUSB goes for it > >> 2015-06-12 16:38:06,441 >> DEBUG:usb.backend.libusb0:_LibUSB.enumerate_devices() >> 2015-06-12 16:38:06,444 >> DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device >> object at 0x150dc60>) >> 2015-06-12 16:38:06,446 >> DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>) >> 2015-06-12 16:38:06,447 >> DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>, 0) >> 2015-06-12 16:38:06,449 >> DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>, 0, 0, 0) >> 2015-06-12 16:38:06,450 >> DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>, 0) >> 2015-06-12 16:38:06,452 >> DEBUG:usb.backend.libusb0:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>, 1, 0, 0, 0) >> 2015-06-12 16:38:06,453 >> DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>, 0, 0, 0) >> 2015-06-12 16:38:06,453 >> DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>, 0) >> 2015-06-12 16:38:06,455 >> DEBUG:usb.backend.libusb0:_LibUSB.open_device(<usb.backend.libusb0._usb_device >> object at 0x151c4e0>) >> 2015-06-12 16:38:06,514 >> DEBUG:usb.backend.libusb0:_LibUSB.close_device(22698048) >> >> And from the console when i run my script: >> Traceback (most recent call last): >> File "testusb.py", line 65, in <module> >> if dev.is_kernel_driver_active(0): >> File >> "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/core.py", >> line 992, in is_kernel_driver_active >> interface) >> File >> "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", >> line 363, in is_kernel_driver_active >> _not_implemented(self.is_kernel_driver_active) >> File >> "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", >> line 79, in _not_implemented >> raise NotImplementedError(func.__name__) >> NotImplementedError: is_kernel_driver_active >> > But libusb 0.1 does not implement is_kernel_driver_active function... > >> matt >> > |
From: Wander L. C. <wan...@gm...> - 2015-06-14 00:55:10
|
2015-06-13 8:33 GMT-03:00 Matthias Grabowski <em...@ma...>: > hey guys, > Hi, so what's going on here is a chain of unfortunate events. > i got it now, thanks :) The log follows below, it seems that pyusb was > unable to load the propper backend? when installing i did all the steps > in the documentation: > sudo apt-get install python libusb-1.0-0 > sudo python setup.py install > > Both run fine. > > Heres the Log dump: > 2015-06-12 16:38:05,805 ERROR:usb.backend.libusb1:Error loading libusb > 1.0 backend > Traceback (most recent call last): > File > "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", > line 880, in get_backend > _setup_prototypes(_lib) > File > "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", > line 453, in _setup_prototypes > lib.libusb_strerror.argtypes = [c_uint] > File "/usr/lib/python3.2/ctypes/__init__.py", line 366, in __getattr__ > func = self.__getitem__(name) > File "/usr/lib/python3.2/ctypes/__init__.py", line 371, in __getitem__ > func = self._FuncPtr((name_or_ordinal, self)) > AttributeError: /lib/arm-linux-gnueabihf/libusb-1.0.so.0: undefined > symbol: libusb_strerror So, you have a pretty old libusb 1.0 version installed, which does not implement libusb_strerror yet. I solved this issue recently in PyUSB, either upgrading libusb 1.0 or using git version of PyUSB must solve the problem > 2015-06-12 16:38:06,407 ERROR:usb.libloader:'OpenUSB library' could not > be found > 2015-06-12 16:38:06,408 ERROR:usb.backend.openusb:Error loading OpenUSB > backend > 2015-06-12 16:38:06,439 INFO:usb.core:find(): using backend > "usb.backend.libusb0" But you have libusb 0.1 installed, so PyUSB goes for it > 2015-06-12 16:38:06,441 > DEBUG:usb.backend.libusb0:_LibUSB.enumerate_devices() > 2015-06-12 16:38:06,444 > DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device > object at 0x150dc60>) > 2015-06-12 16:38:06,446 > DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>) > 2015-06-12 16:38:06,447 > DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>, 0) > 2015-06-12 16:38:06,449 > DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>, 0, 0, 0) > 2015-06-12 16:38:06,450 > DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>, 0) > 2015-06-12 16:38:06,452 > DEBUG:usb.backend.libusb0:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>, 1, 0, 0, 0) > 2015-06-12 16:38:06,453 > DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>, 0, 0, 0) > 2015-06-12 16:38:06,453 > DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device > object at 0x151c4e0>, 0) > 2015-06-12 16:38:06,455 > DEBUG:usb.backend.libusb0:_LibUSB.open_device(<usb.backend.libusb0._usb_device > object at 0x151c4e0>) > 2015-06-12 16:38:06,514 > DEBUG:usb.backend.libusb0:_LibUSB.close_device(22698048) > > And from the console when i run my script: > Traceback (most recent call last): > File "testusb.py", line 65, in <module> > if dev.is_kernel_driver_active(0): > File > "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/core.py", > line 992, in is_kernel_driver_active > interface) > File > "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", > line 363, in is_kernel_driver_active > _not_implemented(self.is_kernel_driver_active) > File > "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", > line 79, in _not_implemented > raise NotImplementedError(func.__name__) > NotImplementedError: is_kernel_driver_active > But libusb 0.1 does not implement is_kernel_driver_active function... > matt > -- Best Regards, Wander Lairson Costa |
From: Matthias G. <em...@ma...> - 2015-06-13 11:33:28
|
hey guys, i got it now, thanks :) The log follows below, it seems that pyusb was unable to load the propper backend? when installing i did all the steps in the documentation: sudo apt-get install python libusb-1.0-0 sudo python setup.py install Both run fine. Heres the Log dump: 2015-06-12 16:38:05,805 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", line 880, in get_backend _setup_prototypes(_lib) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", line 453, in _setup_prototypes lib.libusb_strerror.argtypes = [c_uint] File "/usr/lib/python3.2/ctypes/__init__.py", line 366, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.2/ctypes/__init__.py", line 371, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /lib/arm-linux-gnueabihf/libusb-1.0.so.0: undefined symbol: libusb_strerror 2015-06-12 16:38:06,407 ERROR:usb.libloader:'OpenUSB library' could not be found 2015-06-12 16:38:06,408 ERROR:usb.backend.openusb:Error loading OpenUSB backend 2015-06-12 16:38:06,439 INFO:usb.core:find(): using backend "usb.backend.libusb0" 2015-06-12 16:38:06,441 DEBUG:usb.backend.libusb0:_LibUSB.enumerate_devices() 2015-06-12 16:38:06,444 DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device object at 0x150dc60>) 2015-06-12 16:38:06,446 DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>) 2015-06-12 16:38:06,447 DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0) 2015-06-12 16:38:06,449 DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0, 0, 0) 2015-06-12 16:38:06,450 DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0) 2015-06-12 16:38:06,452 DEBUG:usb.backend.libusb0:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 1, 0, 0, 0) 2015-06-12 16:38:06,453 DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0, 0, 0) 2015-06-12 16:38:06,453 DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0) 2015-06-12 16:38:06,455 DEBUG:usb.backend.libusb0:_LibUSB.open_device(<usb.backend.libusb0._usb_device object at 0x151c4e0>) 2015-06-12 16:38:06,514 DEBUG:usb.backend.libusb0:_LibUSB.close_device(22698048) And from the console when i run my script: Traceback (most recent call last): File "testusb.py", line 65, in <module> if dev.is_kernel_driver_active(0): File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/core.py", line 992, in is_kernel_driver_active interface) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", line 363, in is_kernel_driver_active _not_implemented(self.is_kernel_driver_active) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", line 79, in _not_implemented raise NotImplementedError(func.__name__) NotImplementedError: is_kernel_driver_active matt Am 12.06.2015 um 16:14 schrieb Wander Lairson Costa: > 2015-06-12 11:15 GMT-03:00 Matthias Grabowski <em...@ma...>: >> I don't know what you want me to do with >> export PYUSB_DEBUG=debug >> > This is an environment variable to define before running your script. > You can also define inside your Python code before you import the > pyusb modules. If you need further details, you might want to give a > look in the tutorial [1] > > [1] https://github.com/walac/pyusb/blob/master/docs/tutorial.rst > >> Am 12. Juni 2015 15:36:52 MESZ, schrieb Wander Lairson Costa >> <wan...@gm...>: >>> 2015-06-12 9:20 GMT-03:00 Matthias Grabowski <em...@ma...>: >>>> Hello guys, >>>> >>>> I'm new to this mailing list, pyusb and Linux in general. So sorry, if >>>> some >>>> of my questions may be a little stupid. I know my way around python, >>>> though. >>>> >>>> Anyways, I got a raspberry pi with raspbian installed and I'm writing a >>>> python script to read data from an air quality sensor that identifies >>>> itself >>>> as a HID to the OS. When I try to read or write data to/from the device >>>> I >>>> get a USBError: >>>> Could not claim interface 0: device or resource busy. >>>> >>>> I think that happens because the os attaches a kernel driver to the >>>> device. >>>> Correct? >>>> >>>> In that case I found some code that tries to claim the interface: >>>> if dev.is_kernel_driver_active (0): >>>> dev.detach_kernel_driver(0) >>>> >>>> >>>> usb.util.claim_interface (dev, 0) >>>> >>>> But there I get a NotImplementedError. Why? Whats wrong and what can I >>>> do? >>> >>> >>> Hi, >>> >>> Could you please run with logs (export PYUSB_DEBUG=debug) and post the >>> result? >>> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > |
From: Jay N. <ja...@ne...> - 2015-06-12 14:40:43
|
I have the LibUSB-Win32 installed and the test program is connected to my Zebra KR403 printer and I can see the configuration info for the printer so I think my driver package is ok. I am curious though about the libusb0.dll. I see that it is installed in C:\Windows\System32\Config\ and I do not think my program is looking for it there. I put a copy of the dll file in the root of System32 and my program now works on my target PC. -----Original Message----- From: Wander Lairson Costa [mailto:wan...@gm...] Sent: Thursday, June 11, 2015 20:31 To: pyusb-users Subject: Re: [pyusb-users] question 2015-06-11 16:44 GMT-03:00 Jay Newens <ja...@ne...>: > I am using pyusb in my Python 2.7 environment getting the status of > the Zebra KR403 printer and having good success on a Windows 7 64 bit > PC. Now I am ready to test this on my target machine. I have created > my executable program with py2exe and tested the exe on my development > PC and it works fine but when I move it to my target PC I get a > message “No Backend Available” when it gets to the “dev = > usb.core.find(idVendor=int(VID), idProduct=int(PID))” part of my code. > I convert the hex to an integer here but when using the hex value I > get the same issue on my target PC, even with hex value, both hex and > converting to integer work fine on the development PC so I do not think the issue is here. > PyUSB on Windows depends either of libusb 1.0 or libusb-win32. Contrary to the unices version, libusb on Windows needs to attach as a device driver. You can use zadig to install libusb (or libusb-win32) driver for your device. libusb uses the WinUSB driver (which is shipped with Windows). If you want to redistribute your software to users, you will have to provide a driver package to the user (basically writing an inf file and ship the binaries). However, giving details on how to do that is out of scope of this mailing list. OSR [1] can be helpful here [1] http://www.osronline.com/ > > > Traceback (most recent call last): > > File "ZebraKR403PaperStatus1.0.py", line 98, in <module> > > File "usb\core.pyc", line 846, in find > > ValueError: No backend available > > > > I am not sure what is causing the issue. It seems as though there is a > missing dll or something that is required to make this work and it did > not make it to my target PC. Any suggestions or ideas what I may be > missing would be greatly appreciated. > > > > > > Jay > > > > > > > > > > > > > ---------------------------------------------------------------------- > -------- > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa ------------------------------------------------------------------------------ _______________________________________________ pyusb-users mailing list pyu...@li... https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Wander L. C. <wan...@gm...> - 2015-06-12 14:15:42
|
2015-06-12 11:15 GMT-03:00 Matthias Grabowski <em...@ma...>: > I don't know what you want me to do with > export PYUSB_DEBUG=debug > This is an environment variable to define before running your script. You can also define inside your Python code before you import the pyusb modules. If you need further details, you might want to give a look in the tutorial [1] [1] https://github.com/walac/pyusb/blob/master/docs/tutorial.rst > > Am 12. Juni 2015 15:36:52 MESZ, schrieb Wander Lairson Costa > <wan...@gm...>: >> >> 2015-06-12 9:20 GMT-03:00 Matthias Grabowski <em...@ma...>: >>> >>> Hello guys, >>> >>> I'm new to this mailing list, pyusb and Linux in general. So sorry, if >>> some >>> of my questions may be a little stupid. I know my way around python, >>> though. >>> >>> Anyways, I got a raspberry pi with raspbian installed and I'm writing a >>> python script to read data from an air quality sensor that identifies >>> itself >>> as a HID to the OS. When I try to read or write data to/from the device >>> I >>> get a USBError: >>> Could not claim interface 0: device or resource busy. >>> >>> I think that happens because the os attaches a kernel driver to the >>> device. >>> Correct? >>> >>> In that case I found some code that tries to claim the interface: >>> if dev.is_kernel_driver_active (0): >>> dev.detach_kernel_driver(0) >>> >>> >>> usb.util.claim_interface (dev, 0) >>> >>> But there I get a NotImplementedError. Why? Whats wrong and what can I >>> do? >> >> >> >> Hi, >> >> Could you please run with logs (export PYUSB_DEBUG=debug) and post the >> result? >> > > ------------------------------------------------------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Matthias G. <em...@ma...> - 2015-06-12 14:10:57
|
I don't know what you want me to do with export PYUSB_DEBUG=debug Am 12. Juni 2015 15:36:52 MESZ, schrieb Wander Lairson Costa <wan...@gm...>: >2015-06-12 9:20 GMT-03:00 Matthias Grabowski <em...@ma...>: >> Hello guys, >> >> I'm new to this mailing list, pyusb and Linux in general. So sorry, >if some >> of my questions may be a little stupid. I know my way around python, >though. >> >> Anyways, I got a raspberry pi with raspbian installed and I'm writing >a >> python script to read data from an air quality sensor that identifies >itself >> as a HID to the OS. When I try to read or write data to/from the >device I >> get a USBError: >> Could not claim interface 0: device or resource busy. >> >> I think that happens because the os attaches a kernel driver to the >device. >> Correct? >> >> In that case I found some code that tries to claim the interface: >> if dev.is_kernel_driver_active (0): >> dev.detach_kernel_driver(0) >> >> usb.util.claim_interface (dev, 0) >> >> But there I get a NotImplementedError. Why? Whats wrong and what can >I do? >> > >Hi, > >Could you please run with logs (export PYUSB_DEBUG=debug) and post the >result? > > >-- >Best Regards, >Wander Lairson Costa > >------------------------------------------------------------------------------ >_______________________________________________ >pyusb-users mailing list >pyu...@li... >https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Wander L. C. <wan...@gm...> - 2015-06-12 13:37:39
|
2015-06-12 9:20 GMT-03:00 Matthias Grabowski <em...@ma...>: > Hello guys, > > I'm new to this mailing list, pyusb and Linux in general. So sorry, if some > of my questions may be a little stupid. I know my way around python, though. > > Anyways, I got a raspberry pi with raspbian installed and I'm writing a > python script to read data from an air quality sensor that identifies itself > as a HID to the OS. When I try to read or write data to/from the device I > get a USBError: > Could not claim interface 0: device or resource busy. > > I think that happens because the os attaches a kernel driver to the device. > Correct? > > In that case I found some code that tries to claim the interface: > if dev.is_kernel_driver_active (0): > dev.detach_kernel_driver(0) > > usb.util.claim_interface (dev, 0) > > But there I get a NotImplementedError. Why? Whats wrong and what can I do? > Hi, Could you please run with logs (export PYUSB_DEBUG=debug) and post the result? -- Best Regards, Wander Lairson Costa |
From: Matthias G. <em...@ma...> - 2015-06-12 12:15:59
|
Hello guys, I'm new to this mailing list, pyusb and Linux in general. So sorry, if some of my questions may be a little stupid. I know my way around python, though. Anyways, I got a raspberry pi with raspbian installed and I'm writing a python script to read data from an air quality sensor that identifies itself as a HID to the OS. When I try to read or write data to/from the device I get a USBError: Could not claim interface 0: device or resource busy. I think that happens because the os attaches a kernel driver to the device. Correct? In that case I found some code that tries to claim the interface: if dev.is_kernel_driver_active (0): dev.detach_kernel_driver(0) usb.util.claim_interface (dev, 0) But there I get a NotImplementedError. Why? Whats wrong and what can I do? Matt |
From: Wander L. C. <wan...@gm...> - 2015-06-12 01:32:00
|
2015-06-11 16:44 GMT-03:00 Jay Newens <ja...@ne...>: > I am using pyusb in my Python 2.7 environment getting the status of the > Zebra KR403 printer and having good success on a Windows 7 64 bit PC. Now I > am ready to test this on my target machine. I have created my executable > program with py2exe and tested the exe on my development PC and it works > fine but when I move it to my target PC I get a message “No Backend > Available” when it gets to the “dev = usb.core.find(idVendor=int(VID), > idProduct=int(PID))” part of my code. I convert the hex to an integer here > but when using the hex value I get the same issue on my target PC, even with > hex value, both hex and converting to integer work fine on the development > PC so I do not think the issue is here. > PyUSB on Windows depends either of libusb 1.0 or libusb-win32. Contrary to the unices version, libusb on Windows needs to attach as a device driver. You can use zadig to install libusb (or libusb-win32) driver for your device. libusb uses the WinUSB driver (which is shipped with Windows). If you want to redistribute your software to users, you will have to provide a driver package to the user (basically writing an inf file and ship the binaries). However, giving details on how to do that is out of scope of this mailing list. OSR [1] can be helpful here [1] http://www.osronline.com/ > > > Traceback (most recent call last): > > File "ZebraKR403PaperStatus1.0.py", line 98, in <module> > > File "usb\core.pyc", line 846, in find > > ValueError: No backend available > > > > I am not sure what is causing the issue. It seems as though there is a > missing dll or something that is required to make this work and it did not > make it to my target PC. Any suggestions or ideas what I may be missing > would be greatly appreciated. > > > > > > Jay > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Jay N. <ja...@ne...> - 2015-06-11 19:44:17
|
I am using pyusb in my Python 2.7 environment getting the status of the Zebra KR403 printer and having good success on a Windows 7 64 bit PC. Now I am ready to test this on my target machine. I have created my executable program with py2exe and tested the exe on my development PC and it works fine but when I move it to my target PC I get a message "No Backend Available" when it gets to the "dev = usb.core.find(idVendor=int(VID), idProduct=int(PID))" part of my code. I convert the hex to an integer here but when using the hex value I get the same issue on my target PC, even with hex value, both hex and converting to integer work fine on the development PC so I do not think the issue is here. Traceback (most recent call last): File "ZebraKR403PaperStatus1.0.py", line 98, in <module> File "usb\core.pyc", line 846, in find ValueError: No backend available I am not sure what is causing the issue. It seems as though there is a missing dll or something that is required to make this work and it did not make it to my target PC. Any suggestions or ideas what I may be missing would be greatly appreciated. Jay |
From: Wander L. C. <wan...@gm...> - 2015-06-10 10:37:05
|
2015-06-09 6:34 GMT-03:00 UNIVERSAL PHONE <uni...@gm...>: >> Message: 1 >> Date: Sun, 31 May 2015 11:46:07 -0300 >> From: Wander Lairson Costa <wan...@gm...> >> Subject: Re: [pyusb-users] (no subject) >> To: pyusb-users <pyu...@li...> >> Message-ID: >> >> <CAFsSK4bbWhZ-Q6nUDZqWDFMVx9qRwvETN47=jBt...@ma...> >> Content-Type: text/plain; charset=UTF-8 >> >> 2015-05-30 9:42 GMT-03:00 UNIVERSAL PHONE <uni...@gm...>: >> > Hi, >> > >> > >> > this is my program: >> > >> > import usb.util >> > import usb.core >> > import sys >> > >> > dev=usb.core.find() >> > dev.set_configuration() >> > >> > this is the error message: >> > >> > usb.core.USBError:could not set config 1: Device or resource busy >> > >> > >> > >> > What's wrong with my program ? >> > >> >> What Operating System are you using? >> > > --- I'm running SUSE LINUX ENTERPRISE DESKTOP 12 > The problem must be you have a driver attached to your device. You can find examples on how to detach the driver from the device in other messages in this mailing list. -- Best Regards, Wander Lairson Costa |
From: UNIVERSAL P. <uni...@gm...> - 2015-06-09 09:34:23
|
> > Message: 1 > Date: Sun, 31 May 2015 11:46:07 -0300 > From: Wander Lairson Costa <wan...@gm...> > Subject: Re: [pyusb-users] (no subject) > To: pyusb-users <pyu...@li...> > Message-ID: > <CAFsSK4bbWhZ-Q6nUDZqWDFMVx9qRwvETN47= > jBt...@ma...> > Content-Type: text/plain; charset=UTF-8 > > 2015-05-30 9:42 GMT-03:00 UNIVERSAL PHONE <uni...@gm...>: > > Hi, > > > > > > this is my program: > > > > import usb.util > > import usb.core > > import sys > > > > dev=usb.core.find() > > dev.set_configuration() > > > > this is the error message: > > > > usb.core.USBError:could not set config 1: Device or resource busy > > > > > > > > What's wrong with my program ? > > > > What Operating System are you using? > > ---* I'm running SUSE LINUX ENTERPRISE DESKTOP 12 * |
From: Xiaofan C. <xia...@gm...> - 2015-06-08 01:55:07
|
On Sun, Jun 7, 2015 at 2:18 AM, Jason Edelman <jas...@ho...> wrote: > I'm about to embark on a journey using pyusb and > really want to integrate it with a USB based fingerprint reader. > > This will be on a machine that all I can install is pyusb > (no additional drivers). Is there a recommendation on what > make/model/vendor of fingerprint reader should work? I > suppose the same question goes for other USB device types too. In order to use pyusb, you need to have either libusb-1.0 or libusb-0.1 installed in your system. What is the OS? If it is Linux, does the system already have libusb-1.0 installed? And will the admin help you to install the proper udev rules to access the USB device as normal user. As for which finger print scanner will work, that depends on whether you have access the protocol or not. If you do not have access the communication protocol, it will be a challenge since you need to carry out reverse engineering work. This might help. It was written by Daniel Drake, the original author of libusb-1.0. http://www.freedesktop.org/wiki/Software/fprint/libfprint/ There is also the following. http://www.ullrich-online.cc/fingerprint/ -- Xiaofan |
From: UNIVERSAL P. <uni...@gm...> - 2015-06-08 01:29:02
|
2015-06-06 23:32 GMT-04:00 <pyu...@li...>: > Send pyusb-users mailing list submissions to > pyu...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/pyusb-users > or, via email, send a message with subject or body 'help' to > pyu...@li... > > You can reach the person managing the list at > pyu...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of pyusb-users digest..." > > > Today's Topics: > > 1. Re: (no subject) (Wander Lairson Costa) > 2. Re: USBError: Operation timed out (Caleb Mayfield) > 3. USB fingerprint scanner (Jason) > 4. USB Fingerprint Reader (Jason Edelman) > 5. Re: USBError: Operation timed out (Wander Lairson Costa) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 31 May 2015 11:46:07 -0300 > From: Wander Lairson Costa <wan...@gm...> > Subject: Re: [pyusb-users] (no subject) > To: pyusb-users <pyu...@li...> > Message-ID: > <CAFsSK4bbWhZ-Q6nUDZqWDFMVx9qRwvETN47= > jBt...@ma...> > Content-Type: text/plain; charset=UTF-8 > > 2015-05-30 9:42 GMT-03:00 UNIVERSAL PHONE <uni...@gm...>: > > Hi, > > > > > > this is my program: > > > > import usb.util > > import usb.core > > import sys > > > > dev=usb.core.find() > > dev.set_configuration() > > > > this is the error message: > > > > usb.core.USBError:could not set config 1: Device or resource busy > > > > > > > > What's wrong with my program ? > > > > What Operating System are you using? > > ---* I'm running SUSE LINUX ENTERPRISE DESKTOP 12 * > > -- > Best Regards, > Wander Lairson Costa > > > > ------------------------------ > > Message: 2 > Date: Mon, 1 Jun 2015 12:52:11 -0700 > From: Caleb Mayfield <cal...@gm...> > Subject: Re: [pyusb-users] USBError: Operation timed out > To: pyu...@li... > Message-ID: > < > CAL...@ma...> > Content-Type: text/plain; charset="utf-8" > > SUCCESS!! > I found my error. Apparently I need to claim the device by this program > that I'm running. The new code is as follows (with some new declarations); > > import sys > import usb.core > import usb.util > > > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) > interface = 5 > endpoint = dev[0][(0,0)][0] > > if dev.is_kernel_driver_active(interface) is True: > # tell the kernel to detach > dev.detach_kernel_driver(interface) > # claim the device > usb.util.claim_interface(dev, interface) > > #if dev is None: > # raise ValueError('Device not found') > > dev.set_configuration() > print "Connected to " + str(dev) > > QS="\x51\x53\x0D" #Call for Serial number > BLON="\x42\x4C\x4F\x4E\x0D" #Backlight ON > BLOFF="\x42\x4C\x4F\x46\x46\x0D" #Backlight OFF > > > dev.write(0x02,QS,0,0) > > ret = dev.read(0x82,endpoint.wMaxPacketSize) > sret=''.join([chr(x) for x in ret]) > print "Return Raw: ",ret > print "Return : ", sret > > # release the device > #usb.util.release_interface(dev, interface) > # reattach the device to the OS kernel > #dev.attach_kernel_driver(interface) > > I did get an error the first time when I did not have the last line > commented out. I need to work on that one, but it does work now! I can call > the serial number and turn the back light on and off so the train is > rolling. > > Thanks! > > > > On Mon, Jun 1, 2015 at 8:44 AM, Caleb Mayfield <cal...@gm...> > wrote: > > > Attached is the manual that was sent to me. One thing to note from the > > person who sent it to me, this was in development and was never > completed. > > There is no Appendix C with an example code in it. I'm still learning > about > > this level of programming. My experience thus far has been a moderate > level > > of Arduino work and some beginner level shell scripting and java. I feel > > like I'm missing something that's right in front of my face, so any help > is > > appreciated. > > > > Below is the lsusb -v output for this device. I'm currently working on a > > Pi2 running the 2015-05-05 Raspbian release using Python 2.7.3 for > coding. > > > > Bus 001 Device 004: ID 130c:0001 > > Device Descriptor: > > bLength 18 > > bDescriptorType 1 > > bcdUSB 1.01 > > bDeviceClass 255 Vendor Specific Class > > bDeviceSubClass 255 Vendor Specific Subclass > > bDeviceProtocol 255 Vendor Specific Protocol > > bMaxPacketSize0 64 > > idVendor 0x130c > > idProduct 0x0001 > > bcdDevice 1.00 > > iManufacturer 1 Quest Technologies, Inc. > > iProduct 2 Quest Technologies SoundPro SLM > > iSerial 6 BJL060022 > > bNumConfigurations 1 > > Configuration Descriptor: > > bLength 9 > > bDescriptorType 2 > > wTotalLength 32 > > bNumInterfaces 1 > > bConfigurationValue 1 > > iConfiguration 3 Quest Technologies Device > > bmAttributes 0xc0 > > Self Powered > > MaxPower 0mA > > Interface Descriptor: > > bLength 9 > > bDescriptorType 4 > > bInterfaceNumber 0 > > bAlternateSetting 0 > > bNumEndpoints 2 > > bInterfaceClass 255 Vendor Specific Class > > bInterfaceSubClass 255 Vendor Specific Subclass > > bInterfaceProtocol 255 Vendor Specific Protocol > > iInterface 5 Virtual COM > > Endpoint Descriptor: > > bLength 7 > > bDescriptorType 5 > > bEndpointAddress 0x02 EP 2 OUT > > bmAttributes 2 > > Transfer Type Bulk > > Synch Type None > > Usage Type Data > > wMaxPacketSize 0x0040 1x 64 bytes > > bInterval 0 > > Endpoint Descriptor: > > bLength 7 > > bDescriptorType 5 > > bEndpointAddress 0x82 EP 2 IN > > bmAttributes 2 > > Transfer Type Bulk > > Synch Type None > > Usage Type Data > > wMaxPacketSize 0x0040 1x 64 bytes > > bInterval 0 > > Device Status: 0x0001 > > Self Powered > > > > > > On Sat, May 30, 2015 at 5:05 AM, Karl Palsson <ka...@tw...> > wrote: > > > >> > >> I'm pretty sure you're not actually sending the request that the manual > >> says. > >> > >> Caleb Mayfield <cal...@gm...> wrote: > >> > I am new to using Python and PyUSB. I am trying to write a program to > >> > communicate with a 3M Quest SoundPro sound meter. Because I'm new, I'm > >> > starting simple. The vendor was gracious enough to send me the manual > >> > they > >> > have on the commands for the unit. Right now all I'm trying to do is > >> > request the serial number and read the response. I just need to get > >> > communication between a Raspberry Pi and the device working. I have > used > >> > the software on a Windows 7 machine along with a USB sniffer to verify > >> > the > >> > commands and endpoint address were correct. > >> > > >> > This is the program; > >> > > >> > import usb.core > >> > > >> > import usb.util > >> > > >> > import sys > >> > > >> > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) > >> > > >> > if dev is None: > >> > > >> > raise ValueError('Device not found') > >> > > >> > dev.set_configuration() > >> > > >> > print "Connected to " + str(dev) > >> > > >> > QS = '0x51,0x53,0x0D' #Call for Serial number > >> > > >> > dev.write(0x02,QS,0,0) > >> > >> I don't believe this is really right, you're probably meant to send the > >> three bytes, 0x51, 0x53, 0xd, not the 14 bytes, 0, x,5,1,,,0,x,5,3..... > >> > >> You probably just want to do something like... > >> > >> dev.write(0x02, "QS\r", 0, 0) > >> > >> > >> If you can share the manual, You can probably get more correct help than > >> my asumptions. :) > >> > >> Cheers, > >> Karl P > >> > >> > >> > ------------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> pyusb-users mailing list > >> pyu...@li... > >> https://lists.sourceforge.net/lists/listinfo/pyusb-users > >> > >> > > > > > > -- > > Caleb Mayfield > > > > James 1:19-20 > > > > > > -- > Caleb Mayfield > > James 1:19-20 > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Sat, 6 Jun 2015 14:21:37 -0400 > From: Jason <jas...@ho...> > Subject: [pyusb-users] USB fingerprint scanner > To: pyu...@li... > Message-ID: <SNT...@ph...l> > Content-Type: text/plain; charset="us-ascii" > > Hi All, > > I'm about to embark on a journey using pyusb and really want to integrate > it with a USB based fingerprint reader. > > This will be on a machine that all I can install is pyusb (no additional > drivers). Is there a recommendation on what make/model/vendor of > fingerprint reader should work? I suppose the same question goes for other > USB device types too. > > Thanks! > Jason > > > > > ------------------------------ > > Message: 4 > Date: Sat, 6 Jun 2015 14:18:34 -0400 > From: Jason Edelman <jas...@ho...> > Subject: [pyusb-users] USB Fingerprint Reader > To: "pyu...@li..." > <pyu...@li...> > Message-ID: <SNT...@ph...l> > Content-Type: text/plain; charset="us-ascii" > > Hi All, > > I'm about to embark on a journey using pyusb and really want to integrate > it with a USB based fingerprint reader. > > This will be on a machine that all I can install is pyusb (no additional > drivers). Is there a recommendation on what make/model/vendor of > fingerprint reader should work? I suppose the same question goes for other > USB device types too. > > Thanks! > Jason > > > > > > ------------------------------ > > Message: 5 > Date: Sun, 7 Jun 2015 00:31:15 -0300 > From: Wander Lairson Costa <wan...@gm...> > Subject: Re: [pyusb-users] USBError: Operation timed out > To: pyusb-users <pyu...@li...> > Message-ID: > <CAFsSK4b_HfsZEwjYtVPZ3C09_y8WsxxDdNOUgkh-nSB= > HT...@ma...> > Content-Type: text/plain; charset=UTF-8 > > I blocked a message to this thread due to the attached doc size. I did > it because some people subscribed in this mailing list might have slow > internet connection. Please, upload the file to a remote site and send > a message with the link to download. > > 2015-06-01 16:52 GMT-03:00 Caleb Mayfield <cal...@gm...>: > > SUCCESS!! > > I found my error. Apparently I need to claim the device by this program > that > > I'm running. The new code is as follows (with some new declarations); > > > > import sys > > import usb.core > > import usb.util > > > > > > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) > > interface = 5 > > endpoint = dev[0][(0,0)][0] > > > > if dev.is_kernel_driver_active(interface) is True: > > # tell the kernel to detach > > dev.detach_kernel_driver(interface) > > # claim the device > > usb.util.claim_interface(dev, interface) > > > > #if dev is None: > > # raise ValueError('Device not found') > > > > dev.set_configuration() > > print "Connected to " + str(dev) > > > > QS="\x51\x53\x0D" #Call for Serial number > > BLON="\x42\x4C\x4F\x4E\x0D" #Backlight ON > > BLOFF="\x42\x4C\x4F\x46\x46\x0D" #Backlight OFF > > > > > > dev.write(0x02,QS,0,0) > > > > ret = dev.read(0x82,endpoint.wMaxPacketSize) > > sret=''.join([chr(x) for x in ret]) > > print "Return Raw: ",ret > > print "Return : ", sret > > > > # release the device > > #usb.util.release_interface(dev, interface) > > # reattach the device to the OS kernel > > #dev.attach_kernel_driver(interface) > > > > I did get an error the first time when I did not have the last line > > commented out. I need to work on that one, but it does work now! I can > call > > the serial number and turn the back light on and off so the train is > > rolling. > > > > Thanks! > > > > > > > > On Mon, Jun 1, 2015 at 8:44 AM, Caleb Mayfield <cal...@gm... > > > > wrote: > >> > >> Attached is the manual that was sent to me. One thing to note from the > >> person who sent it to me, this was in development and was never > completed. > >> There is no Appendix C with an example code in it. I'm still learning > about > >> this level of programming. My experience thus far has been a moderate > level > >> of Arduino work and some beginner level shell scripting and java. I feel > >> like I'm missing something that's right in front of my face, so any > help is > >> appreciated. > >> > >> Below is the lsusb -v output for this device. I'm currently working on a > >> Pi2 running the 2015-05-05 Raspbian release using Python 2.7.3 for > coding. > >> > >> Bus 001 Device 004: ID 130c:0001 > >> Device Descriptor: > >> bLength 18 > >> bDescriptorType 1 > >> bcdUSB 1.01 > >> bDeviceClass 255 Vendor Specific Class > >> bDeviceSubClass 255 Vendor Specific Subclass > >> bDeviceProtocol 255 Vendor Specific Protocol > >> bMaxPacketSize0 64 > >> idVendor 0x130c > >> idProduct 0x0001 > >> bcdDevice 1.00 > >> iManufacturer 1 Quest Technologies, Inc. > >> iProduct 2 Quest Technologies SoundPro SLM > >> iSerial 6 BJL060022 > >> bNumConfigurations 1 > >> Configuration Descriptor: > >> bLength 9 > >> bDescriptorType 2 > >> wTotalLength 32 > >> bNumInterfaces 1 > >> bConfigurationValue 1 > >> iConfiguration 3 Quest Technologies Device > >> bmAttributes 0xc0 > >> Self Powered > >> MaxPower 0mA > >> Interface Descriptor: > >> bLength 9 > >> bDescriptorType 4 > >> bInterfaceNumber 0 > >> bAlternateSetting 0 > >> bNumEndpoints 2 > >> bInterfaceClass 255 Vendor Specific Class > >> bInterfaceSubClass 255 Vendor Specific Subclass > >> bInterfaceProtocol 255 Vendor Specific Protocol > >> iInterface 5 Virtual COM > >> Endpoint Descriptor: > >> bLength 7 > >> bDescriptorType 5 > >> bEndpointAddress 0x02 EP 2 OUT > >> bmAttributes 2 > >> Transfer Type Bulk > >> Synch Type None > >> Usage Type Data > >> wMaxPacketSize 0x0040 1x 64 bytes > >> bInterval 0 > >> Endpoint Descriptor: > >> bLength 7 > >> bDescriptorType 5 > >> bEndpointAddress 0x82 EP 2 IN > >> bmAttributes 2 > >> Transfer Type Bulk > >> Synch Type None > >> Usage Type Data > >> wMaxPacketSize 0x0040 1x 64 bytes > >> bInterval 0 > >> Device Status: 0x0001 > >> Self Powered > >> > >> > >> On Sat, May 30, 2015 at 5:05 AM, Karl Palsson <ka...@tw...> > wrote: > >>> > >>> > >>> I'm pretty sure you're not actually sending the request that the manual > >>> says. > >>> > >>> Caleb Mayfield <cal...@gm...> wrote: > >>> > I am new to using Python and PyUSB. I am trying to write a program > to > >>> > communicate with a 3M Quest SoundPro sound meter. Because I'm new, > I'm > >>> > starting simple. The vendor was gracious enough to send me the manual > >>> > they > >>> > have on the commands for the unit. Right now all I'm trying to do is > >>> > request the serial number and read the response. I just need to get > >>> > communication between a Raspberry Pi and the device working. I have > >>> > used > >>> > the software on a Windows 7 machine along with a USB sniffer to > verify > >>> > the > >>> > commands and endpoint address were correct. > >>> > > >>> > This is the program; > >>> > > >>> > import usb.core > >>> > > >>> > import usb.util > >>> > > >>> > import sys > >>> > > >>> > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) > >>> > > >>> > if dev is None: > >>> > > >>> > raise ValueError('Device not found') > >>> > > >>> > dev.set_configuration() > >>> > > >>> > print "Connected to " + str(dev) > >>> > > >>> > QS = '0x51,0x53,0x0D' #Call for Serial number > >>> > > >>> > dev.write(0x02,QS,0,0) > >>> > >>> I don't believe this is really right, you're probably meant to send the > >>> three bytes, 0x51, 0x53, 0xd, not the 14 bytes, 0, x,5,1,,,0,x,5,3..... > >>> > >>> You probably just want to do something like... > >>> > >>> dev.write(0x02, "QS\r", 0, 0) > >>> > >>> > >>> If you can share the manual, You can probably get more correct help > than > >>> my asumptions. :) > >>> > >>> Cheers, > >>> Karl P > >>> > >>> > >>> > ------------------------------------------------------------------------------ > >>> > >>> _______________________________________________ > >>> pyusb-users mailing list > >>> pyu...@li... > >>> https://lists.sourceforge.net/lists/listinfo/pyusb-users > >>> > >> > >> > >> > >> -- > >> Caleb Mayfield > >> > >> James 1:19-20 > > > > > > > > > > -- > > Caleb Mayfield > > > > James 1:19-20 > > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > > pyusb-users mailing list > > pyu...@li... > > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > > > -- > Best Regards, > Wander Lairson Costa > > > > ------------------------------ > > > ------------------------------------------------------------------------------ > > > ------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > End of pyusb-users Digest, Vol 81, Issue 1 > ****************************************** > |
From: Wander L. C. <wan...@gm...> - 2015-06-07 03:32:02
|
I blocked a message to this thread due to the attached doc size. I did it because some people subscribed in this mailing list might have slow internet connection. Please, upload the file to a remote site and send a message with the link to download. 2015-06-01 16:52 GMT-03:00 Caleb Mayfield <cal...@gm...>: > SUCCESS!! > I found my error. Apparently I need to claim the device by this program that > I'm running. The new code is as follows (with some new declarations); > > import sys > import usb.core > import usb.util > > > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) > interface = 5 > endpoint = dev[0][(0,0)][0] > > if dev.is_kernel_driver_active(interface) is True: > # tell the kernel to detach > dev.detach_kernel_driver(interface) > # claim the device > usb.util.claim_interface(dev, interface) > > #if dev is None: > # raise ValueError('Device not found') > > dev.set_configuration() > print "Connected to " + str(dev) > > QS="\x51\x53\x0D" #Call for Serial number > BLON="\x42\x4C\x4F\x4E\x0D" #Backlight ON > BLOFF="\x42\x4C\x4F\x46\x46\x0D" #Backlight OFF > > > dev.write(0x02,QS,0,0) > > ret = dev.read(0x82,endpoint.wMaxPacketSize) > sret=''.join([chr(x) for x in ret]) > print "Return Raw: ",ret > print "Return : ", sret > > # release the device > #usb.util.release_interface(dev, interface) > # reattach the device to the OS kernel > #dev.attach_kernel_driver(interface) > > I did get an error the first time when I did not have the last line > commented out. I need to work on that one, but it does work now! I can call > the serial number and turn the back light on and off so the train is > rolling. > > Thanks! > > > > On Mon, Jun 1, 2015 at 8:44 AM, Caleb Mayfield <cal...@gm...> > wrote: >> >> Attached is the manual that was sent to me. One thing to note from the >> person who sent it to me, this was in development and was never completed. >> There is no Appendix C with an example code in it. I'm still learning about >> this level of programming. My experience thus far has been a moderate level >> of Arduino work and some beginner level shell scripting and java. I feel >> like I'm missing something that's right in front of my face, so any help is >> appreciated. >> >> Below is the lsusb -v output for this device. I'm currently working on a >> Pi2 running the 2015-05-05 Raspbian release using Python 2.7.3 for coding. >> >> Bus 001 Device 004: ID 130c:0001 >> Device Descriptor: >> bLength 18 >> bDescriptorType 1 >> bcdUSB 1.01 >> bDeviceClass 255 Vendor Specific Class >> bDeviceSubClass 255 Vendor Specific Subclass >> bDeviceProtocol 255 Vendor Specific Protocol >> bMaxPacketSize0 64 >> idVendor 0x130c >> idProduct 0x0001 >> bcdDevice 1.00 >> iManufacturer 1 Quest Technologies, Inc. >> iProduct 2 Quest Technologies SoundPro SLM >> iSerial 6 BJL060022 >> bNumConfigurations 1 >> Configuration Descriptor: >> bLength 9 >> bDescriptorType 2 >> wTotalLength 32 >> bNumInterfaces 1 >> bConfigurationValue 1 >> iConfiguration 3 Quest Technologies Device >> bmAttributes 0xc0 >> Self Powered >> MaxPower 0mA >> Interface Descriptor: >> bLength 9 >> bDescriptorType 4 >> bInterfaceNumber 0 >> bAlternateSetting 0 >> bNumEndpoints 2 >> bInterfaceClass 255 Vendor Specific Class >> bInterfaceSubClass 255 Vendor Specific Subclass >> bInterfaceProtocol 255 Vendor Specific Protocol >> iInterface 5 Virtual COM >> Endpoint Descriptor: >> bLength 7 >> bDescriptorType 5 >> bEndpointAddress 0x02 EP 2 OUT >> bmAttributes 2 >> Transfer Type Bulk >> Synch Type None >> Usage Type Data >> wMaxPacketSize 0x0040 1x 64 bytes >> bInterval 0 >> Endpoint Descriptor: >> bLength 7 >> bDescriptorType 5 >> bEndpointAddress 0x82 EP 2 IN >> bmAttributes 2 >> Transfer Type Bulk >> Synch Type None >> Usage Type Data >> wMaxPacketSize 0x0040 1x 64 bytes >> bInterval 0 >> Device Status: 0x0001 >> Self Powered >> >> >> On Sat, May 30, 2015 at 5:05 AM, Karl Palsson <ka...@tw...> wrote: >>> >>> >>> I'm pretty sure you're not actually sending the request that the manual >>> says. >>> >>> Caleb Mayfield <cal...@gm...> wrote: >>> > I am new to using Python and PyUSB. I am trying to write a program to >>> > communicate with a 3M Quest SoundPro sound meter. Because I'm new, I'm >>> > starting simple. The vendor was gracious enough to send me the manual >>> > they >>> > have on the commands for the unit. Right now all I'm trying to do is >>> > request the serial number and read the response. I just need to get >>> > communication between a Raspberry Pi and the device working. I have >>> > used >>> > the software on a Windows 7 machine along with a USB sniffer to verify >>> > the >>> > commands and endpoint address were correct. >>> > >>> > This is the program; >>> > >>> > import usb.core >>> > >>> > import usb.util >>> > >>> > import sys >>> > >>> > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) >>> > >>> > if dev is None: >>> > >>> > raise ValueError('Device not found') >>> > >>> > dev.set_configuration() >>> > >>> > print "Connected to " + str(dev) >>> > >>> > QS = '0x51,0x53,0x0D' #Call for Serial number >>> > >>> > dev.write(0x02,QS,0,0) >>> >>> I don't believe this is really right, you're probably meant to send the >>> three bytes, 0x51, 0x53, 0xd, not the 14 bytes, 0, x,5,1,,,0,x,5,3..... >>> >>> You probably just want to do something like... >>> >>> dev.write(0x02, "QS\r", 0, 0) >>> >>> >>> If you can share the manual, You can probably get more correct help than >>> my asumptions. :) >>> >>> Cheers, >>> Karl P >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> pyusb-users mailing list >>> pyu...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyusb-users >>> >> >> >> >> -- >> Caleb Mayfield >> >> James 1:19-20 > > > > > -- > Caleb Mayfield > > James 1:19-20 > > ------------------------------------------------------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Jason E. <jas...@ho...> - 2015-06-06 18:29:08
|
Hi All, I'm about to embark on a journey using pyusb and really want to integrate it with a USB based fingerprint reader. This will be on a machine that all I can install is pyusb (no additional drivers). Is there a recommendation on what make/model/vendor of fingerprint reader should work? I suppose the same question goes for other USB device types too. Thanks! Jason |
From: Jason <jas...@ho...> - 2015-06-06 18:21:45
|
Hi All, I'm about to embark on a journey using pyusb and really want to integrate it with a USB based fingerprint reader. This will be on a machine that all I can install is pyusb (no additional drivers). Is there a recommendation on what make/model/vendor of fingerprint reader should work? I suppose the same question goes for other USB device types too. Thanks! Jason |
From: Caleb M. <cal...@gm...> - 2015-06-01 19:52:19
|
SUCCESS!! I found my error. Apparently I need to claim the device by this program that I'm running. The new code is as follows (with some new declarations); import sys import usb.core import usb.util dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) interface = 5 endpoint = dev[0][(0,0)][0] if dev.is_kernel_driver_active(interface) is True: # tell the kernel to detach dev.detach_kernel_driver(interface) # claim the device usb.util.claim_interface(dev, interface) #if dev is None: # raise ValueError('Device not found') dev.set_configuration() print "Connected to " + str(dev) QS="\x51\x53\x0D" #Call for Serial number BLON="\x42\x4C\x4F\x4E\x0D" #Backlight ON BLOFF="\x42\x4C\x4F\x46\x46\x0D" #Backlight OFF dev.write(0x02,QS,0,0) ret = dev.read(0x82,endpoint.wMaxPacketSize) sret=''.join([chr(x) for x in ret]) print "Return Raw: ",ret print "Return : ", sret # release the device #usb.util.release_interface(dev, interface) # reattach the device to the OS kernel #dev.attach_kernel_driver(interface) I did get an error the first time when I did not have the last line commented out. I need to work on that one, but it does work now! I can call the serial number and turn the back light on and off so the train is rolling. Thanks! On Mon, Jun 1, 2015 at 8:44 AM, Caleb Mayfield <cal...@gm...> wrote: > Attached is the manual that was sent to me. One thing to note from the > person who sent it to me, this was in development and was never completed. > There is no Appendix C with an example code in it. I'm still learning about > this level of programming. My experience thus far has been a moderate level > of Arduino work and some beginner level shell scripting and java. I feel > like I'm missing something that's right in front of my face, so any help is > appreciated. > > Below is the lsusb -v output for this device. I'm currently working on a > Pi2 running the 2015-05-05 Raspbian release using Python 2.7.3 for coding. > > Bus 001 Device 004: ID 130c:0001 > Device Descriptor: > bLength 18 > bDescriptorType 1 > bcdUSB 1.01 > bDeviceClass 255 Vendor Specific Class > bDeviceSubClass 255 Vendor Specific Subclass > bDeviceProtocol 255 Vendor Specific Protocol > bMaxPacketSize0 64 > idVendor 0x130c > idProduct 0x0001 > bcdDevice 1.00 > iManufacturer 1 Quest Technologies, Inc. > iProduct 2 Quest Technologies SoundPro SLM > iSerial 6 BJL060022 > bNumConfigurations 1 > Configuration Descriptor: > bLength 9 > bDescriptorType 2 > wTotalLength 32 > bNumInterfaces 1 > bConfigurationValue 1 > iConfiguration 3 Quest Technologies Device > bmAttributes 0xc0 > Self Powered > MaxPower 0mA > Interface Descriptor: > bLength 9 > bDescriptorType 4 > bInterfaceNumber 0 > bAlternateSetting 0 > bNumEndpoints 2 > bInterfaceClass 255 Vendor Specific Class > bInterfaceSubClass 255 Vendor Specific Subclass > bInterfaceProtocol 255 Vendor Specific Protocol > iInterface 5 Virtual COM > Endpoint Descriptor: > bLength 7 > bDescriptorType 5 > bEndpointAddress 0x02 EP 2 OUT > bmAttributes 2 > Transfer Type Bulk > Synch Type None > Usage Type Data > wMaxPacketSize 0x0040 1x 64 bytes > bInterval 0 > Endpoint Descriptor: > bLength 7 > bDescriptorType 5 > bEndpointAddress 0x82 EP 2 IN > bmAttributes 2 > Transfer Type Bulk > Synch Type None > Usage Type Data > wMaxPacketSize 0x0040 1x 64 bytes > bInterval 0 > Device Status: 0x0001 > Self Powered > > > On Sat, May 30, 2015 at 5:05 AM, Karl Palsson <ka...@tw...> wrote: > >> >> I'm pretty sure you're not actually sending the request that the manual >> says. >> >> Caleb Mayfield <cal...@gm...> wrote: >> > I am new to using Python and PyUSB. I am trying to write a program to >> > communicate with a 3M Quest SoundPro sound meter. Because I'm new, I'm >> > starting simple. The vendor was gracious enough to send me the manual >> > they >> > have on the commands for the unit. Right now all I'm trying to do is >> > request the serial number and read the response. I just need to get >> > communication between a Raspberry Pi and the device working. I have used >> > the software on a Windows 7 machine along with a USB sniffer to verify >> > the >> > commands and endpoint address were correct. >> > >> > This is the program; >> > >> > import usb.core >> > >> > import usb.util >> > >> > import sys >> > >> > dev = usb.core.find(idVendor=0x130c, idProduct=0x0001) >> > >> > if dev is None: >> > >> > raise ValueError('Device not found') >> > >> > dev.set_configuration() >> > >> > print "Connected to " + str(dev) >> > >> > QS = '0x51,0x53,0x0D' #Call for Serial number >> > >> > dev.write(0x02,QS,0,0) >> >> I don't believe this is really right, you're probably meant to send the >> three bytes, 0x51, 0x53, 0xd, not the 14 bytes, 0, x,5,1,,,0,x,5,3..... >> >> You probably just want to do something like... >> >> dev.write(0x02, "QS\r", 0, 0) >> >> >> If you can share the manual, You can probably get more correct help than >> my asumptions. :) >> >> Cheers, >> Karl P >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> >> > > > -- > Caleb Mayfield > > James 1:19-20 > -- Caleb Mayfield James 1:19-20 |
From: Wander L. C. <wan...@gm...> - 2015-05-31 14:46:55
|
2015-05-30 9:42 GMT-03:00 UNIVERSAL PHONE <uni...@gm...>: > Hi, > > > this is my program: > > import usb.util > import usb.core > import sys > > dev=usb.core.find() > dev.set_configuration() > > this is the error message: > > usb.core.USBError:could not set config 1: Device or resource busy > > > > What's wrong with my program ? > What Operating System are you using? -- Best Regards, Wander Lairson Costa |
From: UNIVERSAL P. <uni...@gm...> - 2015-05-30 12:43:04
|
Hi, this is my program: *import usb.util* *import usb.core* *import sys* *dev=usb.core.find()* *dev.set_configuration()* this is the error message: *usb.core.USBError:could not set config 1: Device or resource busy* *What's wrong with my program ?* |