Na tej stránke treba stlačiť "see more" a objaví sa i ďalšia časť
https://postimg.cc/BtyNcQ4c#!/usr/bin/python
import serial
ser = serial.Serial()
ser.port = "/dev/ttyUSB0"
ser.baudrate = 9600
ser.bytesize = serial.EIGHTBITS #number of bits per bytes
ser.parity = serial.PARITY_NONE #set parity check: no parity
ser.stopbits = serial.STOPBITS_ONE #number of stop bits
#ser.timeout = None #block read
ser.timeout = 1 #non-block read
#ser.timeout = 2 #timeout block read
ser.xonxoff = False #disable software flow control
ser.rtscts = False #disable hardware (RTS/CTS) flow control
ser.dsrdtr = False #disable hardware (DSR/DTR) flow control
ser.writeTimeout = 2 #timeout for write
if ser.isOpen() :
ser.close()
ser.open()
ser.write("hello") # write a string
ser.close()
root@Lenovo-G40-30:~# ls -ln ~/.wine/dosdevices/com*
lrwxrwxrwx 1 0 0 12 lut 28 20:44 /root/.wine/dosdevices/com1 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:01 /root/.wine/dosdevices/com2 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:01 /root/.wine/dosdevices/com3 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:01 /root/.wine/dosdevices/com4 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:02 /root/.wine/dosdevices/com5 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:02 /root/.wine/dosdevices/com6 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:02 /root/.wine/dosdevices/com7 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:02 /root/.wine/dosdevices/com8 -> /dev/ttyUSB0
lrwxrwxrwx 1 0 0 12 lut 28 21:02 /root/.wine/dosdevices/com9 -> /dev/ttyUSB0