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: Phil H. <ph...@ha...> - 2008-12-22 15:29:02
|
Wander Lairson wrote: > What are the constants PLUG_BULK_IN_EP and PLUG_BULK_OUT_EP? > They are: PLUG_BULK_IN_EP = 0x2 PLUG_BULK_OUT_EP = 0x81 The device enumerates to: Device: 006 Device class: 255 Device sub class: 0 Device protocol: 255 Max packet size: 8 idVendor: 2259 idProduct: 1 Device Version: 00.01 Configuration: 1 Total length: 32 selfPowered: 0 remoteWakeup: 0 maxPower: 200 Interface: 0 Alternate Setting: 0 Interface class: 255 Interface sub class: 0 Interface protocol: 255 Endpoint: 0x81L Type: 3 Max packet size: 8 Interval: 1 Endpoint: 0x2L Type: 3 Max packet size: 8 Interval: 1 I have just been googling some more and found this: http://osdir.com/mlpython.pyusb.user/2008-05/msg00001.html Where the suggestion is to claim the interface. This is my open function: def open(self) : self.device = self.device_descriptor.getDevice() self.handle = self.device.open() self.handle.reset() if sys.platform == 'darwin' : # XXX : For some reason, Mac OS X doesn't set the # configuration automatically like Linux does. self.handle.setConfiguration(1) self.handle.claimInterface(self.device_descriptor.interface_id) What do you think? |
From: Wander L. <wan...@gm...> - 2008-12-22 15:24:38
|
What are the constants PLUG_BULK_IN_EP and PLUG_BULK_OUT_EP? 2008/12/23 Phil Hannent <ph...@ha...>: > Hello, > > Wander Lairson wrote: >> Well, I think you are doing things in the right way, may be the >> problem is a device protocol issue. Perhaps you are issuing the wrong >> command to get what you want... How do you get the storage capacity? >> How many bytes are expected to return? Please, post the code here >> (with comments). >> > > Thanks for the reply, I am going to try an paste functions to see if it > helps: > > This section says hello to the device in question and works just fine. > > sent_bytes = > self.handle.interruptWrite(PlugUSBDevice.PLUG_BULK_IN_EP, > PlugUSBDevice.MIMIO_HELLO, 1000) > print "Sent hello" > if sent_bytes: > read_bytes = > self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,8); > self.readDevice(read_bytes) > > readDevice starts: > def readDevice(self, response): > #response = > self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,8); > if response: > print "readDevice", response > if response == PlugUSBDevice.MAX_PACKET_SIZE: > return > #print response > #firstByte = response[0] > #print firstByte > #print [hex(d) for d in response] > if response[0] == 0x21: > print "Device responded to hello" > self.devicestate = response[1] > > And I get the device telling me it responded. I can now issue several > other commands which query the storage information in a similar way and > get the information I expect. My main issue is that I cannot issue a > data transmit command and get pen xy coordinates, I just get: > usb.USBError: No error > > I start it by issuing a command like the others: > def startDataXmit(self, timeout = 100): > sent_bytes = > self.handle.interruptWrite(PlugUSBDevice.PLUG_BULK_IN_EP, > PlugUSBDevice.MIMIO_STARTDATATRANS, 1000) > if sent_bytes: > read_bytes = > self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,sent_bytes); > self.readDevice(read_bytes) > print "startDataXmit" > > Then in a loop I call: > def getDataPacket(self, bytesToGet) : > """ > Assume bytesToGet is two bytes wide. > """ > print "getDataPacket" > read_bytes = > self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,bytesToGet); > #read_bytes = > self.handle.bulkRead(PlugUSBDevice.PLUG_BULK_OUT_EP,bytesToGet,1000) > self.readDevice(read_bytes) > > Where I get the "No error" error on the interruptRead line. The > documentation for the protocol does not talk about low level USB details > only that the if the data becomes out of sync I must issue a stop > command and re-sync the communication channel (of which I am not sure > what that is). > > Any hints on the "No error" problem? > > Regards > Phil Hannent > > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Phil H. <ph...@ha...> - 2008-12-22 15:10:05
|
Hello, Wander Lairson wrote: > Well, I think you are doing things in the right way, may be the > problem is a device protocol issue. Perhaps you are issuing the wrong > command to get what you want... How do you get the storage capacity? > How many bytes are expected to return? Please, post the code here > (with comments). > Thanks for the reply, I am going to try an paste functions to see if it helps: This section says hello to the device in question and works just fine. sent_bytes = self.handle.interruptWrite(PlugUSBDevice.PLUG_BULK_IN_EP, PlugUSBDevice.MIMIO_HELLO, 1000) print "Sent hello" if sent_bytes: read_bytes = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,8); self.readDevice(read_bytes) readDevice starts: def readDevice(self, response): #response = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,8); if response: print "readDevice", response if response == PlugUSBDevice.MAX_PACKET_SIZE: return #print response #firstByte = response[0] #print firstByte #print [hex(d) for d in response] if response[0] == 0x21: print "Device responded to hello" self.devicestate = response[1] And I get the device telling me it responded. I can now issue several other commands which query the storage information in a similar way and get the information I expect. My main issue is that I cannot issue a data transmit command and get pen xy coordinates, I just get: usb.USBError: No error I start it by issuing a command like the others: def startDataXmit(self, timeout = 100): sent_bytes = self.handle.interruptWrite(PlugUSBDevice.PLUG_BULK_IN_EP, PlugUSBDevice.MIMIO_STARTDATATRANS, 1000) if sent_bytes: read_bytes = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,sent_bytes); self.readDevice(read_bytes) print "startDataXmit" Then in a loop I call: def getDataPacket(self, bytesToGet) : """ Assume bytesToGet is two bytes wide. """ print "getDataPacket" read_bytes = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,bytesToGet); #read_bytes = self.handle.bulkRead(PlugUSBDevice.PLUG_BULK_OUT_EP,bytesToGet,1000) self.readDevice(read_bytes) Where I get the "No error" error on the interruptRead line. The documentation for the protocol does not talk about low level USB details only that the if the data becomes out of sync I must issue a stop command and re-sync the communication channel (of which I am not sure what that is). Any hints on the "No error" problem? Regards Phil Hannent |
From: Wander L. <wan...@gm...> - 2008-12-22 14:10:12
|
Well, I think you are doing things in the right way, may be the problem is a device protocol issue. Perhaps you are issuing the wrong command to get what you want... How do you get the storage capacity? How many bytes are expected to return? Please, post the code here (with comments). 2008/12/22 Phil Hannent <ph...@ha...>: > Hello, > > All appears to be going to plan, I have sent a hello to my device and > got a hello back (via interruptWrite then interruptRead). > > I can query the devices current key state using the same interruptWrite > then Read, however the next time I send a query asking it about its > storage capacity it returns random data. > > Is there something I have to do to clear a buffer? Again if I send the > hello and ask the device to enter transmit mode (where pen coordinates > are issued) I just get junk out. > > I guess I am failing to understand just how to receive data from a USB > device. The data I am getting is not an out of sequence packet so I do > not understand, what the data is. > > I could do with some more examples, do people have any that are not: > missle.py > lsusb.py > usbenum.py > PlugUSB.py > gotemp-pyusb.py > > Which are all the examples I have found on the internet. > > Regards > Phil Hannent > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Phil H. <ph...@ha...> - 2008-12-22 10:02:26
|
Hi, Is there an IRC or Jabber (XMPP) chat room for talking about things PyUSB related? Regards Phil Hannent |
From: Phil H. <ph...@ha...> - 2008-12-22 09:47:49
|
Hello, All appears to be going to plan, I have sent a hello to my device and got a hello back (via interruptWrite then interruptRead). I can query the devices current key state using the same interruptWrite then Read, however the next time I send a query asking it about its storage capacity it returns random data. Is there something I have to do to clear a buffer? Again if I send the hello and ask the device to enter transmit mode (where pen coordinates are issued) I just get junk out. I guess I am failing to understand just how to receive data from a USB device. The data I am getting is not an out of sequence packet so I do not understand, what the data is. I could do with some more examples, do people have any that are not: missle.py lsusb.py usbenum.py PlugUSB.py gotemp-pyusb.py Which are all the examples I have found on the internet. Regards Phil Hannent |
From: Phil H. <ph...@ha...> - 2008-12-19 15:26:34
|
Phil Hannent wrote: > When I do: > read_bytes = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,sent_bytes); > > How can I split the read_bytes so that I can read each byte individually? > > if I print it I just get: > (33, 1, 32) > Ok, so I figured out that if I read while there was nothing to read I got the count of sent_bytes which I cannot iterate over, I just put in a clause that tested sent_bytes == read_bytes to prevent that, so I could later read the tuple with read_bytes[0]. Thanks anyway. Phil |
From: Phil H. <ph...@ha...> - 2008-12-19 12:18:46
|
Hello, I have managed to send a hello to my hardware and got a response back, which is half the battle with these things. So I am over the moon. The data I contains information I want to read. The packet is broken down into a header, data and then an xor checksum of the header and data. When I do: read_bytes = self.handle.interruptRead(PlugUSBDevice.PLUG_BULK_OUT_EP,sent_bytes); How can I split the read_bytes so that I can read each byte individually? if I print it I just get: (33, 1, 32) (And yes this is my first Python program) Regards Phil Hannent |
From: Wander L. <wan...@gm...> - 2008-12-19 02:41:17
|
Read the the limit quantity of bytes. If there is less bytes, they will be returned... 2008/12/19 Santiago Palomino Sanchez-Manjavacas <sp...@gm...>: > Hi, The thing is that you can always send 64 bytes as normal packet, and in > some cases, do not use all of them. > > Another approach es that the interrupt will trigger a bulk read of a > variable size determined by what the interrupt packet says. But in that > case, you will have several usb transactions, and the result might be > slower. You may have a mixed approach, in which the interrupt packet holds > 64 bytes always, and sometimes it reflects the need for a bulk read. (For > longer commands). > > > On Thu, Dec 18, 2008 at 4:03 PM, Phil Hannent <ph...@ha...> wrote: >> >> Hello, >> >> I am trying to write a driver for an interactive whiteboard. >> >> The device needs to be put into a state that will get it sending the pen >> data. >> >> However I have been looking examples on the internet and when using >> interruptRead or bulkRead you have to specify the number of bytes you are >> expecting. >> >> There are 30+ commands in the protocol with the device with a length which >> will >> be unknown until I read the first byte. >> >> I want to have a control loop that will read the interrupt and respond to >> that >> data. With a user interface sending change of state commands. >> >> Does anybody have an example of the use of interruptRead and >> interruptWrite? >> >> Regards >> Phil Hannent >> >> >> >> ------------------------------------------------------------------------------ >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >> Nevada. >> The future of the web can't happen without you. Join us at MIX09 to help >> pave the way to the Next Web now. Learn more and register at >> >> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >> _______________________________________________ >> Pyusb-users mailing list >> Pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Santiago P. Sanchez-M. <sp...@gm...> - 2008-12-18 15:08:02
|
Hi, The thing is that you can always send 64 bytes as normal packet, and in some cases, do not use all of them. Another approach es that the interrupt will trigger a bulk read of a variable size determined by what the interrupt packet says. But in that case, you will have several usb transactions, and the result might be slower. You may have a mixed approach, in which the interrupt packet holds 64 bytes always, and sometimes it reflects the need for a bulk read. (For longer commands). On Thu, Dec 18, 2008 at 4:03 PM, Phil Hannent <ph...@ha...> wrote: > Hello, > > I am trying to write a driver for an interactive whiteboard. > > The device needs to be put into a state that will get it sending the pen > data. > > However I have been looking examples on the internet and when using > interruptRead or bulkRead you have to specify the number of bytes you are > expecting. > > There are 30+ commands in the protocol with the device with a length which > will > be unknown until I read the first byte. > > I want to have a control loop that will read the interrupt and respond to > that > data. With a user interface sending change of state commands. > > Does anybody have an example of the use of interruptRead and > interruptWrite? > > Regards > Phil Hannent > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Phil H. <ph...@ha...> - 2008-12-18 15:00:28
|
Hello, I am trying to write a driver for an interactive whiteboard. The device needs to be put into a state that will get it sending the pen data. However I have been looking examples on the internet and when using interruptRead or bulkRead you have to specify the number of bytes you are expecting. There are 30+ commands in the protocol with the device with a length which will be unknown until I read the first byte. I want to have a control loop that will read the interrupt and respond to that data. With a user interface sending change of state commands. Does anybody have an example of the use of interruptRead and interruptWrite? Regards Phil Hannent |
From: Santiago P. Sanchez-M. <sp...@gm...> - 2008-12-15 15:19:10
|
I think you need to release (de-claim) the device before closing your app. handle.close() maybe ... long time since I programmed with the lib On Mon, Dec 15, 2008 at 2:24 PM, Christopher Moore <chr...@bn...>wrote: > Please forgive the cross-post with libusb, but I was wondering if there > was a specific pyUSB solution to my problem. > > Hey everyone, > > I'm encountering a problem with my script (it's Python) that causes my > program to crash, probably mid-transfer between the program and the usb > device (in my case this is a usb phone). > > When I try to re-launch my program, it gives me the following error: > > handle.getDescriptor(usb.DT_REPORT,0,0x9c,usb.ENDPOINT_OUT) > usb.USBError: error sending control message: Timer expired > > Basically, when my program starts, it tries to find the device, via a for > loop through the usb busses. It verifies what it finds against a > vendor/product ID and then tries to get a report descriptor from the > device (as seen above). > > If I try to re-launch my program, I always get this error and the only way > around this is to physically re-plug my device. > > I've tried to "re-claim" the interface and also do a "reset" on the > device, but neither work. > > below is a snippet of the relevant code: > > -------------------- > > def phone_INITIALIZE(): > """this function initializes and takes control of the phone so we > can > communicate with it""" > > global handle > global endpoint > > # linksys CIT200 Device Info > vendor_id = 5041 > product_id = 29 > > buses = usb.busses() > > for bus in buses : > for device in bus.devices : > if device.idVendor == vendor_id : > if device.idProduct == product_id : > # found the CIT200 > print "Found Linksys Device ..." > linksys = device > > # open device > handle = linksys.open() > > # setup interface and configs ... there are 4 interfaces for this > device... > config = linksys.configurations[0] > interface = config.interfaces[3][0] > endpoint = interface.endpoints[0] > > try: > # claim and set the interface > handle.claimInterface(interface) > handle.setAltInterface(interface) > except usb.USBError: > # detach the hid interface > handle.detachKernelDriver(3) > > # get device descriptor > handle.getDescriptor(usb.DT_REPORT,0,0x9c,usb.ENDPOINT_OUT) > > # send idle message > handle.controlMsg(0x21,0x0a,0,0,0x03) > > -------------------- > > Any help would be appreciated. > > Thanks > > Christopher > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Christopher M. <chr...@bn...> - 2008-12-15 14:05:45
|
Please forgive the cross-post with libusb, but I was wondering if there was a specific pyUSB solution to my problem. Hey everyone, I'm encountering a problem with my script (it's Python) that causes my program to crash, probably mid-transfer between the program and the usb device (in my case this is a usb phone). When I try to re-launch my program, it gives me the following error: handle.getDescriptor(usb.DT_REPORT,0,0x9c,usb.ENDPOINT_OUT) usb.USBError: error sending control message: Timer expired Basically, when my program starts, it tries to find the device, via a for loop through the usb busses. It verifies what it finds against a vendor/product ID and then tries to get a report descriptor from the device (as seen above). If I try to re-launch my program, I always get this error and the only way around this is to physically re-plug my device. I've tried to "re-claim" the interface and also do a "reset" on the device, but neither work. below is a snippet of the relevant code: -------------------- def phone_INITIALIZE(): """this function initializes and takes control of the phone so we can communicate with it""" global handle global endpoint # linksys CIT200 Device Info vendor_id = 5041 product_id = 29 buses = usb.busses() for bus in buses : for device in bus.devices : if device.idVendor == vendor_id : if device.idProduct == product_id : # found the CIT200 print "Found Linksys Device ..." linksys = device # open device handle = linksys.open() # setup interface and configs ... there are 4 interfaces for this device... config = linksys.configurations[0] interface = config.interfaces[3][0] endpoint = interface.endpoints[0] try: # claim and set the interface handle.claimInterface(interface) handle.setAltInterface(interface) except usb.USBError: # detach the hid interface handle.detachKernelDriver(3) # get device descriptor handle.getDescriptor(usb.DT_REPORT,0,0x9c,usb.ENDPOINT_OUT) # send idle message handle.controlMsg(0x21,0x0a,0,0,0x03) -------------------- Any help would be appreciated. Thanks Christopher |
From: Ralf B. <ral...@gm...> - 2008-12-10 17:08:35
|
Hi again, short update: I just managed to make it work. For reasons I don't understand it was sufficient to add a read request directly after the write. So now my methods are like this: def sendCommand(self, cmd): buffer = ([0,] * 2) buffer[0] = cmd buffer[1] = 0 self.write(buffer) return self.read(64) def write(self, buffer, timeout = 100): return self.handle.interruptWrite(self.ep_out.address, buffer, timeout) The device is reacting and I can finally go home ;-) But if you have any recommendations or critic on the way I do it, it would interest me anyway! best regards, Ralf Am 10.12.2008 um 17:50 schrieb Ralf Baumbach: > Hi, > > I'm trying to talk with an eMagin Z800 HMD (HID device) via usb on > OS X 10.4 (later also on linux). > The necessary information comes directly from the eMagin SDK, so > that I know what commands the device is expecting. I also created > an empty kext a while ago that keeps OS X of opening the device > exclusively (though I don't know if it's important). > > My problem is that there is no reaction from the device. For a > start I try to put it in sleep and to wake it up, but obviously it > doesn't work. I checked with another example that I wrote a while > ago in C++ (though I don't know C++, but I copied a lot of example > code from Apples IOKit documentation) that is capable of doing what > I want to do. So I checked and it's working, but it's not working > when I have claimed the interface with PyUSB. I take this as a > prove that the connection (via PyUSB) to the device is successfully > established (I can also read from the device). > > In the python script that I wrote I did basically the same as what > happened in the C++ code. It's the same device, configuration, > interface, endpoints ... everything should be the same. > But I cannot make it do what I want, so I think it will be just a > lack of knowledge on my side. But it surprised me, that it doesn't > work as I expected, given the fact that I even managed to make it > work in C++ ;-) > > Here is what I try to write to the interrupt endpoint: > buffer = ([0,] * 64) > buffer[0] = cmd > buffer[1] = 0 > result = self.write(buffer) > > cmd is on of: > cmdSleep = 0x85 > cmdWake = 0x8A > cmdBrightness = 0x88 > (eMagin SDK) > > The write method is taken from the usbprint.py sample of PyUSB, > just a little bit adapted: > def write(self, buffer, timeout = 100): > return self.handle.interruptWrite(self.ep_out.address, buffer, > timeout) > > ep_out is an endpoint object. > > When I print out the result I see that 64 Bytes have been written. > But there is no reaction from the device. No errors neither. > I'm not a great expert on python, usb or data types, so I hope > there's something obvious that I'm missing. > > If you need more information to be able to understand the problem, > I will give it gladly on demand of course. > > thanks for reading, > Ralf |
From: Ralf B. <ral...@gm...> - 2008-12-10 16:49:31
|
Hi, I'm trying to talk with an eMagin Z800 HMD (HID device) via usb on OS X 10.4 (later also on linux). The necessary information comes directly from the eMagin SDK, so that I know what commands the device is expecting. I also created an empty kext a while ago that keeps OS X of opening the device exclusively (though I don't know if it's important). My problem is that there is no reaction from the device. For a start I try to put it in sleep and to wake it up, but obviously it doesn't work. I checked with another example that I wrote a while ago in C++ (though I don't know C++, but I copied a lot of example code from Apples IOKit documentation) that is capable of doing what I want to do. So I checked and it's working, but it's not working when I have claimed the interface with PyUSB. I take this as a prove that the connection (via PyUSB) to the device is successfully established (I can also read from the device). In the python script that I wrote I did basically the same as what happened in the C++ code. It's the same device, configuration, interface, endpoints ... everything should be the same. But I cannot make it do what I want, so I think it will be just a lack of knowledge on my side. But it surprised me, that it doesn't work as I expected, given the fact that I even managed to make it work in C++ ;-) Here is what I try to write to the interrupt endpoint: buffer = ([0,] * 64) buffer[0] = cmd buffer[1] = 0 result = self.write(buffer) cmd is on of: cmdSleep = 0x85 cmdWake = 0x8A cmdBrightness = 0x88 (eMagin SDK) The write method is taken from the usbprint.py sample of PyUSB, just a little bit adapted: def write(self, buffer, timeout = 100): return self.handle.interruptWrite(self.ep_out.address, buffer, timeout) ep_out is an endpoint object. When I print out the result I see that 64 Bytes have been written. But there is no reaction from the device. No errors neither. I'm not a great expert on python, usb or data types, so I hope there's something obvious that I'm missing. If you need more information to be able to understand the problem, I will give it gladly on demand of course. thanks for reading, Ralf |
From: Wander L. <wan...@gm...> - 2008-09-18 14:04:36
|
Also, may be a device driver is loaded to yout device. Wander 2008/9/18 Karl Ostmo <ko...@pu...>: > You probably need root access. Use sudo or su. > > Karl > > > On Thu, Sep 18, 2008 at 1:21 AM, Nguyễn Hồng Quân <ng....@gm...> > wrote: >> >> Hello. >> I'm trying to use PyUSB to write a program communicating PC - PIC >> microcontroller. First, I tried with my USB Flashdisk and Bluetooth >> dongle. But when I used the function handle.claimInterface(0), I >> received an error: "could not claim interface 0: Operation not >> permitted" >> Please explain me this error and instruct me the way to be able to >> communicate with my device. >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Pyusb-users mailing list >> Pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Karl O. <ko...@pu...> - 2008-09-18 05:24:06
|
You probably need root access. Use sudo or su. Karl On Thu, Sep 18, 2008 at 1:21 AM, Nguyễn Hồng Quân <ng....@gm...>wrote: > Hello. > I'm trying to use PyUSB to write a program communicating PC - PIC > microcontroller. First, I tried with my USB Flashdisk and Bluetooth > dongle. But when I used the function handle.claimInterface(0), I > received an error: "could not claim interface 0: Operation not > permitted" > Please explain me this error and instruct me the way to be able to > communicate with my device. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Nguyễn H. Q. <ng....@gm...> - 2008-09-18 05:21:57
|
Hello. I'm trying to use PyUSB to write a program communicating PC - PIC microcontroller. First, I tried with my USB Flashdisk and Bluetooth dongle. But when I used the function handle.claimInterface(0), I received an error: "could not claim interface 0: Operation not permitted" Please explain me this error and instruct me the way to be able to communicate with my device. |
From: Wander L. <wan...@gm...> - 2008-09-06 19:50:37
|
Hi Santiago, The answer is yes. I'm planning a new version of PyUSB supporting libusb 0.1, libusb 1.0 and openusb. Unfortunately, I have no idea when this new release will be... Wander 2008/9/6 Santiago Palomino Sanchez-Manjavacas <sp...@gm...>: > Hi, > > I have been reading a bit, and I found that libusb0.1 did not support > isochronous transfers. Are there any plans to update to libusb 1.0 and > support them? > > Thanks in advance > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Santiago P. Sanchez-M. <sp...@gm...> - 2008-09-06 09:13:05
|
Hi, I have been reading a bit, and I found that libusb0.1 did not support isochronous transfers. Are there any plans to update to libusb 1.0 and support them? Thanks in advance |
From: Christopher M. <chr...@bn...> - 2008-09-04 02:44:03
|
> ideally, you should be able to download a driver for this thing, and > that'll do the read/write stuff automatically... check the manufacturer's > website & tech support FIRST. Unfortunately this device only has windows drivers. I can successfully use it through a vmware window (I'm in linux). Unfortunately the manufacturer has nothing on their page at all about USB specs for this thing and from what I've been reading around on the internet, haven't been replying with the information either. > > If you're trying to write a driver, or otherwise want to hack into the > device so that it interfaces nicely with another program, you'll need > detailed spec's on how the USB interface is supposed to work. Start with > the USB 2.0 specification at http://www.usb.org/developers/docs/ > > You should also see if the manufacturer has a "Programmer Manual" or some > such available. You shouldn't need claimInterface() or I wish they did, I have gone through and run usbsnoop (in windows). I just figured out what it's doing now. Now I have to figure out how to get the data into a controlMsg command. > > Once you've got that, use the pyusb controlMsg() commands (see > http://wiki.erazor-zone.de/wiki:projects:python:pyusb:pydoc > ) > to pull out the device's bDeviceClass, bDeviceSubClass, and > bDeviceProtocol. (The table for conversion between the bDeviceClass > number and the natural-language class name is on the same USB.org > documentation page.) cool. I'll check that out. > Then look up the spec's for those at the USB.org page above. Those will > tell you the formats this device requires for read/write commands to do > things which a user might find interesting / useful. > > -Sarah > Thanks Sarah, I'm getting there with everyone's help (this forum and libusb have been great so far - and I've only posted 1 day ago). Just a general update. This is what I've been able to figure out so far: I now know that interface #3 is the HID device on this phone. >From what I gather from my "initialization log": 1) After 2 sets of information are sent?(it says - USBD_TRANSFER_DIRECTION_OUT ), setup packets are sent. 2) Some more data is sent received by the device (USBD_TRANSFER_DIRECTION_IN) via the endpoint (83) of the HID interface, the 2 audio interfaces have their configurations loaded. 3) #1 is repeated again 4) #2 is repeated, except the TransferMDL values are different. Now I just have to figure out exactly what this means (I'll look at those usb docs) and then piece that together into some controlMsg strings. Will I have to read back the interrupts after I send a control message? I've seen this in an example I came across from somewhere. Is the purpose of this to get a return on the status of the controlMsg command? Thanks. > > --- On Tue, 9/2/08, Christopher Moore <chr...@bn...> wrote: > >> From: Christopher Moore <chr...@bn...> >> Subject: [Pyusb-users] Newbie Question >> To: pyu...@li... >> Date: Tuesday, September 2, 2008, 6:58 PM >> Hey everyone, >> >> I'm trying to write my first program with pyUSB. I >> have already figured >> out how to identify my device, open it, add it to a handle, >> close it and >> claim it's interface. >> >> Here's my situation: >> >> The kernel recognizes my device ( a linksys cit200) as a >> device already >> and it actually shows up as a plughw device. The problem >> is the device is >> not "activated" My question is, do I have to >> claimInterface this device >> to send/receive signals to it? For now, I just want to see >> if I can >> "enable/activate" it, so the mic/speaker will >> work on the thing. >> >> Right now, in order for me to claim the interface, I have >> to >> detachKernelDriver each interface (there are 4 of them, 3 >> alsa/sound, 1 >> hid), then setConfiguration, then claimInterface. In doing >> so, I lose ... >> it showing up as those devices. >> >> >> Example Code: >> --------------------------------------------- >> import usb >> >> # linksys CIT200 Device Info >> vendor_id = 5041 >> product_id = 29 >> >> buses = usb.busses() >> >> for bus in buses : >> for device in bus.devices : >> if device.idVendor == vendor_id : >> if device.idProduct == product_id : >> # found the CIT200 >> linksys = device >> >> # open device >> handle = linksys.open() >> >> >> # setup interface and configs ... there are 4 interfaces >> for this device... >> config = linksys.configurations[0] >> interface = config.interfaces[0][0] >> >> # detach kernel drivers >> handle.detachKernelDriver(0) >> handle.detachKernelDriver(1) >> handle.detachKernelDriver(2) >> handle.detachKernelDriver(3) >> >> # set configuration and claim interface(s?) >> handle.setConfiguration(config) >> handle.claimInterface(interface) >> handle.setAltInterface(interface) >> --------------------------------------------- >> >> >> Any help would be appreciated. I will probably have a few >> more questions >> to follow :) >> >> Thanks >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move >> Developer's challenge >> Build the coolest Linux based applications with Moblin SDK >> & win great prizes >> Grand prize is a trip for two to an Open Source event >> anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Pyusb-users mailing list >> Pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > > > |
From: Sarah M. <iku...@ya...> - 2008-09-04 00:49:51
|
ideally, you should be able to download a driver for this thing, and that'll do the read/write stuff automatically... check the manufacturer's website & tech support FIRST. If you're trying to write a driver, or otherwise want to hack into the device so that it interfaces nicely with another program, you'll need detailed spec's on how the USB interface is supposed to work. Start with the USB 2.0 specification at http://www.usb.org/developers/docs/ You should also see if the manufacturer has a "Programmer Manual" or some such available. You shouldn't need claimInterface() or Once you've got that, use the pyusb controlMsg() commands (see http://wiki.erazor-zone.de/wiki:projects:python:pyusb:pydoc ) to pull out the device's bDeviceClass, bDeviceSubClass, and bDeviceProtocol. (The table for conversion between the bDeviceClass number and the natural-language class name is on the same USB.org documentation page.) Then look up the spec's for those at the USB.org page above. Those will tell you the formats this device requires for read/write commands to do things which a user might find interesting / useful. -Sarah --- On Tue, 9/2/08, Christopher Moore <chr...@bn...> wrote: > From: Christopher Moore <chr...@bn...> > Subject: [Pyusb-users] Newbie Question > To: pyu...@li... > Date: Tuesday, September 2, 2008, 6:58 PM > Hey everyone, > > I'm trying to write my first program with pyUSB. I > have already figured > out how to identify my device, open it, add it to a handle, > close it and > claim it's interface. > > Here's my situation: > > The kernel recognizes my device ( a linksys cit200) as a > device already > and it actually shows up as a plughw device. The problem > is the device is > not "activated" My question is, do I have to > claimInterface this device > to send/receive signals to it? For now, I just want to see > if I can > "enable/activate" it, so the mic/speaker will > work on the thing. > > Right now, in order for me to claim the interface, I have > to > detachKernelDriver each interface (there are 4 of them, 3 > alsa/sound, 1 > hid), then setConfiguration, then claimInterface. In doing > so, I lose ... > it showing up as those devices. > > > Example Code: > --------------------------------------------- > import usb > > # linksys CIT200 Device Info > vendor_id = 5041 > product_id = 29 > > buses = usb.busses() > > for bus in buses : > for device in bus.devices : > if device.idVendor == vendor_id : > if device.idProduct == product_id : > # found the CIT200 > linksys = device > > # open device > handle = linksys.open() > > > # setup interface and configs ... there are 4 interfaces > for this device... > config = linksys.configurations[0] > interface = config.interfaces[0][0] > > # detach kernel drivers > handle.detachKernelDriver(0) > handle.detachKernelDriver(1) > handle.detachKernelDriver(2) > handle.detachKernelDriver(3) > > # set configuration and claim interface(s?) > handle.setConfiguration(config) > handle.claimInterface(interface) > handle.setAltInterface(interface) > --------------------------------------------- > > > Any help would be appreciated. I will probably have a few > more questions > to follow :) > > Thanks > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > Build the coolest Linux based applications with Moblin SDK > & win great prizes > Grand prize is a trip for two to an Open Source event > anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Christopher M. <chr...@bn...> - 2008-09-03 19:03:59
|
I mean, if I do aplay -D plughw:CIT200,0 somewav.wav, nothing plays ... nor does arecord. I sent an email to libusb as well. It seems that there's an HID interface on this device that I need to talk to. Once I figure that out (I'm reading the hid docs as we speak), I would just "claim" that interface and send/recieve commands there. *** fingers crossed ... that should make it work. Because the kernel already detects the devices properly (as sound and hid ), I suppose they're already "active". I just need to figure out how to talk to them. > What do you mean by "not activated", does any write or read operation > raise an exception? > > Wander > > 2008/9/2 Christopher Moore <chr...@bn...>: >> Hey everyone, >> >> I'm trying to write my first program with pyUSB. I have already figured >> out how to identify my device, open it, add it to a handle, close it and >> claim it's interface. >> >> Here's my situation: >> >> The kernel recognizes my device ( a linksys cit200) as a device already >> and it actually shows up as a plughw device. The problem is the device >> is >> not "activated" My question is, do I have to claimInterface this device >> to send/receive signals to it? For now, I just want to see if I can >> "enable/activate" it, so the mic/speaker will work on the thing. >> >> Right now, in order for me to claim the interface, I have to >> detachKernelDriver each interface (there are 4 of them, 3 alsa/sound, 1 >> hid), then setConfiguration, then claimInterface. In doing so, I lose >> ... >> it showing up as those devices. >> >> >> Example Code: >> --------------------------------------------- >> import usb >> >> # linksys CIT200 Device Info >> vendor_id = 5041 >> product_id = 29 >> >> buses = usb.busses() >> >> for bus in buses : >> for device in bus.devices : >> if device.idVendor == vendor_id : >> if device.idProduct == product_id : >> # found the CIT200 >> linksys = device >> >> # open device >> handle = linksys.open() >> >> >> # setup interface and configs ... there are 4 interfaces for this >> device... >> config = linksys.configurations[0] >> interface = config.interfaces[0][0] >> >> # detach kernel drivers >> handle.detachKernelDriver(0) >> handle.detachKernelDriver(1) >> handle.detachKernelDriver(2) >> handle.detachKernelDriver(3) >> >> # set configuration and claim interface(s?) >> handle.setConfiguration(config) >> handle.claimInterface(interface) >> handle.setAltInterface(interface) >> --------------------------------------------- >> >> >> Any help would be appreciated. I will probably have a few more >> questions >> to follow :) >> >> Thanks >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Pyusb-users mailing list >> Pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Wander L. <wan...@gm...> - 2008-09-03 18:51:45
|
What do you mean by "not activated", does any write or read operation raise an exception? Wander 2008/9/2 Christopher Moore <chr...@bn...>: > Hey everyone, > > I'm trying to write my first program with pyUSB. I have already figured > out how to identify my device, open it, add it to a handle, close it and > claim it's interface. > > Here's my situation: > > The kernel recognizes my device ( a linksys cit200) as a device already > and it actually shows up as a plughw device. The problem is the device is > not "activated" My question is, do I have to claimInterface this device > to send/receive signals to it? For now, I just want to see if I can > "enable/activate" it, so the mic/speaker will work on the thing. > > Right now, in order for me to claim the interface, I have to > detachKernelDriver each interface (there are 4 of them, 3 alsa/sound, 1 > hid), then setConfiguration, then claimInterface. In doing so, I lose ... > it showing up as those devices. > > > Example Code: > --------------------------------------------- > import usb > > # linksys CIT200 Device Info > vendor_id = 5041 > product_id = 29 > > buses = usb.busses() > > for bus in buses : > for device in bus.devices : > if device.idVendor == vendor_id : > if device.idProduct == product_id : > # found the CIT200 > linksys = device > > # open device > handle = linksys.open() > > > # setup interface and configs ... there are 4 interfaces for this device... > config = linksys.configurations[0] > interface = config.interfaces[0][0] > > # detach kernel drivers > handle.detachKernelDriver(0) > handle.detachKernelDriver(1) > handle.detachKernelDriver(2) > handle.detachKernelDriver(3) > > # set configuration and claim interface(s?) > handle.setConfiguration(config) > handle.claimInterface(interface) > handle.setAltInterface(interface) > --------------------------------------------- > > > Any help would be appreciated. I will probably have a few more questions > to follow :) > > Thanks > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyusb-users mailing list > Pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Christopher M. <chr...@bn...> - 2008-09-02 23:58:36
|
Hey everyone, I'm trying to write my first program with pyUSB. I have already figured out how to identify my device, open it, add it to a handle, close it and claim it's interface. Here's my situation: The kernel recognizes my device ( a linksys cit200) as a device already and it actually shows up as a plughw device. The problem is the device is not "activated" My question is, do I have to claimInterface this device to send/receive signals to it? For now, I just want to see if I can "enable/activate" it, so the mic/speaker will work on the thing. Right now, in order for me to claim the interface, I have to detachKernelDriver each interface (there are 4 of them, 3 alsa/sound, 1 hid), then setConfiguration, then claimInterface. In doing so, I lose ... it showing up as those devices. Example Code: --------------------------------------------- import usb # linksys CIT200 Device Info vendor_id = 5041 product_id = 29 buses = usb.busses() for bus in buses : for device in bus.devices : if device.idVendor == vendor_id : if device.idProduct == product_id : # found the CIT200 linksys = device # open device handle = linksys.open() # setup interface and configs ... there are 4 interfaces for this device... config = linksys.configurations[0] interface = config.interfaces[0][0] # detach kernel drivers handle.detachKernelDriver(0) handle.detachKernelDriver(1) handle.detachKernelDriver(2) handle.detachKernelDriver(3) # set configuration and claim interface(s?) handle.setConfiguration(config) handle.claimInterface(interface) handle.setAltInterface(interface) --------------------------------------------- Any help would be appreciated. I will probably have a few more questions to follow :) Thanks |