How to transfer files via USB cable between computer and Librem 5?

… and to be clear … that means SSH (over IP) over WiFi on the Librem 5 end - not via USB cable.

I regularly use sshfs which I guess is even more setup but it does allow all vanilla shell file access commands etc. to work on the host computer, rather than requiring the use of scp or sftp.

1 Like

Why not? I often use it this way.

1 Like

Because I only have one cable that came with the Librem 5 and that is ‘permanently’ attached to the Librem 5’s charger which is in the phone charging area, not particularly near to the computer that I would want to use to send the files to the Librem 5. So WiFi is just more convenient (can be done regardless of whether the Librem 5 is on charge or next to the computer or elsewhere in the house), and WiFi is fast ‘enough’.

There’s nothing wrong with doing it via USB cable and I didn’t intend to imply that you can’t do it. SSH over IP can be IP over whatever is available.

I think the implication of the post to which I was replying was … be mindful of how much one-off setup is involved to get it going, and whether that is appropriate for a newb to handle. Most customers will already have WiFi working on the Librem 5, so that is one less thing to think about.

Heck, if I am going to drag the Librem 5 physically over to the computer and connect a cable to the Librem 5, I can use my USB-to-ethernet dongle into the Librem 5 and transfer files over ethernet. :slight_smile:

Well, it all depends on the circumstances - if I’m using a laptop on a train with spotty cellular coverage and want to copy something from/to the phone, then getting the USB cable out of the bag is easily the most convenient option :smile: Same at home with USB cable attached to my computer, which then charges the phone as I’m sitting next to it.

In fact, with mDNS name resolution I don’t even have to think about which interface am I going to use. When it’s connected over USB it simply uses USB automatically, and when not it goes through WiFi. I also have an option to use cellular data over a VPN, but that’s the last resort thing as that connection is metered :wink:

I attach the L5 with its original USB charger cable to my MacBook, and do (for example)

Mac:~ $ ssh purism@192.168.33.2
Linux pureos 6.2.0-1-librem5 #1 SMP PREEMPT Fri May 19 14:12:38 UTC 2023 aarch64

You have mail.
Last login: Mon Jun 12 09:40:22 2023 from 192.168.33.1
inhibiting suspend ...
purism@pureos:~$ ls -l foo
-rw-r--r-- 1 purism purism 0 Jun 12 09:40 foo
purism@pureos:~$ exit
logout
Connection to 192.168.33.2 closed.

Mac:~ $ scp -p purism@192.168.33.2:foo .
foo                                           100%    0     0.0KB/s   00:00
...

Ofc I normaly do not use its IP addr 192.168.33.2, but l5usb from a line in /etc/hosts, the IP addr was only for demonstration here.

2 Likes

Not too difficult, if you can follow simple instructions, type, or copy and paste commands into the terminal and hit Enter. See the Tutorials link I posted above. Oops… I guess I posted it in a different thread. Here is the link to the tutorial(s): https://source.puri.sm/Librem5/community-wiki/-/wikis/Tips-&-Tricks#secure-shell-ssh
:slight_smile:

In any case, I found it easier than trying to do it on Android.

2 Likes

Agreed. Extremely difficult. Learning what “ssh and scp is over a Terminal or Shell” is very daunting. But to ask here, how to do all that can be a cardinal sin.

You probably know more about LanShare than I, so please see my reply to OP and correct me if I am wrong.
~s

Have you considered LanShare?
By the sounds of it, there is a program that will transfer anything across Windows to most Linux spin-offs. I use it all the time to go between Windows and PureOS on another Dtop.
It is called “LanShare”. Available at GitHub.
About LanShare:

LAN Share is a cross platform local area network file transfer application, built using Qt GUI framework. It can be used to transfer a whole folder, one or more files, large or small immediatelly without any additional configuration.

How to use Lanshare.

CAVEAT: I don’t know if it will work on PureOS/L5. But does on PureOS Dtop <> Windows Dtop.
For me, I installed it on two machines, no programming experience necessary.

~s
EDIT - ADDENDUM:

I tried to install it but it won’t due to:

“error processing archive ./lanshare_1.2.1-1_amd64.deb (–install):
package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
./lanshare_1.2.1-1_amd64.deb”

Perhaps a more knowledgeable person can figure it out. I’m a noob when it comes to GitHub & digital phones, it’s another unexplored planet to me.
Sorry,
~s

Exactly as stated. You are trying to install a package that is built for an Intel or AMD CPU whereas the phone has an ARM CPU. So you need to ask “Lanshare” whether they offer a build for the ARM architecture or see whether you can already see that option on their web site.

