我的 PC 上连接了 Arduino Nano,它可以执行一些基本的家庭自动化操作,而且运行良好。但有时在启动时,USB 设备无法成功连接。拔下并重新插入即可解决问题。我猜要么是 PC 启动时 Arduino 处于良好状态,要么是 Ubuntu 不喜欢这么早就插入设备。
在Arduino 论坛我没有得到任何真正的帮助。
我正在运行 Ubuntu 14.10 64 位。
(糊盒USB 设备不工作的 dmesg,以及其他当设备已拔出并再次插入(并且正常工作)时。此外lsusb -t 之前和之后和工作。看起来和设备再次插入时一样。)
我的/etc/udev/rules.d/80-arduino.rules
启动文件/dev/ttyArduino0
。问题是,它并不总是在启动后出现:
SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="ttyArduino%n"
更新:仔细观察它不起作用时的 dmesg,我注意到以下几点:
[ 2.040030] usb 2-2: new full-speed USB device number 2 using ohci-pci
[ 2.224039] usb 2-2: device descriptor read/64, error -62
[ 2.512031] usb 2-2: device descriptor read/64, error -62
[ 2.792014] usb 2-2: new full-speed USB device number 3 using ohci-pci
[ 2.976013] usb 2-2: device descriptor read/64, error -62
[ 3.260013] usb 2-2: device descriptor read/64, error -62
[ 3.540013] usb 2-2: new full-speed USB device number 4 using ohci-pci
[ 3.948006] usb 2-2: device not accepting address 4, error -62
[ 4.124013] usb 2-2: new full-speed USB device number 5 using ohci-pci
[ 4.532007] usb 2-2: device not accepting address 5, error -62
然后,当我再次插入设备(在同一端口)并且正确检测到时,dmesg 报告:
[ 346.712042] usb 2-2: new full-speed USB device number 8 using ohci-pci
[ 346.939281] usb 2-2: New USB device found, idVendor=0403, idProduct=6001
[ 346.939289] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 346.939292] usb 2-2: Product: FT232R USB UART
[ 346.939295] usb 2-2: Manufacturer: FTDI
[ 346.939297] usb 2-2: SerialNumber: A8008FYE
[ 346.982451] usbcore: registered new interface driver usbserial
[ 346.982742] usbcore: registered new interface driver usbserial_generic
[ 346.983019] usbserial: USB Serial support registered for generic
[ 346.993719] usbcore: registered new interface driver ftdi_sio
[ 346.996838] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 346.997061] usb 2-2: Detected FT232RL
[ 346.997064] usb 2-2: Number of endpoints 2
[ 346.997066] usb 2-2: Endpoint 1 MaxPacketSize 64
[ 346.997069] usb 2-2: Endpoint 2 MaxPacketSize 64
[ 346.997071] usb 2-2: Setting MaxPacketSize 64
[ 347.001844] usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0