David-Ray
Posts: 7
Joined: Fri Aug 04, 2017 10:53 pm

transferring data from Android phone via USB

Tue Aug 08, 2017 4:46 am

I have a Samsung Galaxy S4 (GS4) and S3 (GS3). Trying to move files an external Toshiba drive.

I had problems writing to the Toshiba, but was able to find solutions in this forum and it is working now. I think.

When I attach my GS4 to my RaspberryPi 3b, it shows up as: mtp://[usb:001,008]/ or something similar. After a while it says "Unable to open MTP device '[usb:001,008]'" and cycles to something else like mtp://[usb:001,009]/. If it does this while i'm moving a file it stops moving the file. If I get lucky and it moves 100% of my file, I get "...: libmtp error: Could not get file from device." and mtp://[usb:001,nnn]/ changes again.

I tried searching the forum, but was unable to search for USB issues as "USB" is not an allowed search term. And "Android", "Samsung", and "Galaxy", give to many results to search through one by one.

So, where should I look to figure out what's going on and how to fix it?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4917
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: transferring data from Android phone via USB

Tue Aug 08, 2017 2:34 pm

David-Ray wrote: ...
When I attach my GS4 to my RaspberryPi 3b, it shows up as: mtp://[usb:001,008]/ or something similar. After a while it says "Unable to open MTP device '[usb:001,008]'" and cycles to something else like mtp://[usb:001,009]/. If it does this while i'm moving a file it stops moving the file. If I get lucky and it moves 100% of my file, I get "...: libmtp error: Could not get file from device." and mtp://[usb:001,nnn]/ changes again.
...
IIRC, you're using the "wrong" type of (device) connection via USB on your Samsung 'phone. I usually use the (multi-)media variant which should make it appear on the Pi (or any other computer) as one (or more) disk drives (in a similar fashion to a USB flash drive). Then just copy files over but, perhaps, not too many at a time as "timeouts" (slow transfer at the Android end?) can lead to hiccups/dropouts. If most of the files you need are stored on a uSDHC card in the 'phone (rather than its built-in storage) it's possibly quicker/easier to temporarily move it to a USB card reader and plug that into the Pi (and file transfer will probably be quicker).
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

David-Ray
Posts: 7
Joined: Fri Aug 04, 2017 10:53 pm

Re: transferring data from Android phone via USB

Wed Aug 09, 2017 3:30 am

Thank you. Using a card reader will satisfy my needs.

I would still like to solve this connecting my Galaxy via USB problem.

I only see Media device (MTP) and Camera (PTP).

PTP seems more stable but only sees picture files. MTP mode is what i started out with and am still having problems with.

I found the following in the forums and will read through it: How do you mount an android phone in Raspbian viewtopic.php?t=88125&p=620209

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: transferring data from Android phone via USB

Wed Aug 09, 2017 3:41 am

i hoped that this APP ( much better than the "mc" of linux ) ( i could not use win7 without it ( the windows version) )
https://www.ghisler.com/android.htm
could connect by USB, but possibly RPI can NOT emulate to be a drive??

sftp plugin works nice ( if RPI has SSH enabled )

but then i found
Send files via Bluetooth (OBEX)
could that be a option for you?

David-Ray
Posts: 7
Joined: Fri Aug 04, 2017 10:53 pm

Re: transferring data from Android phone via USB

Thu Aug 10, 2017 10:36 pm

I did the following:

Code: Select all

sudo apt-get update 
sudo apt-get upgrade -y
sudo apt-get install samba
phone opened as:

mtp://[usb:001,008]/

Seemed stable for awhile. Then cycled to:

mtp://[usb:001,009]/
mtp://[usb:001,010]/
mtp://[usb:001,011]/
...

David-Ray
Posts: 7
Joined: Fri Aug 04, 2017 10:53 pm

Re: transferring data from Android phone via USB

Thu Aug 10, 2017 10:54 pm

@KLL, not sure what you're suggesting. It's not my intent to have my Raspberry Pi show up as a drive on my phone. That would be very cool. Especially if i could see my Toshiba External drive through that connection.

All I'm trying to do is the same thing I can do on a windows machine. Namely see my phone memory and it's external memory as drives on the Raspberry Pi and be able to copy from them and write to them.

Not sure how installing Total Commander on my phone would help accomplish that.
KLL wrote:
Wed Aug 09, 2017 3:41 am

sftp plugin works nice ( if RPI has SSH enabled )
Not sure what "sftp" or "SSH" is. Still researching them. Same for "OBEX".