1 Like

Regarding your addendum: The github you linked to only provides packages for the Intel/AMD processors and not ARM. The L5 is an ARM-based device. To install LANShare you will need to follow the compiling instructions on their github page.

I’ve never used LANShare.

If I haven’t bothered to create a SMB share (with Samba), I use sftp (interactive ssh-based file transfer protocol) or ssh/scp (command line or script). One can even browse with sftp in browsers like firefox.

I’ve no plans to take on the task of learning GitHubs way of making programs available. Compiling? No idea how or need to learn how.

I do use it between two desktops, Pureos on one, Win 7 on the other. No need to learn linux codes or the stuff you were kind enough to show me. The PureOS is on a Z400 w/ CPU Intel Xeon 3500 & 3600 Series and it works. C’est la vie Mayhaps the L5 is particular about that too.
Thanks
~s

That’s all Greek to me. LanShare you don’t need to do anything but set install the program, and away ya go.
Lanshare is strictly filedata transfers. It’s not like any remote control, such as TightVNC. I use it much like TeamViewer without passing through TVs $erver$.

Thanks for your time,
~s

Processor is blank in my Settings > About. Now I know. Maybe we should delete my reply to OP so as no one tries it.
cpu-blank

Thanks
~s

Well, as it stands today, that project simply does not offer a build for ARM and therefore it simply isn’t an option for any phone (unless a customer is willing and able to build from source). It also means that it simply isn’t an option on a Raspberry Pi - and, since they would wish to test the build for ARM on something, a Raspberry Pi may be a more credible option.

At the current time they are only providing two builds - one for Windows on typical desktop/laptop and one for Debian-family Linux on typical desktop/laptop.

However I am an optimist. Maybe if users are asking the LanShare project about a build for ARM, they might oblige. If no one asks then it is unlikely to appear by magic. Well, anyway, I am a firm believer in asking. The worst that can happen is that they say “no”.

2 Likes

Maybe an option for you: KDE Connect. It’s not over USB, but using home network (you also can setup public network in a more complicated way). The UI is optimized for mobile Linux since they integrate it for Plasma Mobile.

It does not only allow to share files between L5 and Linux PC, but also with Windows, iOS and Android - if you still have those devices in use. Furthermore you have other options like remote control media, sharing clip board entry and some more.

File sharing works just fine. Other functionality too, but by far not all (yet).

3 Likes

I didn’t know what the L5 had because it’s blank. But I know it now. That aside, I didn’t knwo the difference between ARM and AMD(?). What prompted me to try to install it was the filename DOT .DEB (Debian?).

And I’m the pessimist. That’s a optimist with experience.

Going to check out LCK’s suggestion (below) as it looks promising and will do what I need.

many thanks Irvine
~s
edit was to fix a poorly typed reply. No more wine. Ooops Cops are here - gotta run - bye

1 Like

Just what I was hoping for. I read the install and some wiki. Looks a bit daunting so I’ll save it for Thursday. I’ll post back how it goes - if I live :neutral_face:
~s

I could use SSH/SCP, but I find that Warpinator works on the L5 and is easy to use. Available as flatpak for L5 and desktop Linux. I got the desktop version from the Linux Mint repository using Gnome Software.

4 Likes

As an alternative to LANshare, if you want a graphical program for transferring files over the network, probably one of the more standard ones is filezilla. It’s FOSS and is most likely in the PureOS repo (so it’s just an “apt install filezilla” away). Furthermore there are filezilla binaries for Windows. [Aside: If you do install it on Windows, download it from the filezilla website ( https://filezilla-project.org/ ) since the download.com version is known to have adware in it. The Debian version is, of course, free from adware.]

I had a quick look at the source and LANshare appears to transfer the files without encryption. On your home LAN that’s probably OK … but, in general, it’s why most people prefer to use ssh/scp or programs that leverage ssh such as sftp or can do so (e.g. rsync). These days (since Windows 10?) Windows comes with sftp, ssh, and scp.

I understand your trepidation (~s “That’s all Greek to me.”) with using non-GUI methods. It’s fine. But I will say that “knowledge is power”. There are a handful of obtuse-looking tools that are well worth learning if you will be using Linux/Unix/BSD over the long term (e.g. > 3 years).

1 Like

What is meant by “binaries”? I know what it means, but didn’t know how it applies to this kind of program.
I have a bit of reading to do before deciding.

Thanks very much for your help
~f

I meant installable executable programs (in Windows, an .exe or something that will install an .exe). This is distinguished from the “source code” which would need to be complied to create the executable program.

Aside: Sometimes you end with ~s and other times it’s ~f.