Teensy 3.6 MTP 连接 Ubuntu 18.04

Teensy 3.6 MTP 连接 Ubuntu 18.04

我已经尝试了一个星期,直接通过 USB 端口访问 Teensy 3.6 上的内置 SD 卡。我使用的是安装了 libmtp 和 gvfs 的 Ubuntu 18.04 LTS。我还尝试了 jmtpfs、go-mtpfs、gmtp 和各种 UDEV 规则。teensy 通过 Arduino IDE 中的 ttyACM0 完美运行,但拒绝作为 MTP 设备安装。

dmesg:

[ 1238.248863] usb 6-3: new full-speed USB device number 2 using ohci-pci
[ 1238.465830] usb 6-3: Duplicate descriptor for config 1 interface 0 altsetting 0, skipping
[ 1238.473820] usb 6-3: New USB device found, idVendor=16c0, idProduct=04d1
[ 1238.473829] usb 6-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1238.473833] usb 6-3: Product: Teensy MTP Disk
[ 1238.473837] usb 6-3: Manufacturer: Teensyduino
[ 1238.473841] usb 6-3: SerialNumber: 4777660
[ 1238.956206] cdc_acm 6-3:1.0: ttyACM0: USB ACM device
[ 1238.957000] usbcore: registered new interface driver cdc_acm
[ 1238.957002] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

mtp 检测:

libmtp version: 1.1.16
Listing raw device(s)
   No raw devices found.

49-teensy.rules 位于 /etc/udev/rules.d/ 中:

# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/
#
# The latest version of this file may be found at:
#   http://www.pjrc.com/teensy/49-teensy.rules
#
# This file must be placed at:
#
# /etc/udev/rules.d/49-teensy.rules    (preferred location)
#   or
# /lib/udev/rules.d/49-teensy.rules    (req'd on some broken systems)
#
# To install, type this command in a terminal:
#   sudo cp 49-teensy.rules /etc/udev/rules.d/49-teensy.rules
#
# Or use the alternate way (from this forum message) to download and install:
#   https://forum.pjrc.com/threads/45595?p=150445&viewfull=1#post150445
#
# After this file is installed, physically unplug and reconnect Teensy.
#

ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"

#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
#
#
# If using USB Serial you get a new device each time (Ubuntu 9.10)
# eg: /dev/ttyACM0, ttyACM1, ttyACM2, ttyACM3, ttyACM4, etc
#    apt-get remove --purge modemmanager     (reboot may be necessary)
#
# Older modem proding (eg, Ubuntu 9.04) caused very slow serial device detection.
# To fix, add this near top of /lib/udev/rules.d/77-nm-probe-modem-capabilities.rules
#   SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", GOTO="nm_modem_probe_end" 
#

UDEV 规则添加到 69-libmtp.rules(导致 Teensy 出现在 Nautilus 中,但无法安装或打开):

ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04d1", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

Teensy MTP 库:

https://github.com/yoonghm/MTP

有人用 Teensy 做过这个吗?或者用 Arduino?任何建议都欢迎。谢谢你的帮助。

相关内容