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: Gerry <gb...@ge...> - 2015-01-12 12:54:48
|
Now when I try to run my app I get the following error messages: d1 = device.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 918, in read self.__get_timeout(timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 507, in intr_read timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 562, in __read timeout File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 380, in _check raise USBError(errmsg, ret) usb.core.USBError: [Errno None] Connection timed out" I am using "virtualenv" which was set up with Python 3.2.3 yet the errors are occurring in Python 2.7 PyUSB core and lisbusb0 even though I have specified to include "backend/libusb1" Any and all help will be greatly appreciated to fix these PyUSB problems. Thanks, Gerald |
From: Wander L. C. <wan...@gm...> - 2014-12-29 08:13:19
|
2014-11-13 12:14 GMT-02:00 Anatoly Verkhovsky <an...@gm...>: > Hi, > Hi, sorry for the delay, but I was out most of the month. > I'm writing a driver for a device. It was originally using MDB ICP, but now > it ships with a USB to MDB bridge, why they have chosen to do it as HID > rather then USB Serial i have no idea. So behind the usb there is a simple > serial protocol. > [snip] > Here is the gist of my code: > > dev = usb.core.find(idVendor=0x155d, idProduct=0x0002) > # check and remove kernel driver > dev.set_configuration() > dev.reset() iirc, reset is problematic in Windows (maybe a should log a warning for this), what if you remove it? > # bmRequestType, bRequest are taken from SnoopyPro trace. > res = dev.ctrl_transfer(0x22, 0x9, 0, 0, [0x02, 0x85, 0x0a], 1000) This seems to be a class request, so it is a HID class request? > data = dev.read(0x82, 32, timeout=10000) > > ctrl_transfer fails with USBError(32, 'Pipe error') and > after couple of retries : USBError(19, 'No such device (it may have been > disconnected)') In general, this kind of errors in Windows is due to the reset call. > i have also tried the whole byte string from the capture > > res = dev.ctrl_transfer(0x22, 0x9, 0, 0, [0x03, 0x02, 0x85, 0x0a, 0x05, > 0x14, 0xff, 0xff], 1000) > > to same effect. > > So what am i missing? > Why is the trace saying that host to device message is using function 0x1b > (Class interface) and device to host is using function 0x08 (control > transfer), shouldn't it be the other way around? > > thanks, > Anatoli > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Steven M. <smi...@gm...> - 2014-12-29 08:04:37
|
> On Dec 26, 2014, at 8:41 PM, Wander Lairson Costa <wan...@gm...> wrote: > > 2014-11-17 7:56 GMT-02:00 Oci Ocean <oci...@gm...>: >> Hallo together, >> > > Hi, sorry for the delay. > >> I have a problem detecting my ir-reciever on Mac 10.8. >> The ir-reciever is noticed by the oporating system and i can control >> iTunes with a remote control but: >> >> device = usb.core.find(find_all=True) >> >> just finds USB-Mouse and Keyboard. >> >> Where is my mistake or what can i do to have success? >> > > So, I am not a Mac guy, does Mac have a lsusb like tool? Does your > device appear there? > The USB view under Hardware in the “System Information” app. /Applications/Utilities/System Information There are developer tools that provide some more information. https://developer.apple.com/hardwaredrivers/ <https://developer.apple.com/hardwaredrivers/> You have to register as a developer, and it should be available with the free developer account. Although you probably don’t need these tools, it does include an optionaly logging USB kernel driver for OSX > Best Regards, > Wander Lairson Costa > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users |
From: Wander L. C. <wan...@gm...> - 2014-12-29 07:02:49
|
2014-11-17 7:56 GMT-02:00 Oci Ocean <oci...@gm...>: > Hallo together, > Hi, sorry for the delay. > I have a problem detecting my ir-reciever on Mac 10.8. > The ir-reciever is noticed by the oporating system and i can control > iTunes with a remote control but: > > device = usb.core.find(find_all=True) > > just finds USB-Mouse and Keyboard. > > Where is my mistake or what can i do to have success? > So, I am not a Mac guy, does Mac have a lsusb like tool? Does your device appear there? Best Regards, Wander Lairson Costa |
From: Wander L. C. <wan...@gm...> - 2014-12-07 10:55:15
|
Hi, I just would like to let you know that I will be out for vacation for the rest of the month, so support requests and PR will take some time to request answered. Merry Christmas! -- Best Regards, Wander Lairson Costa |
From: Jeff R. <je...@ro...> - 2014-12-06 21:06:34
|
Darn, I forgot a helpful subject line. Sorry about that. Fixed now...though that probably means I broke the thread structure. I was able to re-test on a laptop running an older version of Linux Mint natively (no VM), and after a few compatibility tweaks, I got it to communicate correctly AND there is no weird delay anymore! I believe the issue may be specific to the VM, although I am really unsure why, and would love any insight anyone might have. I also need to do some more testing on a different machine with the latest Ubuntu, so that I can more confidently point at the VM environment as the cause rather than something else. In case anyone is interested, I've pushed the relevant code up to a Github repo: https://github.com/jrowberg/keyglove/blob/master/host/python/kglib.py#L335 If I learn anything more, I'll be sure to follow up. --Jeff On Sat, Dec 6, 2014 at 12:55 AM, Jeff Rowberg <je...@ro...> wrote: Hello PyUSB community! > > I'm trying to solve a raw HID write delay problem when using PyUSB 1.0.0b2 > with Python 2.7 in an Ubuntu 14.10 Linux environment, actually running > inside a VMware Player virtual machine on a Windows 8.1 64-bit desktop. I'm > communicating from the Python script to a Teensy++ configured in Raw HID > mode. I have been able to make this work perfectly in Windows using > PyWinUSB, and using the Teensy++ manufacturer's own RawHID C demo code, and > *almost* in Linux with PyUSB. In fact, I even get the data moving back and > forth over the IN and OUT interrupt endpoints, intact and in order. > > The problem is that there is a very measurable delay (usually between > 200ms and 500ms, varying) whenever I try to use the .write() method to send > data to the device. I receive it instantly whenever anything new comes in; > I've narrowed down the delay very specifically to the single line that > attempts to send data: > > self.pyusb_endpoint_out.write(raw_packet) > > The "raw_packet" variable is an array of bytes. The data is delivered > properly, and everything else works great on the device and in the response > that comes back, so I know it's being interpreted correctly. It just takes > way longer than it should. > > First, here's the string representation of the interface that I'm using: > > INTERFACE 0: Human Interface Device ==================== > bLength : 0x9 (9 bytes) > bDescriptorType : 0x4 Interface > bInterfaceNumber : 0x0 > bAlternateSetting : 0x0 > bNumEndpoints : 0x2 > bInterfaceClass : 0x3 Human Interface Device > bInterfaceSubClass : 0x0 > bInterfaceProtocol : 0x0 > iInterface : 0x2 Teensyduino RawHID > ENDPOINT 0x83: Interrupt IN ========================== > bLength : 0x7 (7 bytes) > bDescriptorType : 0x5 Endpoint > bEndpointAddress : 0x83 IN > bmAttributes : 0x3 Interrupt > wMaxPacketSize : 0x40 (64 bytes) > bInterval : 0x1 > ENDPOINT 0x4: Interrupt OUT ========================== > bLength : 0x7 (7 bytes) > bDescriptorType : 0x5 Endpoint > bEndpointAddress : 0x4 OUT > bmAttributes : 0x3 Interrupt > wMaxPacketSize : 0x40 (64 bytes) > bInterval : 0x1 > > I read data from 0x83 and send it out 0x4. Both are interrupt endpoints, > so I would assume this should be pretty straightforward. > > The Python script is fairly complicated, so I won't post the whole thing > here (though I will be happy to post it on Github if needed; that's where > it will end up, but I was kinda hoping to actually make it work first). > However, salient points about its functionality are these: > > 1. It's running in VM of Ubuntu 14.10, on a Win8 machine. I can try a > non-VM Ubuntu environment, but it will take some time to arrange that. > > 2. The script starts a separate daemon thread which constantly tries to > read from endpoint 0x83, timing out every second and retrying whenever > there is no data available. This approach seems to work perfectly, but I'm > wondering if it has some adverse effect on the ability to write data in a > timely fashion. The thread runs in a single handler function that looks > like this: > > # handler for reading incoming raw HID packets via PyUSB (thread > started in local connect() method) > def pyusb_read_handler(self): > while self.pyusb_endpoint_in != None and self.connected: > try: > ret = > self.devobj.read(self.pyusb_endpoint_in.bEndpointAddress, > self.pyusb_endpoint_in.wMaxPacketSize) > if len(ret) > 0 and ret[0] > 0: > for b in ret[1:ret[0] + 1]: > if self.kgapi.parse(b) == 0xC0: > self.responses_pending = > self.responses_pending - 1 > if self.responses_pending == 0: > self.on_api_idle() > except usb.core.USBError as e: > if e.errno == 110: > # PyUSB timeout, probably just no data > sys.exc_clear() > elif e.errno == 5 or e.errno == 19: > # "Input/Output Error" or "No such device", this is > serious > self.on_unplugged() > self.disconnect() > else: > raise KeygloveHIDError("PyUSB read thread error: %s" % > e) > > 3. The packets being sent are 64 bytes in size. The trailing bytes beyond > the important part of the data payload are padded to zeros to fill the > whole size. I had originally tried without doing this (by accident, in > fact), so the byte array I wrote was only perhaps 5-10 bytes long, and then > realized that I'd forgotten to pad it. However, the same delay exists > whether or not the bytes are zero-padded out to the full report size, so > that isn't it. > > Given the above, is there ANY reason why there would be a 100+ millisecond > seemingly arbitrary delay sending a 64-byte packet? > > --Jeff > > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Jeff R. <je...@ro...> - 2014-12-06 06:12:17
|
Hello PyUSB community! I'm trying to solve a raw HID write delay problem when using PyUSB 1.0.0b2 with Python 2.7 in an Ubuntu 14.10 Linux environment, actually running inside a VMware Player virtual machine on a Windows 8.1 64-bit desktop. I'm communicating from the Python script to a Teensy++ configured in Raw HID mode. I have been able to make this work perfectly in Windows using PyWinUSB, and using the Teensy++ manufacturer's own RawHID C demo code, and *almost* in Linux with PyUSB. In fact, I even get the data moving back and forth over the IN and OUT interrupt endpoints, intact and in order. The problem is that there is a very measurable delay (usually between 200ms and 500ms, varying) whenever I try to use the .write() method to send data to the device. I receive it instantly whenever anything new comes in; I've narrowed down the delay very specifically to the single line that attempts to send data: self.pyusb_endpoint_out.write(raw_packet) The "raw_packet" variable is an array of bytes. The data is delivered properly, and everything else works great on the device and in the response that comes back, so I know it's being interpreted correctly. It just takes way longer than it should. First, here's the string representation of the interface that I'm using: INTERFACE 0: Human Interface Device ==================== bLength : 0x9 (9 bytes) bDescriptorType : 0x4 Interface bInterfaceNumber : 0x0 bAlternateSetting : 0x0 bNumEndpoints : 0x2 bInterfaceClass : 0x3 Human Interface Device bInterfaceSubClass : 0x0 bInterfaceProtocol : 0x0 iInterface : 0x2 Teensyduino RawHID ENDPOINT 0x83: Interrupt IN ========================== bLength : 0x7 (7 bytes) bDescriptorType : 0x5 Endpoint bEndpointAddress : 0x83 IN bmAttributes : 0x3 Interrupt wMaxPacketSize : 0x40 (64 bytes) bInterval : 0x1 ENDPOINT 0x4: Interrupt OUT ========================== bLength : 0x7 (7 bytes) bDescriptorType : 0x5 Endpoint bEndpointAddress : 0x4 OUT bmAttributes : 0x3 Interrupt wMaxPacketSize : 0x40 (64 bytes) bInterval : 0x1 I read data from 0x83 and send it out 0x4. Both are interrupt endpoints, so I would assume this should be pretty straightforward. The Python script is fairly complicated, so I won't post the whole thing here (though I will be happy to post it on Github if needed; that's where it will end up, but I was kinda hoping to actually make it work first). However, salient points about its functionality are these: 1. It's running in VM of Ubuntu 14.10, on a Win8 machine. I can try a non-VM Ubuntu environment, but it will take some time to arrange that. 2. The script starts a separate daemon thread which constantly tries to read from endpoint 0x83, timing out every second and retrying whenever there is no data available. This approach seems to work perfectly, but I'm wondering if it has some adverse effect on the ability to write data in a timely fashion. The thread runs in a single handler function that looks like this: # handler for reading incoming raw HID packets via PyUSB (thread started in local connect() method) def pyusb_read_handler(self): while self.pyusb_endpoint_in != None and self.connected: try: ret = self.devobj.read(self.pyusb_endpoint_in.bEndpointAddress, self.pyusb_endpoint_in.wMaxPacketSize) if len(ret) > 0 and ret[0] > 0: for b in ret[1:ret[0] + 1]: if self.kgapi.parse(b) == 0xC0: self.responses_pending = self.responses_pending - 1 if self.responses_pending == 0: self.on_api_idle() except usb.core.USBError as e: if e.errno == 110: # PyUSB timeout, probably just no data sys.exc_clear() elif e.errno == 5 or e.errno == 19: # "Input/Output Error" or "No such device", this is serious self.on_unplugged() self.disconnect() else: raise KeygloveHIDError("PyUSB read thread error: %s" % e) 3. The packets being sent are 64 bytes in size. The trailing bytes beyond the important part of the data payload are padded to zeros to fill the whole size. I had originally tried without doing this (by accident, in fact), so the byte array I wrote was only perhaps 5-10 bytes long, and then realized that I'd forgotten to pad it. However, the same delay exists whether or not the bytes are zero-padded out to the full report size, so that isn't it. Given the above, is there ANY reason why there would be a 100+ millisecond seemingly arbitrary delay sending a 64-byte packet? --Jeff |
From: Wander L. C. <wan...@gm...> - 2014-11-27 16:11:21
|
Hi, Could you please run with the env var PYUSB_DEBUG=debug and post the logs? 2014-11-25 3:31 GMT-02:00 Setia Budi <boe...@gm...>: > Actually, libusb is available on Yocto Linux: > > root@clanton:~# ls /lib/ | grep libusb > libusb-0.1.so.4 > libusb-0.1.so.4.4.4 > libusb-1.0.so.0 > libusb-1.0.so.0.1.0 > > But still, every time I call my script, I always have this error message > > Traceback (most recent call last): > File "pyru824.py", line 71, in <module> > RFID_READER = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID) > File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in find > raise ValueError('No backend available') > ValueError: No backend available > > Kind regards, > Budi > > > On Tue, Nov 25, 2014 at 12:49 PM, Setia Budi <boe...@gm...> wrote: >> >> configure: error: in `/home/root/libusb-1.0.9': >> configure: error: no acceptable C compiler found in $PATH >> >> >> Need to get c compiler >.< >> >> >> >> On Tue, Nov 25, 2014 at 12:23 PM, Setia Budi <boe...@gm...> wrote: >>> >>> Thanks for the hint. I will try it now :) >>> >>> Kind regards, >>> Budi >>> >>> On Tue, Nov 25, 2014 at 12:17 PM, Xiaofan Chen <xia...@gm...> >>> wrote: >>>> >>>> On Tue, Nov 25, 2014 at 7:33 AM, Setia Budi <boe...@gm...> >>>> wrote: >>>> > Hi all, >>>> > At the moment I am working with Intel Galileo Gen2 with Yocto Linux >>>> > running >>>> > on top of it. This micro PC is planned to replace some other micro PC >>>> > for >>>> > field experiment. >>>> > I installed pyusb on it without any issue, however, once I run my >>>> > script, >>>> > which is using pyusb module, I found this error message: >>>> > >>>> > Traceback (most recent call last): >>>> > File "pyru824.py", line 71, in <module> >>>> > RFID_READER = usb.core.find(idVendor=VENDOR_ID, >>>> > idProduct=PRODUCT_ID) >>>> > File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in >>>> > find >>>> > raise ValueError('No backend available') >>>> > ValueError: No backend available >>>> > >>>> > I am just wondering whether anyone has a solution for this problem? >>>> > Thank you :) >>>> >>>> Did you install libusb-1.0? For Linux it is better to install libusb-1.0 >>>> as the backend for pyusb. If your Linux distro does not provide >>>> the package, then you need to build from source. But most >>>> Linux distros provide libusb-1.0. >>>> >>>> Website: http://libusb.info/ >>>> Download: http://sourceforge.net/projects/libusb/ >>>> >>>> >>>> -- >>>> Xiaofan >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >>>> with Interactivity, Sharing, Native Excel Exports, App Integration & >>>> more >>>> Get technology previously reserved for billion-dollar corporations, FREE >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> pyusb-users mailing list >>>> pyu...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyusb-users >>> >>> >> > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Setia B. <boe...@gm...> - 2014-11-25 05:31:50
|
Actually, libusb is available on Yocto Linux: root@clanton:~# ls /lib/ | grep libusb libusb-0.1.so.4 libusb-0.1.so.4.4.4 libusb-1.0.so.0 libusb-1.0.so.0.1.0 But still, every time I call my script, I always have this error message Traceback (most recent call last): File "pyru824.py", line 71, in <module> RFID_READER = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID) File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in find raise ValueError('No backend available') ValueError: No backend available Kind regards, Budi On Tue, Nov 25, 2014 at 12:49 PM, Setia Budi <boe...@gm...> wrote: > configure: error: in `/home/root/libusb-1.0.9': > configure: error: no acceptable C compiler found in $PATH > > > Need to get c compiler >.< > > > > On Tue, Nov 25, 2014 at 12:23 PM, Setia Budi <boe...@gm...> wrote: > >> Thanks for the hint. I will try it now :) >> >> Kind regards, >> Budi >> >> On Tue, Nov 25, 2014 at 12:17 PM, Xiaofan Chen <xia...@gm...> >> wrote: >> >>> On Tue, Nov 25, 2014 at 7:33 AM, Setia Budi <boe...@gm...> >>> wrote: >>> > Hi all, >>> > At the moment I am working with Intel Galileo Gen2 with Yocto Linux >>> running >>> > on top of it. This micro PC is planned to replace some other micro PC >>> for >>> > field experiment. >>> > I installed pyusb on it without any issue, however, once I run my >>> script, >>> > which is using pyusb module, I found this error message: >>> > >>> > Traceback (most recent call last): >>> > File "pyru824.py", line 71, in <module> >>> > RFID_READER = usb.core.find(idVendor=VENDOR_ID, >>> idProduct=PRODUCT_ID) >>> > File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in >>> find >>> > raise ValueError('No backend available') >>> > ValueError: No backend available >>> > >>> > I am just wondering whether anyone has a solution for this problem? >>> > Thank you :) >>> >>> Did you install libusb-1.0? For Linux it is better to install libusb-1.0 >>> as the backend for pyusb. If your Linux distro does not provide >>> the package, then you need to build from source. But most >>> Linux distros provide libusb-1.0. >>> >>> Website: http://libusb.info/ >>> Download: http://sourceforge.net/projects/libusb/ >>> >>> >>> -- >>> Xiaofan >>> >>> >>> ------------------------------------------------------------------------------ >>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >>> with Interactivity, Sharing, Native Excel Exports, App Integration & more >>> Get technology previously reserved for billion-dollar corporations, FREE >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> pyusb-users mailing list >>> pyu...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyusb-users >>> >> >> > |
From: Setia B. <boe...@gm...> - 2014-11-25 01:49:19
|
configure: error: in `/home/root/libusb-1.0.9': configure: error: no acceptable C compiler found in $PATH Need to get c compiler >.< On Tue, Nov 25, 2014 at 12:23 PM, Setia Budi <boe...@gm...> wrote: > Thanks for the hint. I will try it now :) > > Kind regards, > Budi > > On Tue, Nov 25, 2014 at 12:17 PM, Xiaofan Chen <xia...@gm...> wrote: > >> On Tue, Nov 25, 2014 at 7:33 AM, Setia Budi <boe...@gm...> wrote: >> > Hi all, >> > At the moment I am working with Intel Galileo Gen2 with Yocto Linux >> running >> > on top of it. This micro PC is planned to replace some other micro PC >> for >> > field experiment. >> > I installed pyusb on it without any issue, however, once I run my >> script, >> > which is using pyusb module, I found this error message: >> > >> > Traceback (most recent call last): >> > File "pyru824.py", line 71, in <module> >> > RFID_READER = usb.core.find(idVendor=VENDOR_ID, >> idProduct=PRODUCT_ID) >> > File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in >> find >> > raise ValueError('No backend available') >> > ValueError: No backend available >> > >> > I am just wondering whether anyone has a solution for this problem? >> > Thank you :) >> >> Did you install libusb-1.0? For Linux it is better to install libusb-1.0 >> as the backend for pyusb. If your Linux distro does not provide >> the package, then you need to build from source. But most >> Linux distros provide libusb-1.0. >> >> Website: http://libusb.info/ >> Download: http://sourceforge.net/projects/libusb/ >> >> >> -- >> Xiaofan >> >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> >> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > |
From: Xiaofan C. <xia...@gm...> - 2014-11-25 01:26:09
|
On Tue, Nov 25, 2014 at 2:42 AM, Richard Bryan <ra...@lu...> wrote: > Hi Wander, > > I ran with PYUSB_DEBUG=debug and encountered the error. The log text when > the error occurred is here: > > http://pastebin.com/kmqSrek9 > > Its the pyusb debug log intermingled with my program's logging information > as well. The first "Access Denied" error occurs at line 1527. There are > also a bunch '[Errno 10060] Operation timed out' errors that occur leading > up to the access denied error. Just looking at the pyusb log messages > around the time the errors are reported by my program, I didn't see anything > that looked relevant... > You should probably ask in the libusb mailing list. Right now I can not access your pastebin message but sometimes it is caused by the device problem (device hangs and lost on the USB bus). Please also make sure you are using libusb-1.0.19 which is the latest release version. -- Xiaofan |
From: Setia B. <boe...@gm...> - 2014-11-25 01:23:59
|
Thanks for the hint. I will try it now :) Kind regards, Budi On Tue, Nov 25, 2014 at 12:17 PM, Xiaofan Chen <xia...@gm...> wrote: > On Tue, Nov 25, 2014 at 7:33 AM, Setia Budi <boe...@gm...> wrote: > > Hi all, > > At the moment I am working with Intel Galileo Gen2 with Yocto Linux > running > > on top of it. This micro PC is planned to replace some other micro PC for > > field experiment. > > I installed pyusb on it without any issue, however, once I run my script, > > which is using pyusb module, I found this error message: > > > > Traceback (most recent call last): > > File "pyru824.py", line 71, in <module> > > RFID_READER = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID) > > File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in find > > raise ValueError('No backend available') > > ValueError: No backend available > > > > I am just wondering whether anyone has a solution for this problem? > > Thank you :) > > Did you install libusb-1.0? For Linux it is better to install libusb-1.0 > as the backend for pyusb. If your Linux distro does not provide > the package, then you need to build from source. But most > Linux distros provide libusb-1.0. > > Website: http://libusb.info/ > Download: http://sourceforge.net/projects/libusb/ > > > -- > Xiaofan > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Xiaofan C. <xia...@gm...> - 2014-11-25 01:17:26
|
On Tue, Nov 25, 2014 at 7:33 AM, Setia Budi <boe...@gm...> wrote: > Hi all, > At the moment I am working with Intel Galileo Gen2 with Yocto Linux running > on top of it. This micro PC is planned to replace some other micro PC for > field experiment. > I installed pyusb on it without any issue, however, once I run my script, > which is using pyusb module, I found this error message: > > Traceback (most recent call last): > File "pyru824.py", line 71, in <module> > RFID_READER = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID) > File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in find > raise ValueError('No backend available') > ValueError: No backend available > > I am just wondering whether anyone has a solution for this problem? > Thank you :) Did you install libusb-1.0? For Linux it is better to install libusb-1.0 as the backend for pyusb. If your Linux distro does not provide the package, then you need to build from source. But most Linux distros provide libusb-1.0. Website: http://libusb.info/ Download: http://sourceforge.net/projects/libusb/ -- Xiaofan |
From: Setia B. <boe...@gm...> - 2014-11-24 23:33:28
|
Hi all, At the moment I am working with Intel Galileo Gen2 with Yocto Linux running on top of it. This micro PC is planned to replace some other micro PC for field experiment. I installed pyusb on it without any issue, however, once I run my script, which is using pyusb module, I found this error message: Traceback (most recent call last): File "pyru824.py", line 71, in <module> RFID_READER = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID) File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in find raise ValueError('No backend available') ValueError: No backend available I am just wondering whether anyone has a solution for this problem? Thank you :) Kind regards, Budi |
From: Richard B. <ra...@lu...> - 2014-11-24 19:13:49
|
Hi Wander, I ran with PYUSB_DEBUG=debug and encountered the error. The log text when the error occurred is here: http://pastebin.com/kmqSrek9 Its the pyusb debug log intermingled with my program's logging information as well. The first "Access Denied" error occurs at line 1527. There are also a bunch '[Errno 10060] Operation timed out' errors that occur leading up to the access denied error. Just looking at the pyusb log messages around the time the errors are reported by my program, I didn't see anything that looked relevant... Richard Date: Thu, 13 Nov 2014 09:54:31 -0200 From: Wander Lairson Costa <wan...@gm...> Subject: Re: [pyusb-users] Access Denied Error on Windows 7 To: pyusb-users <pyu...@li...> Message-ID: <CAFsSK4ZsCYbR8eQETrDrcU0QU+f_ 05bKShpWgQdE6SA5K=50...@ma...> Content-Type: text/plain; charset=UTF-8 2014-11-11 15:22 GMT-02:00 Richard Bryan <ra...@lu...>: > I'm frequently running into an "Access Denied (insufficient permissions)" > errors on Windows 7 (with libusb1 backend) during long-running usb sessions > with a device. When this happens, I call reset() and dispose_resources() on > the usb handle and then attempt to reenumerate it using usb.core.find(), but > the Access Denied error keeps occurring until I unplug and replug the > device. Restarting the program alone doesnt fix it. > iirc, libusb reset operation is problematic under Windows, so better to avoid it. > I have a multithreaded program, but interaction with pyusb is only ever done > in the same, single thread. > This should not cause problems... > Anyone have any ideas what's going on? Or is this something I should ask > the libusb list about? > Could you please run you program with the environment variable PYUSB_DEBUG=debug defined and report the logs? > Richard > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Oci O. <oci...@gm...> - 2014-11-17 09:57:03
|
Hallo together, I have a problem detecting my ir-reciever on Mac 10.8. The ir-reciever is noticed by the oporating system and i can control iTunes with a remote control but: device = usb.core.find(find_all=True) just finds USB-Mouse and Keyboard. Where is my mistake or what can i do to have success? Kind regards Oci |
From: Xiaofan C. <xia...@gm...> - 2014-11-14 07:58:32
|
On Wed, Nov 12, 2014 at 1:22 AM, Richard Bryan <ra...@lu...> wrote: > I'm frequently running into an "Access Denied (insufficient permissions)" > errors on Windows 7 (with libusb1 backend) during long-running usb sessions > with a device. When this happens, I call reset() and dispose_resources() on > the usb handle and then attempt to reenumerate it using usb.core.find(), but > the Access Denied error keeps occurring until I unplug and replug the > device. Restarting the program alone doesnt fix it. libusb under Windows do not support libusb_reset() since WinUSB driver does not support reset. BTW, what is the libusb version you are using? You should use the latest libusb-1.0.19 version. > I have a multithreaded program, but interaction with pyusb is only ever done > in the same, single thread. > > Anyone have any ideas what's going on? Or is this something I should ask > the libusb list about? > You can follow Wander's advice to turn on PYUSB_DEBUG=debug for pyusb debug message. If that is not good enough, you can turn on libusb debug by setting env variable LIBUSB_DEBUG=4 for libusb debug messages. And when this happen, you can check if your USB device is still recognized by Windows in Device Manager? If not, then libusb will fail and most likely your device has a HW/FW stability problem. -- Xiaofan |
From: Anatoly V. <an...@gm...> - 2014-11-13 14:14:34
|
Hi, I'm writing a driver for a device. It was originally using MDB ICP, but now it ships with a USB to MDB bridge, why they have chosen to do it as HID rather then USB Serial i have no idea. So behind the usb there is a simple serial protocol. Here is what lsusb gives: Bus 001 Device 027: ID 155d:0002 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x155d idProduct 0x0002 bcdDevice 2.95 iManufacturer 1 (error) iProduct 2 NRI-USB-HID-DEV-01 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 8 Main Configuration bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 5 Alternate Setting1 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.10 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 30 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0020 1x 32 bytes bInterval 8 Device Status: 0x0001 Self Powered I take it, this means one configuration, one interface, one end point. So the data should be read from endpoint at address 0x82, and data should be written to endpoint 0x00 with ctrl_transfer, is that correct? Here is a SnoopyPro trace of control software running on windows, for message sent to device: URB Header (length: 80) SequenceNumber: 21 Function: 001b (CLASS_INTERFACE) PipeHandle: 00000000 SetupPacket: 0000: 22 09 00 03 00 00 00 00 bmRequestType: 22 DIR: Host-To-Device TYPE: Class RECIPIENT: Endpoint bRequest: 09 TransferBuffer: 0x00000008 (8) length 0000: 03 02 85 0a 05 14 ff ff The payload of this is [0x02 0x85 0x0a], that's the init command as described in device docs. The device replies with this: URB Header (length: 80) SequenceNumber: 22 Function: 0008 (CONTROL_TRANSFER) PipeHandle: 86d039cc SetupPacket: 0000: a1 01 00 03 00 00 08 00 bmRequestType: a1 DIR: Device-To-Host TYPE: Class RECIPIENT: Interface bRequest: 01 TransferBuffer: 0x00000008 (8) length 0000: 01 2e ff ff ff ff ff ff Payload of this is [0x2E] again per spec. Now my goal is to reproduce this simple exchange, once i have that i can go on to implement all other needed commands. I'm guessing that the protocol messages are prepended with message size byte and padded up to 8 bytes with 0xFF or random data Curiously snoopyPro generates traces even if the control application is not loaded, i assume these messages don't make it to the actual device. Here is the gist of my code: dev = usb.core.find(idVendor=0x155d, idProduct=0x0002) # check and remove kernel driver dev.set_configuration() dev.reset() # bmRequestType, bRequest are taken from SnoopyPro trace. res = dev.ctrl_transfer(0x22, 0x9, 0, 0, [0x02, 0x85, 0x0a], 1000) data = dev.read(0x82, 32, timeout=10000) ctrl_transfer fails with USBError(32, 'Pipe error') and after couple of retries : USBError(19, 'No such device (it may have been disconnected)') i have also tried the whole byte string from the capture res = dev.ctrl_transfer(0x22, 0x9, 0, 0, [0x03, 0x02, 0x85, 0x0a, 0x05, 0x14, 0xff, 0xff], 1000) to same effect. So what am i missing? Why is the trace saying that host to device message is using function 0x1b (Class interface) and device to host is using function 0x08 (control transfer), shouldn't it be the other way around? thanks, Anatoli |
From: Wander L. C. <wan...@gm...> - 2014-11-13 11:55:23
|
2014-11-11 15:22 GMT-02:00 Richard Bryan <ra...@lu...>: > I'm frequently running into an "Access Denied (insufficient permissions)" > errors on Windows 7 (with libusb1 backend) during long-running usb sessions > with a device. When this happens, I call reset() and dispose_resources() on > the usb handle and then attempt to reenumerate it using usb.core.find(), but > the Access Denied error keeps occurring until I unplug and replug the > device. Restarting the program alone doesnt fix it. > iirc, libusb reset operation is problematic under Windows, so better to avoid it. > I have a multithreaded program, but interaction with pyusb is only ever done > in the same, single thread. > This should not cause problems... > Anyone have any ideas what's going on? Or is this something I should ask > the libusb list about? > Could you please run you program with the environment variable PYUSB_DEBUG=debug defined and report the logs? > Richard > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > -- Best Regards, Wander Lairson Costa |
From: Richard B. <ra...@lu...> - 2014-11-11 17:46:43
|
I'm frequently running into an "Access Denied (insufficient permissions)" errors on Windows 7 (with libusb1 backend) during long-running usb sessions with a device. When this happens, I call reset() and dispose_resources() on the usb handle and then attempt to reenumerate it using usb.core.find(), but the Access Denied error keeps occurring until I unplug and replug the device. Restarting the program alone doesnt fix it. I have a multithreaded program, but interaction with pyusb is only ever done in the same, single thread. Anyone have any ideas what's going on? Or is this something I should ask the libusb list about? Richard |
From: Anony M. <fy...@gm...> - 2014-11-03 23:44:49
|
> $ python >>> import ctypes >>> import ctypes.util >>> ctypes.util.find_library('libusb-1.0') > Does it work on your environment? No. But it does give a hint! ===================== Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 423, in LoadLibrary return self._dlltype(name) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 345, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(libusb-1.0.dylib, 6): no suitable image found. *Did find:* * /usr/local/lib/libusb-1.0.dylib: mach-o, but wrong architecture* >>> ========================== Thus: ==> file libusb-1.0.0.dylib libusb-1.0.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64 so.... I need 32 bit. ok then: ==> sudo rm -f /usr/local/lib/libusb* ==> sudo make clean ==> sudo ./configure CXXFLAGS="-m32 -arch 386" CFLAGS="-m32" ==> sudo make ==> sudo make install Python ctypes check now returns: >>> import ctypes >>> import ctypes.util as x >>> x.find_library('libusb-1.0') '/usr/local/lib/libusb-1.0.dylib' >>> ...which looks good, so I messed with some more testcode, and as long as I do this first... mybackend = usb.backend.libusb1.get_backend(find_library=lambda x: "/usr/local/lib/libusb-1.0.dylib') ...then usb.lib and usb.core act reasonably. Still not sure why it's not finding the library itself, though. Thanks for the help, everyone. Kudos to the bunch of yas. :) |
From: Jared C. <jar...@li...> - 2014-11-03 20:49:44
|
Mark-- To add to Ian's response, the HID POS Usage Tables ( http://www.usb.org/developers/hidpage/pos1_02.pdf) will help you decipher what the HID kernel module is telling you. Check out "Section 4 Weighing Devices (0x8D)" for the Report IDs, which will put context to the data that you receive from the HID driver. I'm working on a similar project using a Dymo Pelouze 25 lb. Postal Scale. Best of luck! --Jared On Mon, Nov 3, 2014 at 2:44 PM, Ian Daniher <it....@gm...> wrote: > If you haven't already, I'd start by generating large log files of the > scales interacting with the vendor-provided software. It's easy to do this > on Linux using https://www.kernel.org/doc/Documentation/usb/usbmon.txt. > > Also, you have a USB HID device, which is a shortpath used by many vendors > for "driverless" operation. Unfortunately this will make direct PyUSB > interface slightly obnoxious. I'd check out > http://pythonic-wisdom.blogspot.com/2009/07/usb-hid-with-linux-and-python.html > and continue the search from there, looking less at PyUSB and perhaps more > at the source of existing Python+USB+HID projects. > > BR, > Ian > > > > On Mon, Nov 3, 2014 at 2:34 PM, Mark McClure <mar...@gm...> > wrote: > >> Wander and all users, >> >> Thank you for getting back to me. As you can tell, all of this is foreign >> to me since I'm a very novice programmer. When you say poll the USB POV, >> do you mean "read" data from the device? >> >> Here's what I tried as I removed jelly beans from a scale over 10 seconds: >> >> import sys >> import usb.core >> import usb.util >> import time >> >> dev = usb.core.find(idVendor = 0x0DBC, idProduct = 0x0005) >> if dev is None: >> raise ValueError('Device not found') >> >> dev.set_configuration() >> >> endpoint = dev[0][(0,0)][0] >> >> timestep = 0 >> >> while timestep <= 10: >> data = dev.read(endpoint.bEndpointAddress, >> endpoint.wMaxPacketSize) >> print(data) >> time.sleep(1) >> timestep += 1 >> >> >> The output was this: >> >> array('B', [0, 0, 87, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 0, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 98, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 0, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 98, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 0, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 98, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 0, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 98, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 0, 0, 0, 0, 0, 0]) >> array('B', [0, 0, 96, 0, 0, 0, 0, 0]) >> >> But I don't have any idea what this means, except that I'm guessing that >> changes in weight data were not recorded. >> >> Has anyone worked on a device like this? Some sample code might really >> help me make sense of everything. >> >> On Mon, Nov 3, 2014 at 2:31 AM, Wander Lairson Costa < >> wan...@gm...> wrote: >> >>> 2014-11-02 1:54 GMT-02:00 Mark McClure <mar...@gm...>: >>> > Hello list: >>> > >>> > I have three A&D EJ-3000 scales that I want to simultaneously acquire >>> data >>> > from every 1 minute over 24-hr periods. All scales have a USB >>> interface. >>> > I've started working through the pyusb tutorial, but before I confuse >>> myself >>> > any further, I thought I'd ask if what I want to do is even possible? >>> Tech >>> > support at A&D told me that retrieving weight data from the scales >>> > automatically (i.e. without pushing the print button on the scales) >>> could >>> > not be done with USB because the interface was uni-directional. >>> Instead, >>> > they suggested that I switch to RS-232. Is this true, and if so why? >>> > >>> >>> Hi, >>> >>> It really depends on how the firmware behaves, from USB POV, you can >>> always poll the device for data each minute. But might be other >>> constraints that I am not aware of. >>> >>> > I printed the configuration of the scale after installing pyusb and >>> starting >>> > the tutorial. >>> > >>> > >>> > CONFIGURATION 1: 20 mA =================================== >>> > bLength : 0x9 (9 bytes) >>> > bDescriptorType : 0x2 Configuration >>> > wTotalLength : 0x2d (45 bytes) >>> > bNumInterfaces : 0x1 >>> > bConfigurationValue : 0x1 >>> > iConfiguration : 0x0 >>> > bmAttributes : 0x80 Bus Powered >>> > bMaxPower : 0xa (20 mA) >>> > INTERFACE 0: Human Interface Device ==================== >>> > bLength : 0x9 (9 bytes) >>> > bDescriptorType : 0x4 Interface >>> > bInterfaceNumber : 0x0 >>> > bAlternateSetting : 0x0 >>> > bNumEndpoints : 0x2 >>> > bInterfaceClass : 0x3 Human Interface Device >>> > bInterfaceSubClass : 0x0 >>> > bInterfaceProtocol : 0x1 >>> > iInterface : 0x0 >>> > ENDPOINT 0x81: Interrupt IN ========================== >>> > bLength : 0x7 (7 bytes) >>> > bDescriptorType : 0x5 Endpoint >>> > bEndpointAddress : 0x81 IN >>> > bmAttributes : 0x3 Interrupt >>> > wMaxPacketSize : 0x40 (64 bytes) >>> > bInterval : 0x4 >>> > ENDPOINT 0x2: Interrupt OUT ========================== >>> > bLength : 0x7 (7 bytes) >>> > bDescriptorType : 0x5 Endpoint >>> > bEndpointAddress : 0x2 OUT >>> > bmAttributes : 0x3 Interrupt >>> > wMaxPacketSize : 0x40 (64 bytes) >>> > bInterval : 0x4 >>> > >>> > Any guidance would be greatly appreciated. >>> > >>> >>> >>> -- >>> Best Regards, >>> Wander Lairson Costa >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> pyusb-users mailing list >>> pyu...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyusb-users >>> >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> >> > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Ian D. <it....@gm...> - 2014-11-03 19:44:42
|
If you haven't already, I'd start by generating large log files of the scales interacting with the vendor-provided software. It's easy to do this on Linux using https://www.kernel.org/doc/Documentation/usb/usbmon.txt. Also, you have a USB HID device, which is a shortpath used by many vendors for "driverless" operation. Unfortunately this will make direct PyUSB interface slightly obnoxious. I'd check out http://pythonic-wisdom.blogspot.com/2009/07/usb-hid-with-linux-and-python.html and continue the search from there, looking less at PyUSB and perhaps more at the source of existing Python+USB+HID projects. BR, Ian On Mon, Nov 3, 2014 at 2:34 PM, Mark McClure <mar...@gm...> wrote: > Wander and all users, > > Thank you for getting back to me. As you can tell, all of this is foreign > to me since I'm a very novice programmer. When you say poll the USB POV, > do you mean "read" data from the device? > > Here's what I tried as I removed jelly beans from a scale over 10 seconds: > > import sys > import usb.core > import usb.util > import time > > dev = usb.core.find(idVendor = 0x0DBC, idProduct = 0x0005) > if dev is None: > raise ValueError('Device not found') > > dev.set_configuration() > > endpoint = dev[0][(0,0)][0] > > timestep = 0 > > while timestep <= 10: > data = dev.read(endpoint.bEndpointAddress, > endpoint.wMaxPacketSize) > print(data) > time.sleep(1) > timestep += 1 > > > The output was this: > > array('B', [0, 0, 87, 0, 0, 0, 0, 0]) > array('B', [0, 0, 0, 0, 0, 0, 0, 0]) > array('B', [0, 0, 98, 0, 0, 0, 0, 0]) > array('B', [0, 0, 0, 0, 0, 0, 0, 0]) > array('B', [0, 0, 98, 0, 0, 0, 0, 0]) > array('B', [0, 0, 0, 0, 0, 0, 0, 0]) > array('B', [0, 0, 98, 0, 0, 0, 0, 0]) > array('B', [0, 0, 0, 0, 0, 0, 0, 0]) > array('B', [0, 0, 98, 0, 0, 0, 0, 0]) > array('B', [0, 0, 0, 0, 0, 0, 0, 0]) > array('B', [0, 0, 96, 0, 0, 0, 0, 0]) > > But I don't have any idea what this means, except that I'm guessing that > changes in weight data were not recorded. > > Has anyone worked on a device like this? Some sample code might really > help me make sense of everything. > > On Mon, Nov 3, 2014 at 2:31 AM, Wander Lairson Costa < > wan...@gm...> wrote: > >> 2014-11-02 1:54 GMT-02:00 Mark McClure <mar...@gm...>: >> > Hello list: >> > >> > I have three A&D EJ-3000 scales that I want to simultaneously acquire >> data >> > from every 1 minute over 24-hr periods. All scales have a USB >> interface. >> > I've started working through the pyusb tutorial, but before I confuse >> myself >> > any further, I thought I'd ask if what I want to do is even possible? >> Tech >> > support at A&D told me that retrieving weight data from the scales >> > automatically (i.e. without pushing the print button on the scales) >> could >> > not be done with USB because the interface was uni-directional. >> Instead, >> > they suggested that I switch to RS-232. Is this true, and if so why? >> > >> >> Hi, >> >> It really depends on how the firmware behaves, from USB POV, you can >> always poll the device for data each minute. But might be other >> constraints that I am not aware of. >> >> > I printed the configuration of the scale after installing pyusb and >> starting >> > the tutorial. >> > >> > >> > CONFIGURATION 1: 20 mA =================================== >> > bLength : 0x9 (9 bytes) >> > bDescriptorType : 0x2 Configuration >> > wTotalLength : 0x2d (45 bytes) >> > bNumInterfaces : 0x1 >> > bConfigurationValue : 0x1 >> > iConfiguration : 0x0 >> > bmAttributes : 0x80 Bus Powered >> > bMaxPower : 0xa (20 mA) >> > INTERFACE 0: Human Interface Device ==================== >> > bLength : 0x9 (9 bytes) >> > bDescriptorType : 0x4 Interface >> > bInterfaceNumber : 0x0 >> > bAlternateSetting : 0x0 >> > bNumEndpoints : 0x2 >> > bInterfaceClass : 0x3 Human Interface Device >> > bInterfaceSubClass : 0x0 >> > bInterfaceProtocol : 0x1 >> > iInterface : 0x0 >> > ENDPOINT 0x81: Interrupt IN ========================== >> > bLength : 0x7 (7 bytes) >> > bDescriptorType : 0x5 Endpoint >> > bEndpointAddress : 0x81 IN >> > bmAttributes : 0x3 Interrupt >> > wMaxPacketSize : 0x40 (64 bytes) >> > bInterval : 0x4 >> > ENDPOINT 0x2: Interrupt OUT ========================== >> > bLength : 0x7 (7 bytes) >> > bDescriptorType : 0x5 Endpoint >> > bEndpointAddress : 0x2 OUT >> > bmAttributes : 0x3 Interrupt >> > wMaxPacketSize : 0x40 (64 bytes) >> > bInterval : 0x4 >> > >> > Any guidance would be greatly appreciated. >> > >> >> >> -- >> Best Regards, >> Wander Lairson Costa >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> pyusb-users mailing list >> pyu...@li... >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > |
From: Mark M. <mar...@gm...> - 2014-11-03 19:35:02
|
Wander and all users, Thank you for getting back to me. As you can tell, all of this is foreign to me since I'm a very novice programmer. When you say poll the USB POV, do you mean "read" data from the device? Here's what I tried as I removed jelly beans from a scale over 10 seconds: import sys import usb.core import usb.util import time dev = usb.core.find(idVendor = 0x0DBC, idProduct = 0x0005) if dev is None: raise ValueError('Device not found') dev.set_configuration() endpoint = dev[0][(0,0)][0] timestep = 0 while timestep <= 10: data = dev.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize) print(data) time.sleep(1) timestep += 1 The output was this: array('B', [0, 0, 87, 0, 0, 0, 0, 0]) array('B', [0, 0, 0, 0, 0, 0, 0, 0]) array('B', [0, 0, 98, 0, 0, 0, 0, 0]) array('B', [0, 0, 0, 0, 0, 0, 0, 0]) array('B', [0, 0, 98, 0, 0, 0, 0, 0]) array('B', [0, 0, 0, 0, 0, 0, 0, 0]) array('B', [0, 0, 98, 0, 0, 0, 0, 0]) array('B', [0, 0, 0, 0, 0, 0, 0, 0]) array('B', [0, 0, 98, 0, 0, 0, 0, 0]) array('B', [0, 0, 0, 0, 0, 0, 0, 0]) array('B', [0, 0, 96, 0, 0, 0, 0, 0]) But I don't have any idea what this means, except that I'm guessing that changes in weight data were not recorded. Has anyone worked on a device like this? Some sample code might really help me make sense of everything. On Mon, Nov 3, 2014 at 2:31 AM, Wander Lairson Costa < wan...@gm...> wrote: > 2014-11-02 1:54 GMT-02:00 Mark McClure <mar...@gm...>: > > Hello list: > > > > I have three A&D EJ-3000 scales that I want to simultaneously acquire > data > > from every 1 minute over 24-hr periods. All scales have a USB interface. > > I've started working through the pyusb tutorial, but before I confuse > myself > > any further, I thought I'd ask if what I want to do is even possible? > Tech > > support at A&D told me that retrieving weight data from the scales > > automatically (i.e. without pushing the print button on the scales) could > > not be done with USB because the interface was uni-directional. Instead, > > they suggested that I switch to RS-232. Is this true, and if so why? > > > > Hi, > > It really depends on how the firmware behaves, from USB POV, you can > always poll the device for data each minute. But might be other > constraints that I am not aware of. > > > I printed the configuration of the scale after installing pyusb and > starting > > the tutorial. > > > > > > CONFIGURATION 1: 20 mA =================================== > > bLength : 0x9 (9 bytes) > > bDescriptorType : 0x2 Configuration > > wTotalLength : 0x2d (45 bytes) > > bNumInterfaces : 0x1 > > bConfigurationValue : 0x1 > > iConfiguration : 0x0 > > bmAttributes : 0x80 Bus Powered > > bMaxPower : 0xa (20 mA) > > INTERFACE 0: Human Interface Device ==================== > > bLength : 0x9 (9 bytes) > > bDescriptorType : 0x4 Interface > > bInterfaceNumber : 0x0 > > bAlternateSetting : 0x0 > > bNumEndpoints : 0x2 > > bInterfaceClass : 0x3 Human Interface Device > > bInterfaceSubClass : 0x0 > > bInterfaceProtocol : 0x1 > > iInterface : 0x0 > > ENDPOINT 0x81: Interrupt IN ========================== > > bLength : 0x7 (7 bytes) > > bDescriptorType : 0x5 Endpoint > > bEndpointAddress : 0x81 IN > > bmAttributes : 0x3 Interrupt > > wMaxPacketSize : 0x40 (64 bytes) > > bInterval : 0x4 > > ENDPOINT 0x2: Interrupt OUT ========================== > > bLength : 0x7 (7 bytes) > > bDescriptorType : 0x5 Endpoint > > bEndpointAddress : 0x2 OUT > > bmAttributes : 0x3 Interrupt > > wMaxPacketSize : 0x40 (64 bytes) > > bInterval : 0x4 > > > > Any guidance would be greatly appreciated. > > > > > -- > Best Regards, > Wander Lairson Costa > > > ------------------------------------------------------------------------------ > _______________________________________________ > pyusb-users mailing list > pyu...@li... > https://lists.sourceforge.net/lists/listinfo/pyusb-users > |
From: Emmanuel B. <ebl...@gm...> - 2014-11-03 19:10:38
|
> It hasn't. This is a fresh compile under 10.6.8. I am trying -- hard -- to > avoid using homebrew and similar. I personally never broke my systems with Homebrew (but I did several time with MacPorts and Fink), and I now use it intensively, but I guess that YMMV. > Adding libusb path to DYLD_LIBRARY_PATH should be enough. > export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib > export DYLD_LIBRARY_PATH=/usr/local/lib It should, but in any case you do not need both (remove DYLD_FALLBACK_LIBRARY_PATH, although it does not hurt) > It doesn't appear that the DEBUG log command does anything, but this is > still just trying to get libusb to wake up, so I wouldn't expect it to. Maybe you should try to move one step downwards and check what Python'c ctypes is able to load: $ python >>> import ctypes >>> import ctypes.util >>> ctypes.util.find_library('libusb-1.0') should return /usr/local/lib/libusb-1.0.dylib >>> ctypes.cdll.LoadLibrary('libusb-1.0.dylib') should return <CDLL 'libusb-1.0.dylib', handle ...> Does it work on your environment? Cheers, Manu |