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 <
[email protected]> wrote:
> 2014-11-02 1:54 GMT-02:00 Mark McClure <[email protected]>:
> > 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
------------------------------------------------------------------------------
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users