我正在尝试使用 esptool 将 MicroPython 刷入我的 ESP8266 芯片(使用这主板),而我在部署固件时遇到了困难(目前遵循MicroPython 文档)。
当我尝试查找 dev 路径时,ttyUSB 根本没有出现
tristan@tristan-Laptop:~$ ls /dev/tty.*
ls: cannot access '/dev/tty.*': No such file or directory
tristan@tristan-Laptop:~$ ls /dev/ttyUSB*
ls: cannot access '/dev/ttyUSB*': No such file or directory
tristan@tristan-Laptop:~$
这是我使用时的输出系统盘
tristan@tristan-Laptop:~$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd. Goodix USB2.0 MISC
Bus 003 Device 003: ID 0bda:5634 Realtek Semiconductor Corp. Laptop Camera
Bus 003 Device 014: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 003 Device 012: ID 046d:c08b Logitech, Inc. G502 SE HERO Gaming Mouse
Bus 003 Device 005: ID 8087:0032 Intel Corp. AX210 Bluetooth
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
我确定我的设备是 Silicon Labs CP210x UART Bridge,因此我尝试运行擦除闪存命令,/dev/bus/usb/003/014
这是我的输出
tristan@tristan-Laptop:~$ sudo esptool.py --port /dev/bus/usb/003/014 erase_flash
esptool.py v4.1
Serial port /dev/bus/usb/003/014
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/serial/serialposix.py", line 398, in _reconfigure_port
orig_attr = termios.tcgetattr(self.fd)
termios.error: (25, 'Inappropriate ioctl for device')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/esptool.py", line 34, in <module>
esptool._main()
File "/usr/local/lib/python3.10/dist-packages/esptool/__init__.py", line 995, in _main
main()
File "/usr/local/lib/python3.10/dist-packages/esptool/__init__.py", line 637, in main
esp = esp or get_default_connected_device(
File "/usr/local/lib/python3.10/dist-packages/esptool/__init__.py", line 880, in get_default_connected_device
_esp = detect_chip(
File "/usr/local/lib/python3.10/dist-packages/esptool/cmds.py", line 88, in detect_chip
detect_port = ESPLoader(port, baud, trace_enabled=trace_enabled)
File "/usr/local/lib/python3.10/dist-packages/esptool/loader.py", line 246, in __init__
self._port = serial.serial_for_url(port)
File "/usr/local/lib/python3.10/dist-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/usr/local/lib/python3.10/dist-packages/serial/serialposix.py", line 332, in open
self._reconfigure_port(force_update=True)
File "/usr/local/lib/python3.10/dist-packages/serial/serialposix.py", line 401, in _reconfigure_port
raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')
答案1
跑步:
sudo apt remove brltty
然后重启电脑。对我来说,它成功了!