Hi Marcus
My system is as follow:
Raspberry Pi
pi@rpipro2 ~ $ cat /etc/debian_version
7.8
My Android phone is:
MOTOROLA MOTO G
Android version 5.0.2
I downloaded libmtp-1.1.9 and manually installed following the INSTALLATION file:
$./configure
$make
$sudo make install
$sudo ldconfig
I executed the program mtp-sendfile and I get an error message:
pi@rpipro2 ~/Music $ sudo mtp-sendfile Killing\ In\ The\ Name.mp3 /Music
libmtp version: 1.1.9
Device 0 (VID=22b8 and PID=2e82) is a Motorola Moto G (ID2).
Android device detected, assigning default bug flags
Sending Killing In The Name.mp3 to /Music
type: mp3, 2
Sending file...
Progress: 5090211 of 5090211 (100%)
Error sending file.
Error 2: PTP Layer error 2002: LIBMTP_Send_File_From_File_Descriptor(): Could not send object.
Error 2: Error 2002: PTP: General Error
Why can't I send the file over?
I executed program mtp-detect and it was successful:
pi@rpipro2 ~/Music $ sudo mtp-detect
libmtp version: 1.1.9
Listing raw device(s)
Device 0 (VID=22b8 and PID=2e82) is a Motorola Moto G (ID2).
Found 1 device(s):
Motorola: Moto G (ID2) (22b8:2e82) @ bus 1, dev 18
Attempting to connect device(s)
Android device detected, assigning default bug flags
USB low-level info:
Using kernel interface "usbfs"
bcdUSB: 512
bDeviceClass: 0
bDeviceSubClass: 0
bDeviceProtocol: 0
idVendor: 22b8
idProduct: 2e82
IN endpoint maxpacket: 512 bytes
OUT endpoint maxpacket: 512 bytes
Raw device info:
Bus location: 1
Device number: 18
Device entry info:
Vendor: Motorola
Vendor id: 0x22b8
Product: Moto G (ID2)
Vendor id: 0x2e82
Device flags: 0x18008106
Configuration 0, interface 0, altsetting 0:
Interface description contains the string "MTP"
Device recognized as MTP, no further probing.
Device info:
Manufacturer: motorola
Model: XT1033
Device version: 1.0
Serial number: TA89901KRG
Vendor extension ID: 0x00000006
Vendor extension description: microsoft.com: 1.0; android.com: 1.0; mot-mobility.com/DSU: 1.2
Detected object size: 64 bits
Extensions:
microsoft.com: 1.0
android.com: 1.0
.....
.....
Anonymous
Try not using /Music as the destination folder, but something you created yourself with unique name.
With Android 6 and Moto G 3rd gen, I had lots of trouble trying to copy my music into the /Music folder, it never completely succeeded, and Android also decided to randomly wipe the whole directory (no, not just making files invisible, the disk space was really freed) a few days after.
So, try using a folder name Android devs could not have guessed to make special. When I started using a folder name 'pq-files', everything worked fine with MTP and no files mysteriously disappeared.