original data length = 524288 bytes
0. ttyS0 hwid=PNP0501
1. CP2108 Quad USB to UART Bridge Controller - CP2108 Interface 3 hwid=USB VID:PID=10C4:EA71 SER=40514E02D54EB08011E72A9E738F7EB LOCATION=1-4:1.3
2. CP2108 Quad USB to UART Bridge Controller - CP2108 Interface 2 hwid=USB VID:PID=10C4:EA71 SER=40514E02D54EB08011E72A9E738F7EB LOCATION=1-4:1.2
3. CP2108 Quad USB to UART Bridge Controller - CP2108 Interface 1 hwid=USB VID:PID=10C4:EA71 SER=40514E02D54EB08011E72A9E738F7EB LOCATION=1-4:1.1
4. CP2108 Quad USB to UART Bridge Controller - CP2108 Interface 0 hwid=USB VID:PID=10C4:EA71 SER=40514E02D54EB08011E72A9E738F7EB LOCATION=1-4:1.0
Please select a port (enter a number): 2
Traceback (most recent call last):
File "/root/.local/lib/python3.10/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: 'ttyUSB2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zchliu/work/FPGA-Gzip-compressor/Arty-example/python/fpga_uart_gz.py", line 127, in <module>
gz_data, err_msg = GzipCompressUsePort(port_name, orig_data)
File "/home/zchliu/work/FPGA-Gzip-compressor/Arty-example/python/fpga_uart_gz.py", line 53, in GzipCompressUsePort
port = Serial(port_name, baudrate=115200, timeout=1.0)
File "/root/.local/lib/python3.10/site-packages/serial/serialutil.py", line 244, in __init__
self.open()
File "/root/.local/lib/python3.10/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port ttyUSB2: [Errno 2] No such file or directory: 'ttyUSB2'
port = Serial("/dev/serial/by-id/usb-Silicon_Labs_CP2108_Quad_USB_to_UART_Bridge_Controller_40514E02D54EB08011E72A9E738F7EB-if02-port0", baudrate=115200, timeout=1.0)
# try :
# port = Serial(port_name, baudrate=115200, timeout=1.0)
# except :
# return None, '**error: Unable to open port %s' % port_name