2015-06-06 23:32 GMT-04:00 <pyusb-users-requ...@lists.sourceforge.net>:
> Send pyusb-users mailing list submissions to > pyusb-users@lists.sourceforge.net > > 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 > pyusb-users-requ...@lists.sourceforge.net > > You can reach the person managing the list at > pyusb-users-ow...@lists.sourceforge.net > > 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 <wander.lair...@gmail.com> > Subject: Re: [pyusb-users] (no subject) > To: pyusb-users <pyusb-users@lists.sourceforge.net> > Message-ID: > <CAFsSK4bbWhZ-Q6nUDZqWDFMVx9qRwvETN47= > jbt7ga3z+g5...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > 2015-05-30 9:42 GMT-03:00 UNIVERSAL PHONE <universal.phone....@gmail.com>: > > 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 <caleb.mayfi...@gmail.com> > Subject: Re: [pyusb-users] USBError: Operation timed out > To: pyusb-users@lists.sourceforge.net > Message-ID: > < > cal4xwe-yqsfoveyjrp-yhxf602ho93pjafmnoyou1qr_kww...@mail.gmail.com> > 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 <caleb.mayfi...@gmail.com> > 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...@tweak.net.au> > wrote: > > > >> > >> I'm pretty sure you're not actually sending the request that the manual > >> says. > >> > >> Caleb Mayfield <caleb.mayfi...@gmail.com> 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 > >> pyusb-users@lists.sourceforge.net > >> 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 <jason_edel...@hotmail.com> > Subject: [pyusb-users] USB fingerprint scanner > To: pyusb-users@lists.sourceforge.net > Message-ID: <snt404-eas933538941c156bd664ed5483...@phx.gbl> > 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 <jason_edel...@hotmail.com> > Subject: [pyusb-users] USB Fingerprint Reader > To: "pyusb-users@lists.sourceforge.net" > <pyusb-users@lists.sourceforge.net> > Message-ID: <snt404-eas4257a48a49aab1e49188e5283...@phx.gbl> > 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 <wander.lair...@gmail.com> > Subject: Re: [pyusb-users] USBError: Operation timed out > To: pyusb-users <pyusb-users@lists.sourceforge.net> > Message-ID: > <CAFsSK4b_HfsZEwjYtVPZ3C09_y8WsxxDdNOUgkh-nSB= > htx...@mail.gmail.com> > 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 <caleb.mayfi...@gmail.com>: > > 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 <caleb.mayfi...@gmail.com > > > > 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...@tweak.net.au> > wrote: > >>> > >>> > >>> I'm pretty sure you're not actually sending the request that the manual > >>> says. > >>> > >>> Caleb Mayfield <caleb.mayfi...@gmail.com> 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 > >>> pyusb-users@lists.sourceforge.net > >>> https://lists.sourceforge.net/lists/listinfo/pyusb-users > >>> > >> > >> > >> > >> -- > >> Caleb Mayfield > >> > >> James 1:19-20 > > > > > > > > > > -- > > Caleb Mayfield > > > > James 1:19-20 > > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > > pyusb-users mailing list > > pyusb-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > > > -- > Best Regards, > Wander Lairson Costa > > > > ------------------------------ > > > ------------------------------------------------------------------------------ > > > ------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > End of pyusb-users Digest, Vol 81, Issue 1 > ****************************************** >
------------------------------------------------------------------------------
_______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users