小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
不能打开USB端口
-
编写第一个程序Hello World不成功,显示 CH340 端口不存在
Hello world程序上传不成功,显示USB端口不存在
- 系统:Ubuntu 22.04 虚拟机
- 按照教程《5.第一个HelloWord工程 (fishros.com)》编写Hello world程序,编译通过,程序上传不能成功,提示 串口不存在。提示信息如下:
Warning! Please install
99-platformio-udev.rules
.More details: https://docs.platformio.org/en/latest/core/installation/udev-rules.html
Auto-detected: /dev/ttyS0
Uploading .pio/build/featheresp32/firmware.bin
esptool.py v4.5.1
Serial port /dev/ttyS0
A fatal error occurred: Could not open /dev/ttyS0, the port doesn't exist
*** [upload] Error 2
=========================================================================== [FAILED] Took 5.21 seconds ===========================================================================
-
The terminal process "platformio 'run', '--target', 'upload'" terminated with exit code: 1.
-
Terminal will be reused by tasks, press any key to close it.
尝试
-
按照 Ubuntu22.04 CH340系列串口芯片无法识别终极问题解决方案 | 鱼香ROS (fishros.org.cn) 步骤分别禁用/卸载 占用项,然后重启Ubuntu,还是不行。
-
使用lsusb,显示如下信息
lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub- 更新驱动
从CH341SER_LINUX.ZIP - (wch.cn)下载驱动,按照说明,重新 make ,显示如下错误:
make
make -C /lib/modules/6.5.0-28-generic/build M=/home/cshh/Downloads/CH341SER_LINUX/driver
make[1]: Entering directory '/usr/src/linux-headers-6.5.0-28-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
You are using:
CC [M] /home/cshh/Downloads/CH341SER_LINUX/driver/ch341.o
/bin/sh: 1: gcc-12: not found
make[3]: *** [scripts/Makefile.build:251: /home/cshh/Downloads/CH341SER_LINUX/driver/ch341.o] Error 127
make[2]: *** [/usr/src/linux-headers-6.5.0-28-generic/Makefile:2039: /home/cshh/Downloads/CH341SER_LINUX/driver] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.5.0-28-generic'
make: *** [Makefile:5: default] Error 2
-
@570396673 1.检查是否有 /dev/ttyUSB0 2.检查驱动占用是否解决 3.检查是否是虚拟机问题