i'm new raspberry pi. tried connect plc raspberry pi using 1a86:7523 qinheng electronics hl-340 usb-serial adapter. not working. did is.
1 download zip file of above adapter driver linux
2 extract it
3 run make command
4 connect usb serial adapter raspberry pi ( connected pin 2 , pin 3 of serial port together)
5 run putty on raspberry , select serial , type port ttyusb0 , clicked open
6 new windows popup , when type on keyboard there no letters appear. cursor position changed keys
converter problem ? or there method connect plc raspberry pi via modbus protocol?
1 download zip file of above adapter driver linux
2 extract it
3 run make command
4 connect usb serial adapter raspberry pi ( connected pin 2 , pin 3 of serial port together)
5 run putty on raspberry , select serial , type port ttyusb0 , clicked open
6 new windows popup , when type on keyboard there no letters appear. cursor position changed keys
converter problem ? or there method connect plc raspberry pi via modbus protocol?
the same me
pi@raspberrypi:~ $ lsusb
bus 001 device 006: id 1a86:7523 qinheng electronics hl-340 usb-serial adapter
bus 001 device 005: id 046d:c077 logitech, inc.
bus 001 device 004: id 413c:2107 dell computer corp.
bus 001 device 003: id 0424:ec00 standard microsystems corp. smsc9512/9514 fast ethernet adapter
bus 001 device 002: id 0424:9514 standard microsystems corp.
bus 001 device 001: id 1d6b:0002 linux foundation 2.0 root hub
pi@raspberrypi:~ $ ls -l /dev/ttyusb*
crwxrwxrwx 1 root dialout 188, 0 dec 2 05:32 /dev/ttyusb0
bus 001 device 006: id 1a86:7523 qinheng electronics hl-340 usb-serial adapter
couldn't open device, information missing
device descriptor:
blength 18
bdescriptortype 1
bcdusb 1.10
bdeviceclass 255 vendor specific class
bdevicesubclass 0
bdeviceprotocol 0
bmaxpacketsize0 8
idvendor 0x1a86 qinheng electronics
idproduct 0x7523 hl-340 usb-serial adapter
bcddevice 2.54
imanufacturer 0
iproduct 2
iserial 0
bnumconfigurations 1
configuration descriptor:
blength 9
bdescriptortype 2
wtotallength 39
bnuminterfaces 1
bconfigurationvalue 1
iconfiguration 0
bmattributes 0x80
(bus powered)
maxpower 96ma
interface descriptor:
blength 9
bdescriptortype 4
binterfacenumber 0
balternatesetting 0
bnumendpoints 3
binterfaceclass 255 vendor specific class
binterfacesubclass 1
binterfaceprotocol 2
iinterface 0
endpoint descriptor:
blength 7
bdescriptortype 5
bendpointaddress 0x82 ep 2 in
bmattributes 2
transfer type bulk
synch type none
usage type data
wmaxpacketsize 0x0020 1x 32 bytes
binterval 0
endpoint descriptor:
blength 7
bdescriptortype 5
bendpointaddress 0x02 ep 2 out
bmattributes 2
transfer type bulk
synch type none
usage type data
wmaxpacketsize 0x0020 1x 32 bytes
binterval 0
endpoint descriptor:
blength 7
bdescriptortype 5
bendpointaddress 0x81 ep 1 in
bmattributes 3
transfer type interrupt
synch type none
usage type data
wmaxpacketsize 0x0008 1x 8 bytes
binterval 1
pi@raspberrypi:~ $ python -m serial.tools.list_ports
/dev/ttys0
/dev/ttyusb0
2 ports found
>>> ser.open()
>>> ser
serial<id=0x76a21c50, open=true>(port='/dev/ttyusb0', baudrate=19200, bytesize=8, parity='n', stopbits=1, timeout=1, xonxoff=false, rtscts=false, dsrdtr=false)
>>> ser.readall()
''
>>> ser.write("sw i01\r\n")
8
>>> ser.readall()
raspberrypi
Comments
Post a Comment