LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-05-2021, 09:56 AM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,256

Rep: Reputation: 293Reputation: 293Reputation: 293
Transferring files to/from a 'smart'phone via USB cable


I just bought my first 'smart'phone, a TCL A1 from TracFone. I connected it to my computer with a USB cable. In response it enables 'USB for file transfer' but I can't make it work. How does my computer see it? I don't see any new devices; I had hoped I would see a /dev/sd*. Do I need to load a module to use it?
 
Old 06-05-2021, 10:13 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,545

Rep: Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608
Android, I presume?

Since Android-5.0, Google has made that messy, as folks were connecting usb disks with mischief in mind. Try a phone reboot, and check if a usb storage disk has shown up. It might take a power-off. If not, but you can get the files to an sdcard, and your phone accepts sd cards, that's a lazy way to go.

Lastly, there's Bluetooth. Android Phones have good bluetooth. It's beating my laptop into using file exchange that I had difficulty with. My Laptop had to
  • Stop hiding and let itself be found
  • you had to pair things
  • You had to 'trust' the phone.
  • You had to configure I/O (in my case, bidirectional).
  • Lastly, you had to do it.

I exchanged a few megs of audio in 10 minutes between phones (bluetooth-4.0) but only fraction of that from the phone, and needed bluez & bluetoothctl open together.
 
Old 06-05-2021, 10:19 AM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,376

Rep: Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937
Treat it like an external HDD. Did it automount? If not, mount the device. There are 2 areas you can put files.
There will some ram on the system board in the phone, and usually one SD card, if you have one.

Any file manager on Slack should be able to copy files.

If you want more 'fun', you can copy files through bluetooth.
 
Old 06-05-2021, 10:29 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,757

Rep: Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318
I am guessing the phone uses MTP and is not a USB mass storage device. Try gphoto2

You can also download file transfer apps from the play store and use wifi versus bluetooth.

Last edited by michaelk; 06-05-2021 at 10:31 AM.
 
1 members found this post helpful.
Old 06-05-2021, 12:38 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Also android (phone) may ask you to give access permission to the computer.
 
Old 06-05-2021, 02:30 PM   #6
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,415
Blog Entries: 7

Rep: Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955
Still the simplest, most reliable, way to connect to a MTP device, for file transfer. And, android is weird. You may need to reboot one every now and then, just to make it work. Just like a microsoft machine.
https://github.com/phatina/simple-mtpfs/
 
Old 06-05-2021, 08:04 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,899
Blog Entries: 28

Rep: Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349Reputation: 6349
If you are unable to get the phone to mount as a file system, you can always use Airdroid; it's in the play store. You do not need to create an Airdroid account to use it locally.
 
Old 06-06-2021, 01:24 AM   #8
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,849

Rep: Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553
Quote:
Originally Posted by RandomTroll View Post
I just bought my first 'smart'phone, a TCL A1 from TracFone. I connected it to my computer with a USB cable. In response it enables 'USB for file transfer' but I can't make it work. How does my computer see it? I don't see any new devices; I had hoped I would see a /dev/sd*. Do I need to load a module to use it?
What do you see while tailing /var/log/messages (or when running journalctl to tail the SystemD journal) and you plug your phone into your Linux system? Anything?

