➜ ~ uname -a
Linux Ubuntu 5.15.30-2-pve #1 SMP PVE 5.15.30-3 (Fri, 22 Apr 2022 18:08:27 +0200) x86_64 x86_64 x86_64 GNU/Linux
➜ ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
➜ ~ lsusb
Bus 002 Device 003: ID abcd:1234 LogiLink UDisk flash drive
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 007: ID 1a86:7523 QinHeng Electronics CH340 serial converter
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
➜ ~ dmesg
[41920.762031] usb 1-1.3: new full-speed USB device number 7 using ehci-pci
[41920.871370] usb 1-1.3: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice=81.33
[41920.871377] usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[41920.871381] usb 1-1.3: Product: USB Serial
[41920.871750] ch341 1-1.3:1.0: ch341-uart converter detected
[41920.872631] usb 1-1.3: ch341-uart converter now attached to ttyUSB0
➜ ~ lsmod | grep ch341
ch341 24576 0
usbserial 57344 1 ch341
➜ ~ ls /dev/tty*
/dev/tty /dev/tty1 /dev/tty2
I can't find /dev/ttyUSBO
when I open it:
/dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
答案1
Update
==========================================
I can find /dev/ttyUSB0 in ProxmoxVE:
➜ ~ ls /dev/ttyUSB*
/dev/ttyUSB0
but i can't find it in lxc VM for Ubuntu:
➜ ~ ls /dev/tty*
/dev/tty /dev/tty1 /dev/tty2
I solved this problem !
==========================================
I changed the lxc.conf:
lxc.cgroup.devices.allow: c 189:2 rwm
lxc.mount.entry: /dev/bus/usb/001/003 dev/bus/usb/001/003 none bind,optional,create=file
to
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
If you have problem :
ttyUSB0: Operation not permitted
you can change lxc.cgroup.devices.allow
to lxc.cgroup2.devices.allow
答案2
我来到这里是因为我无法使用arduino-cli board list
或来查看我的主板/dev/ttyUSB*
,因此记录如下:
sudo apt remove brltty
对我有用。
答案3
我遇到了类似的错误 - 忘记了检查问题的所有命令,这里的问题帮助我解决了 /dev/ttyUSB0 没有出现在我的 Wemos D1 mini 上的问题:
sudo tail -f /var/log/syslog
...这让我对盲文支持产生了疑惑 - 这似乎与设备有关。卸载它后,/dev/ttyUSB0 就启动了。
不确定还有什么对其他人可能重要,所以我发布了所有内容:
kernel: [ 3701.058050] usb 1-1: new full-speed USB device number 11 using xhci_hcd
kernel: [ 3701.308316] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
kernel: [ 3701.308323] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
kernel: [ 3701.308325] usb 1-1: Product: USB2.0-Ser!
kernel: [ 3701.325056] ch341 1-1:1.0: ch341-uart converter detected
kernel: [ 3701.338267] ch341-uart ttyUSB0: break control not supported, using simulated break
kernel: [ 3701.338353] usb 1-1: ch341-uart converter now attached to ttyUSB0
mtp-probe: checking bus 1, device 11: "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1"
mtp-probe: bus: 1, device: 11 was not an MTP device
kernel: [ 3701.349766] audit: type=1400 audit(1668855910.056:255): apparmor="DENIED" operatio n="open" profile="snap.keepassxc.keepassxc" name="/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1/busnum" pid=3055 comm="keepassxc" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
snapd[1343]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
kernel: [ 3701.381545] audit: type=1400 audit(1668855910.088:256): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/proc/tty/drivers" pid=3087 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
snapd[1343]: hotplug.go:200: hotplug device add event ignored, enable experimental.hotplug
systemd-udevd[14444]: 1-1:1.0: Process '/usr/lib/snapd/snap-device-helper bind snap_cups_cupsd /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1/1-1:1.0 0:0' failed with exit code 1.
systemd-udevd[14444]: 1-1:1.0: Process '/usr/lib/snapd/snap-device-helper bind snap_cups_ippeveprinter /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1/1-1:1.0 0:0' failed with exit code 1.
mtp-probe: checking bus 1, device 11: "/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1"
systemd[1]: Starting Braille Device Support...
mtp-probe: bus: 1, device: 11 was not an MTP device
systemd-udevd[14444]: 1-1: Process '/usr/lib/snapd/snap-device-helper bind snap_cups_cupsd /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1 189:10' failed with exit code 1.
systemd-udevd[14444]: 1-1: Process '/usr/lib/snapd/snap-device-helper bind snap_cups_ippeveprinter /devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1 189:10' failed with exit code 1.
snapd[1343]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
kernel: [ 3701.397577] audit: type=1400 audit(1668855910.104:257): apparmor="DENIED" operation="open" profile="snap.keepassxc.keepassxc" name="/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-1/busnum" pid=3055 comm="keepassxc" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
brltty[14466]: BRLTTY 6.4 rev BRLTTY-6.4 [https://brltty.app/]
brltty[14466]: BRLTTY 6.4 rev BRLTTY-6.4 [https://brltty.app/]
brltty[14466]: executing as the invoking user: root
brltty[14466]: brltty: executing as the invoking user: root
brltty[14466]: CLDR open error: Datei oder Verzeichnis nicht gefunden: /usr/share/unicode/cldr/common/annotations/de.xml
brltty[14466]: brltty: CLDR open error: Datei oder Verzeichnis nicht gefunden: /usr/share/unicode/cldr/common/annotations/de.xml
brltty[14466]: brltty: possible cause: the package that defines the CLDR annotations directory is not installed
brltty[14466]: brltty: emoji substitutiion won't be performed
brltty[14466]: brltty: BrlAPI Server: release 0.8.3
brltty[14466]: possible cause: the package that defines the CLDR annotations directory is not installed
brltty[14466]: emoji substitutiion won't be performed
systemd[1]: Started Braille Device Support.
brltty[14466]: BrlAPI Server: release 0.8.3
brltty[14466]: Linux Screen Driver:
brltty[14466]: brltty: Linux Screen Driver:
kernel: [ 3701.922713] input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input37
brltty[14466]: USB configuration set error 16: Das Gerät oder die Ressource ist belegt
brltty[14466]: brltty: USB configuration set error 16: Das Gerät oder die Ressource ist belegt
kernel: [ 3701.931119] usb 1-1: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1