====== Android et USB ====== ===== Connecter et détecter le smartphone ===== <note tips>Pas de procédure, juste un mémo des commandes</note> Commencer par connecter le smartphone sur le port USB à l'aide du câble fourni avec l'appareil. Vérifiez que le smartphone soit reconnu par Linux : <code bash> $ sudo dmesg | tail -30 [ 591.444666] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null) [ 2320.016177] usb 6-2.7: new high-speed USB device number 6 using ehci-pci [ 2320.112993] usb 6-2.7: New USB device found, idVendor=04e8, idProduct=6860 [ 2320.112999] usb 6-2.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2320.113002] usb 6-2.7: Product: SAMSUNG_Android [ 2320.113005] usb 6-2.7: Manufacturer: SAMSUNG [ 2320.113008] usb 6-2.7: SerialNumber: 01234567 [ 2320.143003] cdc_acm 6-2.7:1.1: This device cannot do calls on its own. It is not a modem. [ 2320.143089] cdc_acm 6-2.7:1.1: ttyACM0: USB ACM device [ 2320.145202] usbcore: registered new interface driver cdc_acm [ 2320.145205] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters [ 2390.472134] usb 6-2.7: USB disconnect, device number 6 [ 2390.672161] usb 6-2.7: new high-speed USB device number 7 using ehci-pci [ 2390.765576] usb 6-2.7: New USB device found, idVendor=18d1, idProduct=d002 [ 2390.765588] usb 6-2.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2390.765595] usb 6-2.7: Product: SAMSUNG_Android [ 2390.765601] usb 6-2.7: Manufacturer: SAMSUNG [ 2390.765606] usb 6-2.7: SerialNumber: 01234567 [ 2393.032153] usb 6-2.7: USB disconnect, device number 7 [ 2393.232244] usb 6-2.7: new high-speed USB device number 8 using ehci-pci [ 2393.325276] usb 6-2.7: New USB device found, idVendor=04e8, idProduct=6866 [ 2393.325288] usb 6-2.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2393.325294] usb 6-2.7: Product: SAMSUNG_Android [ 2393.325300] usb 6-2.7: Manufacturer: SAMSUNG [ 2393.325306] usb 6-2.7: SerialNumber: 01234567 [ 2402.248149] usb 6-2.7: USB disconnect, device number 8 [ 2402.448171] usb 6-2.7: new high-speed USB device number 9 using ehci-pci [ 2402.936079] usb 6-2.7: device not accepting address 9, error -71 </code> Si ce n'est pas déjà fait, installer les outils de suivi USB : <code bash> $ sudo apt-get install usbutils </code> Allez voir du coté de la commande lsusb pour vérifier que votre appareil est détecté : <code bash> $ sudo lsusb Bus 006 Device 013: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1] Bus 006 Device 005: ID 046d:c245 Logitech, Inc. G400 Optical Mouse Bus 006 Device 004: ID 046a:0180 Cherry GmbH Bus 006 Device 003: ID 050d:0237 Belkin Components F5U237 USB 2.0 7-Port Hub Bus 006 Device 002: ID 04f2:b073 Chicony Electronics Co., Ltd Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub </code> ===== Communiquez avec le smartphone ===== Installez l'outil de communication avec les périphériques de type MTP (Media Transfer Protocol) <code bash> $ sudo apt-get install mtp-tools </code> Vérifiez que votre smartphone est bien raccordé à votre ordinateur en utilisant le protocole MTP : <code bash> $ sudo mtp-detect Unable to open ~/.mtpz-data for reading, MTPZ disabled. libmtp version: 1.1.8 Listing raw device(s) Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP). Found 1 device(s): Samsung: Galaxy models (MTP) (04e8:6860) @ bus 6, dev 13 Attempting to connect device(s) Android device detected, assigning default bug flags {...} </code>