-1

I have been trying for 4 days now to send the hex code 10 80 00 00 00 00 00 00 to a USB device connected to my raspberry pi running debian.

I've tried libusb with c but I have no idea what I am doing. I thought PyUSB would be a better solution but ive found zero documentation for what I need and the tutorial did'nt help.

I can find the device using

import usb.core
dev = usb.core.find(idVendor=0x12BF, idProduct=0xFF03)

But I cant find any information on how to send the above hex code. My device is a usb based relay. It works fine on windows in a vb HID application but I am struggling here. seem to be going round in circles.

Ravichandran Jothi
  • 3,028
  • 11
  • 52
  • 82
user1910155
  • 1
  • 1
  • 1
  • Im assuming i need to use some sort of command like dev.ctrl_transfer(0x40,0x09,0,0,[0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00]) – user1910155 Dec 17 '12 at 14:50

1 Answers1

0

Could you please tell us, how is the USB communication with the device? Is it a bulk transfer? (see this link for more details: http://www.beyondlogic.org/usbnutshell/usb1.shtml )

For instance, if you are using a bulk communication via an Endpoint you could try something like this (as seen here http://pyusb.sourceforge.net/docs/1.0/tutorial.html):

endpoint.write(endpointnumber, data, interfacenumber)

If you want to send a hex value, let's say 0xFF via the endpoint 2, interface 0, try something like:

endpoint.write(2, '\xFF', 0)

I hope this helps...

iluvatar
  • 65
  • 5