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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
06-05-2021, 09:56 AM
|
#1
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,256
|
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?
|
|
|
06-05-2021, 10:13 AM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,545
|
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.
|
|
|
06-05-2021, 10:19 AM
|
#3
|
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
|
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.
|
|
|
06-05-2021, 10:29 AM
|
#4
|
Moderator
Registered: Aug 2002
Posts: 26,757
|
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.
|
06-05-2021, 12:38 PM
|
#5
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253
|
Also android (phone) may ask you to give access permission to the computer.
|
|
|
06-05-2021, 02:30 PM
|
#6
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,415
|
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/
|
|
|
06-05-2021, 08:04 PM
|
#7
|
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
|
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.
|
|
|
06-06-2021, 01:24 AM
|
#8
|
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
|
Quote:
Originally Posted by RandomTroll
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...
|
|
|
06-06-2021, 02:44 AM
|
#9
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,256
Original Poster
|
Quote:
Originally Posted by business_kid
Android, I presume?
|
yes.
Quote:
Originally Posted by business_kid
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
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
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
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?
|
|
|
06-06-2021, 03:23 AM
|
#10
|
Senior Member
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,381
|
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
|
|
|
06-06-2021, 03:59 AM
|
#11
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,545
|
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.
|
|
|
06-06-2021, 03:05 PM
|
#12
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,256
Original Poster
|
Quote:
Originally Posted by chrisretusn
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
With USB cable you will have to give permission for access.
|
Give what permission to access?
Quote:
Originally Posted by business_kid
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?
|
|
|
06-06-2021, 03:49 PM
|
#13
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,415
|
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
|
|
|
06-06-2021, 09:42 PM
|
#14
|
Senior Member
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,381
|
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
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.
Last edited by chrisretusn; 06-06-2021 at 09:57 PM.
|
|
|
06-06-2021, 10:22 PM
|
#15
|
Senior Member
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 3,381
|
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.
|
|
|
All times are GMT -5. The time now is 10:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|