Discussion:
[pyusb-users] pyusb-users Digest, Vol 81, Issue 1
UNIVERSAL PHONE
2015-06-08 01:28:53 UTC
Permalink
Send pyusb-users mailing list submissions to
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
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of pyusb-users digest..."
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
Subject: Re: [pyusb-users] (no subject)
<CAFsSK4bbWhZ-Q6nUDZqWDFMVx9qRwvETN47=
Content-Type: text/plain; charset=UTF-8
Hi,
import usb.util
import usb.core
import sys
dev=usb.core.find()
dev.set_configuration()
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
Subject: Re: [pyusb-users] USBError: Operation timed out
<
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]
# tell the kernel to detach
dev.detach_kernel_driver(interface)
# claim the device
usb.util.claim_interface(dev, interface)
# 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!
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
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
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 3 Quest Technologies Device
bmAttributes 0xc0
Self Powered
MaxPower 0mA
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
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
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
I'm pretty sure you're not actually sending the request that the manual
says.
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)
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
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
Subject: [pyusb-users] USB fingerprint scanner
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
Subject: [pyusb-users] USB Fingerprint Reader
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
Subject: Re: [pyusb-users] USBError: Operation timed out
<CAFsSK4b_HfsZEwjYtVPZ3C09_y8WsxxDdNOUgkh-nSB=
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.
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]
# tell the kernel to detach
dev.detach_kernel_driver(interface)
# claim the device
usb.util.claim_interface(dev, interface)
# 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!
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
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
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 3 Quest Technologies Device
bmAttributes 0xc0
Self Powered
MaxPower 0mA
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
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
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
I'm pretty sure you're not actually sending the request that the manual
says.
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)
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
https://lists.sourceforge.net/lists/listinfo/pyusb-users
--
Caleb Mayfield
James 1:19-20
--
Caleb Mayfield
James 1:19-20
------------------------------------------------------------------------------
_______________________________________________
pyusb-users mailing list
https://lists.sourceforge.net/lists/listinfo/pyusb-users
--
Best Regards,
Wander Lairson Costa
------------------------------
------------------------------------------------------------------------------
------------------------------
_______________________________________________
pyusb-users mailing list
https://lists.sourceforge.net/lists/listinfo/pyusb-users
End of pyusb-users Digest, Vol 81, Issue 1
******************************************
Loading...