I've not had any difficulty connecting a phone (I use an LG G5) to Linux for a while. Years ago, getting such a connection to work was hit or miss. It could work one day and an Android or Linux update could make it impossible the next. Lately, on OpenSUSE/KDE, upon plugging my phone in I get a notification about the actions I can take with the newly attached device -- mostly photo-oriented -- but I can get access to the built-in storage as well as the SD card via the Dolphin file manager. I do have to make a selection on my phone as to what I want the USB connection to be used for: charging-only, photo transfer, file transfer, etc. If I can't track down a USB-C cable, I can still either pull out the MicroSD card, use an adapter, and plug it into a USB hub or use an FTP application on Android (I've been having good luck with "AndFTP") to connect to a Linux box via sFTP over a WiFi link.

If neither of the above options are possible for you, in a pinch you could put the files you wish to transfer onto an SD card and plug your phone and the SD card into a Mac or Windows system (both of which seem to be favored by phone manufacturers) to make the transfer.

HTH...
 
Old 06-06-2021, 02:44 AM   #9
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,256

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by business_kid View Post
Android, I presume?
yes.

Quote:
Originally Posted by business_kid View Post
Try a phone reboot, and check if a usb storage disk has shown up.
Where would it show up? It's not /dev/sdb.


Quote:
Originally Posted by camorri View Post
Treat it like an external HDD. Did it automount? If not, mount the device. There are 2 areas you can put files.
What device? I see no new devices in /dev


Quote:
Originally Posted by michaelk View Post
I am guessing the phone uses MTP and is not a USB mass storage device. Try gphoto2
I eventually found MTP: it is an MTP device. The mtp-* utilities from the libmtp package detect it and try to work but fail reporting errors I don't understand. Good tip on gphoto2 - it detects it but all other functions give me errors.

Quote:
Originally Posted by rnturn View Post
What do you see while tailing /var/log/messages
Quote:
Jun 6 01:05:15 randytool kernel: usb 2-1.3: new high-speed USB device number 9 using ehci-pci
Jun 6 01:05:15 randytool kernel: usb 2-1.3: New USB device found, idVendor=1bbb, idProduct=0168, bcdDevice= 2.23
Jun 6 01:05:15 randytool kernel: usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 6 01:05:15 randytool kernel: usb 2-1.3: Product: A501DL
Jun 6 01:05:15 randytool kernel: usb 2-1.3: Manufacturer: TCL
Jun 6 01:05:15 randytool kernel: usb 2-1.3: SerialNumber: YSIVBM4HSW79BMEQ
I noticed that the kernel has an android section that I hadn't built. I built that before I embarked on this endeavor. Was that necessary?
 
Old 06-06-2021, 03:23 AM   #10
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,381

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
I'm on Slackware64-current. I can access my android phones via USB connection or via KDE Connect. With KDE Connect you will need to pair the phone to your computer. With USB cable you will have to give permission for access. I have a Samsung 7 edge and a Samsung A71. I have not checked the A71 with USB cable as I don't have a USB to Type-C cable. It works fine with KDE Connect. The 7 edge works fine with cable. Both phones are listed as connected right now with KDE Connect.

Last edited by chrisretusn; 06-06-2021 at 08:31 AM. Reason: spelling
 
Old 06-06-2021, 03:59 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,545

Rep: Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608Reputation: 2608
Phone to PC? I have never heard of it except maybe in debug mode. Phone to usb stick is 50% possible. It's not the pc, it's the phone you'll have issues with.
 
Old 06-06-2021, 03:05 PM   #12
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,256

Original Poster
Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by chrisretusn View Post
I'm on Slackware64-current. I can access my android phones via USB connection or via KDE Connect.
That's bluetooth?

Quote:
Originally Posted by chrisretusn View Post
With USB cable you will have to give permission for access.
Give what permission to access?


Quote:
Originally Posted by business_kid View Post
Phone to PC? I have never heard of it except maybe in debug mode. Phone to usb stick is 50% possible. It's not the pc, it's the phone you'll have issues with.
It appears the issues are with the PC.

/var/log/messages records:

Quote:
mtp-probe: checking bus 2, device 13: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.4"
mtp-probe: bus: 2, device: 13 was not an MTP device
but mtp-detect detects it - what gives?
 
Old 06-06-2021, 03:49 PM   #13
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,415
Blog Entries: 7

Rep: Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955Reputation: 1955
I can see that you are using Slack. Here is a link that gives info and links to all the software used to access mtp devices. You also have to set the phone to be a mtp device, on the phone itself.

https://wiki.archlinux.org/title/Med...nsfer_Protocol
 
Old 06-06-2021, 09:42 PM   #14
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,381

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
Quote:
Originally Posted by chrisretusn View Post
I'm on Slackware64-current. I can access my android phones via USB connection or via KDE Connect.
Quote:
Originally Posted by RandomTroll View Post
That's bluetooth?
No KDE works across a LAN.

Quote:
Originally Posted by chrisretusn View Post
With USB cable you will have to give permission for access.
Quote:
Give what permission to access?
On first connect I get a prompt that ask "Allow access to phone date?" DENY ALLOW.
>>> Once connected the phone remembers this and subsequent connections are not prompted. <<<
Belay that last sentence. Incorrect, it prompts you every time.

You will see a notification from Android System on the phone. When I plug in my cable to the PC it gives me an alert (beep) that I am connected I can tap that alert and select "Use USB to "Transfer files" Transfer images" "Connect a MIDI device" "Charge this phone"" I normally use "Transfer files" at the same time the Removable device widget (KDE Plamsa) pops up and ask me what I want to do. I normally browse files.

I have not added anything specifically to my Slackware64-current installation to enable this to work, it all works from stock Slackware packages.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20210607-102119_MTP application.jpg
Views:	15
Size:	167.3 KB
ID:	36541   Click image for larger version

Name:	Screenshot_20210607_103640.png
Views:	12
Size:	68.7 KB
ID:	36542   Click image for larger version

Name:	Screenshot_20210607_103859.png
Views:	9
Size:	25.7 KB
ID:	36543  

Last edited by chrisretusn; 06-06-2021 at 09:57 PM.
 
Old 06-06-2021, 10:22 PM   #15
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,381

Rep: Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857Reputation: 1857
Additional: Enabling Developer Options is normally one of the first things I do with a new phone. It was mentioned above the you need USB debugging enabled. While I normally do have that enabled. I decided while I am looking at this to disable it and I also disabled Developer Options. So far I am able to connect and transfer files with no issued without Developer Options.

To get Developer Options you need to find Build number under About Phone, Software Information (on my phones) and tap it several times (seven) to Developer Options in enabled.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Transferring GBs and GBs of files off Android phone without USB cord wagscat123 Linux - General 17 01-15-2019 09:15 AM
Upload music, photos etc... iDen i570 phone via usb cable? okos Linux - Software 0 04-19-2008 01:36 PM
Loaded Ubuntu 7.04. Mobile phone connected with cable via usb. Phone is seen, Hec Linux - Newbie 1 02-09-2008 04:46 AM
Transferring Files from Windows XP to Suse 9.1 through crossover cable sirtrack Linux - Networking 3 06-20-2004 08:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration