小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
usb转串口绑定了也不能用,有人知道什么原因吗?
-
m@jt:~$ ros2 launch rikibot_foc_driver rikibot_foc_driver.launch.py
[INFO] [launch]: All log files can be found below /home/m/.ros/log/2022-10-11-23-51-15-717775-jt-3026
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [rikibot_foc_driver-1]: process started with pid [3027]
[rikibot_foc_driver-1] [INFO] [1665503475.849932821] [rikibot_foc_driver]: Rikibot Serial Unable to open port各种方法都试过了,轮毂控制版通过和笔记本连接的usb转串口打不开,底盘不工作,有人知道怎么设置吗?
m@jt:~$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 04f2:b2ea Chicony Electronics Co., Ltd Integrated Camera [ThinkPad]
Bus 001 Device 005: ID 8086:0187 Intel Corp. Intel(R) Centrino(R) Advanced-N + WiMAX 6250
Bus 001 Device 004: ID 0a5c:2110 Broadcom Corp. BCM2045B (BDC-2) [Bluetooth Controller]
Bus 001 Device 003: ID 0000:3825 USB OPTICAL MOUSE
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubm@jt:~$ udevadm info --attribute-walk --name=/dev/ttyS0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.looking at device '/devices/platform/serial8250/tty/ttyS0':
KERNEL=="ttyS0"
SUBSYSTEM=="tty"
DRIVER==""
ATTR{close_delay}=="50"
ATTR{closing_wait}=="3000"
ATTR{console}=="N"
ATTR{custom_divisor}=="0"
ATTR{flags}=="0x10000040"
ATTR{io_type}=="0"
ATTR{iomem_base}=="0x0"
ATTR{iomem_reg_shift}=="0"
ATTR{irq}=="4"
ATTR{line}=="0"
ATTR{port}=="0x3F8"
ATTR{power/async}=="disabled"
ATTR{power/control}=="auto"
ATTR{power/runtime_active_kids}=="0"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_enabled}=="disabled"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
ATTR{power/runtime_usage}=="0"
ATTR{power/wakeup}=="disabled"
ATTR{power/wakeup_abort_count}==""
ATTR{power/wakeup_active}==""
ATTR{power/wakeup_active_count}==""
ATTR{power/wakeup_count}==""
ATTR{power/wakeup_expire_count}==""
ATTR{power/wakeup_last_time_ms}==""
ATTR{power/wakeup_max_time_ms}==""
ATTR{power/wakeup_total_time_ms}==""
ATTR{type}=="0"
ATTR{uartclk}=="1843200"
ATTR{xmit_fifo_size}=="0"looking at parent device '/devices/platform/serial8250':
KERNELS=="serial8250"
SUBSYSTEMS=="platform"
DRIVERS=="serial8250"
ATTRS{driver_override}=="(null)"
ATTRS{power/async}=="disabled"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_kids}=="0"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_enabled}=="disabled"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="0"looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
ATTRS{power/async}=="disabled"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_kids}=="0"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_enabled}=="disabled"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="0"/etc/udev/rules.d/usb.rules
KERNEL=="serial8250", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0777", SYMLINK+="ttyTHS1"
帮忙看看哪里设置的不对,端口就是打不开
-
@毛哥成山轮胎机油保养 没绑定前可以用吗?我之前在22上也遇到过一次问题。
终端输入
sudo dmesg | grep brltty
如果你能收到这样的结果
[ 7033.078452] usb 1-13: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
问题就很明显了,是驱动占用问题
sudo apt remove brltty
重新插拔一下即可
|__ Port 13: Dev 7, If 0, Class=Vendor Specific Class, Driver=ch341, 12M
ls /dev/ttyUSB0 /dev/ttyUSB0
-
@小鱼 鱼总,我心中的大神,按你说的方法,底盘终于在humble又重新启动了,收徒弟不?
sudo apt remove brltty
用这个命令卸载了brltty
m@jt:~$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b2ea Chicony Electronics Co., Ltd Integrated Camera [ThinkPad]
Bus 001 Device 004: ID 8086:0187 Intel Corp. Intel(R) Centrino(R) Advanced-N + WiMAX 6250
Bus 001 Device 003: ID 0a5c:2110 Broadcom Corp. BCM2045B (BDC-2) [Bluetooth Controller]
Bus 001 Device 006: ID 0000:3825 USB OPTICAL MOUSE
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubm@jt:~$ udevadm info --attribute-walk --name=/dev/ttyUSB0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.looking at device '/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ttyUSB0/tty/ttyUSB0':
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty"
DRIVER==""
ATTR{power/async}=="disabled"
ATTR{power/control}=="auto"
ATTR{power/runtime_active_kids}=="0"
ATTR{power/runtime_active_time}=="0"
ATTR{power/runtime_enabled}=="disabled"
ATTR{power/runtime_status}=="unsupported"
ATTR{power/runtime_suspended_time}=="0"
ATTR{power/runtime_usage}=="0"looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ttyUSB0':
KERNELS=="ttyUSB0"
SUBSYSTEMS=="usb-serial"
DRIVERS=="ch341-uart"
ATTRS{port_number}=="0"
ATTRS{power/async}=="enabled"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_kids}=="0"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_enabled}=="disabled"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="0"looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0':
KERNELS=="3-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="ch341"
ATTRS{authorized}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceClass}=="ff"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bInterfaceProtocol}=="02"
ATTRS{bInterfaceSubClass}=="01"
ATTRS{bNumEndpoints}=="03"
ATTRS{power/async}=="enabled"
ATTRS{power/runtime_active_kids}=="0"
ATTRS{power/runtime_enabled}=="enabled"
ATTRS{power/runtime_status}=="suspended"
ATTRS{power/runtime_usage}=="0"
ATTRS{supports_autosuspend}=="1"looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-1':
KERNELS=="3-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="ff"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{bMaxPower}=="98mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0264"
ATTRS{bmAttributes}=="80"
ATTRS{busnum}=="3"
ATTRS{configuration}==""
ATTRS{devnum}=="2"
ATTRS{devpath}=="1"
ATTRS{idProduct}=="7523"
ATTRS{idVendor}=="1a86"
ATTRS{ltm_capable}=="no"
ATTRS{maxchild}=="0"
ATTRS{power/active_duration}=="544244"
ATTRS{power/async}=="enabled"
ATTRS{power/autosuspend}=="2"
ATTRS{power/autosuspend_delay_ms}=="2000"
ATTRS{power/connected_duration}=="544248"
ATTRS{power/control}=="on"
ATTRS{power/level}=="on"
ATTRS{power/persist}=="1"
ATTRS{power/runtime_active_kids}=="0"
ATTRS{power/runtime_active_time}=="543971"
ATTRS{power/runtime_enabled}=="forbidden"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="1"
ATTRS{product}=="USB Serial"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="removable"
ATTRS{rx_lanes}=="1"
ATTRS{speed}=="12"
ATTRS{tx_lanes}=="1"
ATTRS{urbnum}=="29102"
ATTRS{version}==" 1.10"looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3':
KERNELS=="usb3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{authorized_default}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="0mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0515"
ATTRS{bmAttributes}=="e0"
ATTRS{busnum}=="3"
ATTRS{configuration}==""
ATTRS{devnum}=="1"
ATTRS{devpath}=="0"
ATTRS{idProduct}=="0002"
ATTRS{idVendor}=="1d6b"
ATTRS{interface_authorized_default}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 5.15.0-50-generic xhci-hcd"
ATTRS{maxchild}=="4"
ATTRS{power/active_duration}=="544484"
ATTRS{power/async}=="enabled"
ATTRS{power/autosuspend}=="0"
ATTRS{power/autosuspend_delay_ms}=="0"
ATTRS{power/connected_duration}=="566148"
ATTRS{power/control}=="auto"
ATTRS{power/level}=="auto"
ATTRS{power/runtime_active_kids}=="1"
ATTRS{power/runtime_active_time}=="544473"
ATTRS{power/runtime_enabled}=="enabled"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="21664"
ATTRS{power/runtime_usage}=="0"
ATTRS{power/wakeup}=="disabled"
ATTRS{power/wakeup_abort_count}==""
ATTRS{power/wakeup_active}==""
ATTRS{power/wakeup_active_count}==""
ATTRS{power/wakeup_count}==""
ATTRS{power/wakeup_expire_count}==""
ATTRS{power/wakeup_last_time_ms}==""
ATTRS{power/wakeup_max_time_ms}==""
ATTRS{power/wakeup_total_time_ms}==""
ATTRS{product}=="xHCI Host Controller"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="unknown"
ATTRS{rx_lanes}=="1"
ATTRS{serial}=="0000:00:14.0"
ATTRS{speed}=="480"
ATTRS{tx_lanes}=="1"
ATTRS{urbnum}=="33"
ATTRS{version}==" 2.00"looking at parent device '/devices/pci0000:00/0000:00:14.0':
KERNELS=="0000:00:14.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{ari_enabled}=="0"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0330"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x1e31"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="26"
ATTRS{local_cpulist}=="0-3"
ATTRS{local_cpus}=="0f"
ATTRS{msi_bus}=="1"
ATTRS{msi_irqs/26}=="msi"
ATTRS{numa_node}=="-1"
ATTRS{power/async}=="enabled"
ATTRS{power/control}=="on"
ATTRS{power/runtime_active_kids}=="1"
ATTRS{power/runtime_active_time}=="566890"
ATTRS{power/runtime_enabled}=="forbidden"
ATTRS{power/runtime_status}=="active"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="1"
ATTRS{power/wakeup}=="enabled"
ATTRS{power/wakeup_abort_count}=="0"
ATTRS{power/wakeup_active}=="0"
ATTRS{power/wakeup_active_count}=="0"
ATTRS{power/wakeup_count}=="0"
ATTRS{power/wakeup_expire_count}=="0"
ATTRS{power/wakeup_last_time_ms}=="0"
ATTRS{power/wakeup_max_time_ms}=="0"
ATTRS{power/wakeup_total_time_ms}=="0"
ATTRS{power_state}=="D0"
ATTRS{revision}=="0x04"
ATTRS{subsystem_device}=="0x21fa"
ATTRS{subsystem_vendor}=="0x17aa"
ATTRS{vendor}=="0x8086"looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
ATTRS{power/async}=="enabled"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_kids}=="13"
ATTRS{power/runtime_active_time}=="0"
ATTRS{power/runtime_enabled}=="disabled"
ATTRS{power/runtime_status}=="unsupported"
ATTRS{power/runtime_suspended_time}=="0"
ATTRS{power/runtime_usage}=="0"
ATTRS{waiting_for_supplier}=="0"sudo gedit /etc/udev/rules.d/usb.rules
KERNELS=="3-1:1.0", MODE:="0777", GROUP:="dialout", SYMLINK+="ttyTHS1"
保存usb.rules重启笔记本就可以打开端口正常运行了。下面是运行效果
m@jt:~$ ros2 launch rikibot_foc_driver rikibot_foc_driver.launch.py
[INFO] [launch]: All log files can be found below /home/m/.ros/log/2022-10-12-18-24-59-458983-jt-3526
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [rikibot_foc_driver-1]: process started with pid [3527]
[rikibot_foc_driver-1] [INFO] [1665570299.597206717] [rikibot_foc_driver]: Rikibot Serial Port opened绑定usb端口用的这个网址的方法
ubuntu下绑定USB设备的串口名称*不解决端口占用前 ls /dev/ttyUSB0 显示没有这个usb,卸载brltty才能显示出正常usb0信息
水太深了,有点不适应。 -
@毛哥成山轮胎机油保养 我是四月份搞得,刚出来,真的是折腾死了,有用就成
-
@小鱼 弄了好几天,就是不成功,按网上的绑定方法都试了一遍,ttyUSB0 根本就没有 有ttyS0,我还以为ubuntu22.04把usb的名字给改了呢?这水也太深了
-
@毛哥成山轮胎机油保养 被这个brltty坑的人不少呀
ubuntu22.04的 brltty 导致 USB 转串口连接失败