On Fri, Jun 1, 2018 at 9:48 AM, Sasha Yousefi <sashayous...@berkeley.edu> wrote:
> Hello,
> Hope you are well. I am having trouble communicating with my device using
> read and write. My code is able to recognize the device as well as get
> attributes of the device. However, when I write to device using
> dev.write(endpoint  =  2, message = 'OR'), there is no change in the device.
> Here is the output of the device attributes. Is there anything I am missing
> with the write methods? The specific commands for the device are indicated
> by 2 ASCII letters (in the example above, 'OR'). Please let me know if there
> is anything I can do to modify my write command. Thank you so much.
>
> DEVICE ID 0403:6001 on Bus 020 Address 020 =================

>  idVendor               : 0x0403
>
>  idProduct              : 0x6001
>
>  bcdDevice              :  0x600 Device 6.0
>
>  iManufacturer          :    0x1 FTDI
>
>  iProduct               :    0x2 USB-RS422 Cable
>

This is a FTDI device and it has its own communication protocol.
You will have to understand the device communication protocol in
order to use pyusb/libusb to talk to it.

On the other hand, people has already developed python package
to talk to FTDI device -- pyftdi is based on pyusb and pyserial. You
can give it a try (I think it is only for Python 3.x)

Ref: https://github.com/eblot/pyftdi

-- 
Xiaofan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to