Skip to content

Linux平台下端口名称格式为/dev/ttyUSB could not open port #1

@Tonymaxs

Description

@Tonymaxs

Linux平台下端口名称格式为/dev/ttyUSB + 编号, 示例如下:
下了:
arm = WlkataMirobot(portname='/dev/ttyUSB0')
Exception:
Traceback (most recent call last):
File "/home/tonyhsiao/wlkata-mirobot-python-main/wlkata_mirobot/wlkata_mirobot_serial.py", line 162, in open
self.serialport.open()
File "/usr/lib/python3/dist-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 : [Errno 2] No such file or directory: ''

只下arm = WlkataMirobot()能正常運行。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions