Workaround for copying things from an Android device on KDE 4.10

2013/04/04 at 12:48

Here’s the only workaround (out of half a dozen suggestions found via Google) that actually works for me (KDE 4.10, Galaxy S2, Android 4.0.3).

First, install ‚go-mtpfs‘ and dependencies needed on your system. ‚go-mtpfs‘ is a program written in Go that can mount an Android device reliably. I call it like this:

go-mtpfs /media/s2 &

The output is something similar to this:

Error: Unable to open ~/.mtpz-data for reading.
2013/04/04 12:38:25 compiled against libmtp 1.1.6
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
2013/04/04 12:38:25 device unknown: unknown (04e8:6865) @ bus 2, dev 23
:
2013/04/04 12:38:25 storage ID 65537: Phone
2013/04/04 12:38:25 storage ID 131074: Card
2013/04/04 12:38:25 backing data /tmp/go-mtpfs161880298
2013/04/04 12:38:25 starting FUSE.

Once mounted, I call a script that copies images and videos from the device, and when done, unmounts the device. The script looks like this:

from="/media/s2/Phone/DCIM/Camera"
to_fotos="/mnt/mneme/backup/themis/fotovideo/fotos.2013.stefan"
to_videos="/mnt/mneme/backup/themis/fotovideo/videos.2013"
cd $from
ret=$?
if [ $ret -gt 0 ]; then
echo "*** Error: Camera not mounted ***"
exit
fi
rsync --times --verbose --update --chmod=ug+w $from/*.jpg $to_fotos/
ret=$?
if [ $ret -eq 0 ]; then
echo "*** Success: All pictures copied ***"
fi
rsync --times --verbose --update --chmod=ug+w $from/*.mp4 $to_videos/
ret=$?
if [ $ret -eq 0 ]; then
echo "*** Success: All videos copied ***"
fi
cd ~
fusermount -u /media/s2

The output of the script is something like this:

2013/04/04 12:39:21 fetched "20130403_212621.jpg", 914042 bytes in 245 ms. 3.7 MB/s
20130403_212621.jpg
2013/04/04 12:39:21 fetched "20130403_212628.jpg", 835851 bytes in 96 ms. 8.7 MB/s
20130403_212628.jpg
2013/04/04 12:39:21 fetched "20130403_212645.jpg", 1044704 bytes in 79 ms. 13.1 MB/s
20130403_212645.jpg

sent 2806681 bytes received 71 bytes 1122700.80 bytes/sec
total size is 707008144 speedup is 251.90
*** Success: All pictures copied ***
2013/04/04 12:39:23 fetched "20130403_212651.mp4", 16403453 bytes in 1259 ms. 13.0 MB/s
20130403_212651.mp4
2013/04/04 12:39:26 fetched "20130403_212841.mp4", 25465650 bytes in 2193 ms. 11.6 MB/s
20130403_212841.mp4

sent 41875298 bytes received 50 bytes 4407931.37 bytes/sec
total size is 3251470895 speedup is 77.65
*** Success: All videos copied ***

The performance of the ‚rsync‘ operations is comparable to how it used to be with USB connections. Those have stopped functioning in KDE 4.10, that’s why I had to find an alternative way. With ‚go-mtpfs‘, things are actually easier than before: Just plug in the Android device, call ‚go-mtpfs‘, then the script that copies, and done.

Entry filed under: Computer, Linux. Tags: , , , , , .

Android via USB on openSuse 12.3 Calendar doesn’t reload? Reload Akonadi!


April 2013
M D M D F S S
« Mrz   Mai »
1234567
891011121314
15161718192021
22232425262728
2930  

Neueste Beiträge

Enter your email address to follow this blog and receive notifications of new posts by email.

Schließe dich 208 Followern an

Face


%d Bloggern gefällt das: