I have inverter DC/AC and I need to read the data.
I have create the python code for communicate with rs232, but I need to create the same software for USB.
I have connect the inverter at raspberry and the command:
lsusb gives me this:
ID 0665:5161 Cypress Semiconductor USB to Serial
How to connect with this and send and receive data?
I tried this code:
import usb.core import usb.util import sys dev = usb.core.find(idVendor=0x0665, idProduct=0x5161) if dev.is_kernel_driver_active(0) is True: dev.detach_kernel_driver(0) if dev is None: raise ValueError('Device not found') dev.set_configuration() print "Device Found!" dev.write(0x81,"QID",100) byteread = dev.read(0x81,64) print byteread
But receive this error :
usb.core.USBError: [Errno 110] Operation timed out