Still a Noob at Raspberry Pi, so the jargon is a bit over my head.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: transferring data from Android phone via USB

Fri Aug 11, 2017 1:11 am

here example:
operation from PHONE
PHONE and RPI use WIFI
PHONE has installed total commander
PHONE total commander has installed SFTP plugin ( RPI login required )

i can open a 2 panel window for file copy
here example like from PHONE camera to RPI:/home/pi/Pictures ( but it could also be /media/pi/YOURUSBDRIVE )
Image

that is NOT USB as you requested. still you should know that option
my mentioned Bluetooth connect idea option also not tested.


for understanding.
RPI has default installed SFTP server / SSH must be enabled
win PC and android PHONE would need a SFTP program to connect to RPI,
but that means operation from PC or PHONE by file zilla / total commander
if you want to operate from RPI the other devices would need a SFTP server.

____________________________________
but samba is also good,
WIN PC have default samba server and client
Android ??
RPI need install for this:
sudo apt-get install -y samba samba-common-bin smbclient cifs-utils
for server on RPI
sudo smbpasswd -a pi
sudo nano /etc/samba/smb.conf
adjust ( for windows PC )
workgroup =XXX
can add:

Code: Select all

[share]
    path = /home/pi/Desktop/share
    available = yes
    valid users = pi
    read only = no
    browsable = yes
    public = yes
    writable = yes
also need:
mkdir /home/pi/Desktop/share

for using samba client just start RPI file manager and go NETWORK
_______________________________________

Tansjert
Posts: 1
Joined: Wed Nov 29, 2017 6:34 am

Re: transferring data from Android phone via USB

Wed Nov 29, 2017 6:52 am

David-Ray wrote:
Tue Aug 08, 2017 4:46 am
I have a Samsung Galaxy S4 (GS4) and S3 (GS3). Trying to move files an external Toshiba drive.

I had problems writing to the Toshiba, but was able to find solutions in this forum and it is working now. I think.

When I attach my GS4 to my RaspberryPi 3b, it shows up as: mtp://[usb:001,008]/ or something similar. After a while it says "Unable to open MTP device '[usb:001,008]'" and cycles to something else like mtp://[usb:001,009]/. If it does this while i'm moving a file it stops moving the file. If I get lucky and it moves 100% of my file, I get "...: libmtp error: Could not get file from device." and mtp://[usb:001,nnn]/ changes again.

I tried searching the forum, but was unable to search for USB issues as "USB" is not an allowed search term. And "Android", "Samsung", and "Galaxy", give to many results to search through one by one.
So, where should I look to figure out what's going on and how to fix it?
http://www.mobiledic.com/android-topic/ ... puter.html
As long as you are going to transfer data on computer , you need to connect your phones to computer , but from all my experience ,your problem is not caused by USB , maybe it could have been something wrong with your operation ,

Naklsder
Posts: 1
Joined: Fri Dec 08, 2017 8:56 am

Re: transferring data from Android phone via USB

Fri Dec 08, 2017 9:05 am

Tansjert wrote:
Wed Nov 29, 2017 6:52 am
David-Ray wrote:
Tue Aug 08, 2017 4:46 am
I have a Samsung Galaxy S4 (GS4) and S3 (GS3). Trying to move files an external Toshiba drive.

I had problems writing to the Toshiba, but was able to find solutions in this forum and it is working now. I think.

When I attach my GS4 to my RaspberryPi 3b, it shows up as: mtp://[usb:001,008]/ or something similar. After a while it says "Unable to open MTP device '[usb:001,008]'" and cycles to something else like mtp://[usb:001,009]/. If it does this while i'm moving a file it stops moving the file. If I get lucky and it moves 100% of my file, I get "...: libmtp error: Could not get file from device." and mtp://[usb:001,nnn]/ changes again.

I tried searching the forum, but was unable to search for USB issues as "USB" is not an allowed search term. And "Android", "Samsung", and "Galaxy", give to many results to search through one by one.
So, where should I look to figure out what's going on and how to fix it?
As long as you are going to transfer data on computer , you need to connect your phones to computer , but from all my experience ,your problem is not caused by USB , maybe it could have been something wrong with your operation ,
Sometimes it has to do with your network,the last time I was connected to WiFi, I tried to transfer data, but I found that it was slower than the Android phone transfer tool, and I failed,

Shehab
Posts: 1
Joined: Thu Jan 11, 2018 6:37 am

