m5stack / Core2-for-AWS-IoT-Kit

Accompanying code for use with AWS IoT Kit content. Works with PlatformIO and ESP-IDF v4.2.
https://m5stack.com/collections/m5-core/products/m5stack-core2-esp32-iot-development-kit-for-aws-iot-edukit
MIT License
127 stars 66 forks source link

Device /tty/USB0 not detect on Ubuntu 22.04 #95

Open sgryphon opened 2 years ago

sgryphon commented 2 years ago

This is due to brltty, a braille interface, which is installed by default in Ubuntu, and in 22.04 has some braille devices that use generic chips identifiers, so cause a conflict.

Quick fix, if you are not using braille, is to uninstall: sudo apt-get remove brltty

You might want to add this as a troubleshooting section on the main page, for users who are confused when the device does not show up. (There is no code fix, just a documentation fix.)

More details:

If you plug the device in and do 'sudo dmesg -c' you will see the device connect, and then a few seconds later:

[ 1285.644093] usb 3-1: new full-speed USB device number 19 using xhci_hcd
[ 1285.795622] usb 3-1: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[ 1285.795633] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1285.795636] usb 3-1: Product: CP2104 USB to UART Bridge Controller
[ 1285.795639] usb 3-1: Manufacturer: Silicon Labs
[ 1285.795641] usb 3-1: SerialNumber: 023F7517
[ 1285.798785] cp210x 3-1:1.0: cp210x converter detected
[ 1285.799829] usb 3-1: cp210x converter now attached to ttyUSB0
[ 1286.322347] usb 3-1: usbfs: interface 0 claimed by cp210x while 'brltty' sets config #1
[ 1286.323072] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[ 1286.323349] cp210x 3-1:1.0: device disconnected

My device uses the CP20104 with identifier 10c4:ea60. You can see the device if you do lsusb, but it claimed by brltty and so can't be used as a TTY.

BRLTTY recommends that it is only configured when Linux is initially installed with a braille device attached (and also that it is in text only mode, with no X/graphical system etc), and some distributions do this; however Ubuntu configures by default, and the recent usage of generic IDs by some braille devices has caused this problem.

There is some discussion about what the correct way is to handle it, and to balance the needs of braille users with others: https://bugs.launchpad.net/ubuntu/+source/brltty/+bug/1958224

(There are also older versions of the bug, as it has been happening on and off for many years, e.g. from 2011: https://bugs.launchpad.net/ubuntu/+source/brltty/+bug/874181)