Re: transferring data from Android phone via USB

Thu Jan 11, 2018 6:49 am

Tansjert wrote:
Wed Nov 29, 2017 6:52 am
David-Ray wrote:
Tue Aug 08, 2017 4:46 am
I have a Samsung Galaxy S4 (GS4) and S3 (GS3). Trying to move files an external Toshiba drive.

I had problems writing to the Toshiba, but was able to find solutions in this forum and it is working now. I think.

When I attach my GS4 to my RaspberryPi 3b, it shows up as: mtp://[usb:001,008]/ or something similar. After a while it says "Unable to open MTP device '[usb:001,008]'" and cycles to something else like mtp://[usb:001,009]/. If it does this while i'm moving a file it stops moving the file. If I get lucky and it moves 100% of my file, I get "...: libmtp error: Could not get file from device." and mtp://[usb:001,nnn]/ changes again.

I tried searching the forum, but was unable to search for USB issues as "USB" is not an allowed search term. And "Android", "Samsung", and "Galaxy", give to many results to search through one by one.
So, where should I look to figure out what's going on and how to fix it?
As long as you are going to transfer data on computer , you need to connect your phones to computer , but from all my experience ,your problem is not caused by USB , maybe it could have been something wrong with your operation ,
For the data storec in mobile internal memory, we can't access them on PC through connecting to PC with a USB cable So if you need to transfer data like sms, contacts or files in phone memory, you need use an App to help.
Last edited by Shehab on Tue Jan 23, 2018 9:59 am, edited 1 time in total.

User avatar
neilgl
Posts: 415
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: transferring data from Android phone via USB

Thu Jan 11, 2018 4:28 pm

As a test I connected my Galaxy S4 via a USB cable to a pi running the latest raspbian stretch.
On the pi, it said removable media inserted select the action you want to perform - I clicked open with file manager.
File manager opened "mtp://[usb: 001,007]Phone" and I could see all the phone internal memory, and copy files to pi and to the phone OK.
The S4 notification said "Connected as a media device." Touch that showed: "USB PC connection" with Media device (MTP) ticked.
Not sure why yours is showing/cycling many usb connections (mtp://[usb:001,009] etc.) - that looks like several disconnect/reconnect cycles.
What power supply are you using for the pi and is your USB cable ok?

kinjal2100
Posts: 1
Joined: Thu Jan 18, 2018 11:01 am

Re: transferring data from Android phone via USB

Thu Jan 18, 2018 11:07 am

David-Ray wrote:
Tue Aug 08, 2017 4:46 am
I have a Samsung Galaxy S4 (GS4) and S3 (GS3). Trying to move files an external Toshiba drive.

I had problems writing to the Toshiba, but was able to find solutions in this forum and it is working now. I think.

When I attach my GS4 to my RaspberryPi 3b, it shows up as: mtp://[usb:001,008]/ or something similar. After a while it says "Unable to open MTP device '[usb:001,008]'" and cycles to something else like mtp://[usb:001,009]/. If it does this while i'm moving a file it stops moving the file. If I get lucky and it moves 100% of my file, I get "...: libmtp error: Could not get file from device." and mtp://[usb:001,nnn]/ changes again.

I tried searching the forum, but was unable to search for USB issues as "USB" is not an allowed search term. And "Android", "Samsung", and "Galaxy", give to many results to search through one by one.

So, where should I look to figure out what's going on and how to fix it?
Check here how to how to transfer data from Android phone via USB
  • Unlock your Android device.
    With a USB cable, connect your device to your computer.
    On your device, tap the "USB for..." notification.
    Select Transfer files.
    A file transfer window will open on your computer. Use it to drag files.
    When you're done, eject your device from Windows.
    Unplug the USB cable.

Caksypass
Posts: 1
Joined: Tue Mar 20, 2018 8:35 am

Re: transferring data from Android phone via USB

Tue Mar 20, 2018 8:45 am

What software did you use ? i used to transfer data from Android to another phone , but i have never has a problem like you , The most common problem is USB debugging and root. Since they are the same device ,you can try using other transfer tools to do .

lalala
Posts: 1
Joined: Tue Jan 29, 2019 2:08 am

Re: transferring data from Android phone via USB

Tue Jan 29, 2019 5:34 am

There is Android Assistant program called Mobikin Assistabt for Android,which allows uesr connect device to computer via USB/WIFI,and the program will list all file on computer,you can choose import/export files.

Return to “Android”