Author Topic: Gemini MassStorage App?  (Read 4670 times)

PJS

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Gemini MassStorage App?
« on: March 10, 2018, 02:09:53 pm »
Suggestion:

It occurred to me after hearing Dr. Janko mention one side
of the Gemini's USB ports supported being used in "slave"
mode, that it would be great if they'd provide an app
(driver?) which would allow for the Gemini to be used as a
USB MassStorage device.

Like the original Android phones did, before they pulled
the functionality in ~v1.5-1.6.

Thoughts?

Thanks,

PJS

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Gemini MassStorage App?
« Reply #1 on: March 10, 2018, 02:22:36 pm »
Quote from: PJS
Suggestion:

It occurred to me after hearing Dr. Janko mention one side
of the Gemini's USB ports supported being used in "slave"
mode, that it would be great if they'd provide an app
(driver?) which would allow for the Gemini to be used as a
USB MassStorage device.

Like the original Android phones did, before they pulled
the functionality in ~v1.5-1.6.


Was poking around with this earlier, try enabling dev mode by going to the about  phone apge and tapping the version 7-8 times, you then have the option of specifying what the device shows up as when attached. i have tried it with the network adapter without luck but that may be a driver issue
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

PJS

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Gemini MassStorage App?
« Reply #2 on: March 13, 2018, 01:43:50 pm »
Yeah, I looked at that too.  It looks like the only modes natively supported
by AndroidOS are:   MTP, PTP, USB Ethernet and audio out.  Pity.

MassStorage would be so much universal & compatible - no drivers needed, most
anything just works.

PJS

Varti

  • Administrator
  • Hero Member
  • *****
  • Posts: 1271
    • View Profile
Gemini MassStorage App?
« Reply #3 on: March 14, 2018, 04:20:23 am »
Quote from: PJS
Yeah, I looked at that too.  It looks like the only modes natively supported
by AndroidOS are:   MTP, PTP, USB Ethernet and audio out.  Pity.

MassStorage would be so much universal & compatible - no drivers needed, most
anything just works.
MassStorage has some limitations which MTP doesn't have: a separate partition must be used since, when mounted on the PC, it has to be unmounted on the Android side, and it has to be FAT32. I believe most modern OSes have MTP support already built-in, anyway. Here's an article explaining the reasons for the move from MassStorage to MTP:

https://www.howtogeek.com/192732/android-us...b-mass-storage/

Varti
Planet Gemini PDA WiFi/LTE with Mediatek x27
SL-C1000 running Arch Linux ARM May2017, K30225 Wi-Fi CF Card, 64GB SDXC card
and many other Zauruses!

Alius

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Gemini MassStorage App?
« Reply #4 on: March 14, 2018, 04:43:54 pm »
Thanks for the link to that article Varti, I always wondered why they did this.  I used mass storage a lot in my old android phone(s).

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Gemini MassStorage App?
« Reply #5 on: March 14, 2018, 11:18:31 pm »
It is not a mass storage driver as such, but if you want to get things from your phone you can set up a simple web server and then copy things from your phone. Alternatively run sshd, then rcp/scp them. I currently use termux for both, but I am sure there are apps which do the same. Doesn't matter about drivers or OS - so long as your PC has a web browser (or ssh/putty)

Dr. Watson

  • Newbie
  • *
  • Posts: 13
    • View Profile
Gemini MassStorage App?
« Reply #6 on: June 13, 2018, 07:03:30 am »
If you want to use the Gemini like a USB stick or a CD drive, I have just successfully tested DriveDroid which allows for that.
I was able to download an Ubuntu ISO, present it to the PC via DriveDroid as a virtual USB storage device and boot my PC into Ubuntu.
It's even much faster than using a CD drive.
Since I need to use different boot media regularly, I really appreciate that the Gemini supports DriveDroid. My previous phone didn't.
Saves me a lot of time creating USB boot sticks or burning DVDs from downloaded ISO images.
This is about as useful to me as a swiss army knife.

If your intention is to transfer files between the Gemini and a PC that doesn't speak MTP:
Two operating systems can normally not mount the same file system at the same time. It's like two people simultaneously writing on the same line on a piece of paper.
That means that previously the "sdcard" file system had to be unmounted on the Android side, terminating all apps that were accessing any files or folders at that point, so that the PC was able to cleanly mount the filesystem without corruption and interference. Android apps had to "wait" until the PC unmounted the sdcard before they could access the sdcard again.
This was a very unreliable and dissatisfying mechanism.
Apart from that Windows could only handle NTFS and FAT file systems. Both had limitations which made them unsuitable for the Android system. I won't even mention the licensing issues.

Current android uses a linux file system which is less prone to corruption, supports files>4G, stronger security and encryption.
MTP is the protocol that acts as an intermediary between the Android operating system/apps actively "working" on this linux file system and the PC wanting to read and write files.
Not a bad solution in my opinion. It minimizes conflicts, allows apps to keep doing what they are doing and reduces corruption to practically 0.
The only disadvantage is that the OS on the PC has to support MTP. But any sufficiently recent OS does ...

Other alternatives for transferring files:
-USB C SD adapter
-Install DroidSSH and copy files from Windows with WinSCP over WIFI. Or any sftp client.
-TotalCommander Wifi Plugin
-TotalCommander LAN Plugin to copy files from the Gemini to and from your PC over WIFI
-USB Tethering and DroidSSH + WinSCP
-Google Drive
-ADB
...

gidds

  • Sr. Member
  • ****
  • Posts: 324
    • View Profile
Gemini MassStorage App?
« Reply #7 on: June 13, 2018, 12:37:46 pm »
Quote from: Dr. Watson
The only disadvantage is that the OS on the PC has to support MTP. But any sufficiently recent OS does ...

It does?  My Mac (with the current macOS) doesn't seem to…

I had to install Android File Transfer, but it's not very good: the window might look like a Finder window, but doesn't behave like one (sorts differently, can't see file info or move files within the drive &c).  Quite buggy, too: can't transfer files with characters like question marks, confuses ‘skip’ with ‘abort’, and freezes or crashes quite frequently.

I'm currently running sshd on the Gemini and scp on the Mac, to transfer files over wifi (which is more flexible as well as not requiring a cable) — but the Gemini sometimes can't preserve timestamps, which will cause problems.

What options might there be?


And a related question: although I've used the developer settings to tell the Gemini to connect in MTP mode, it always starts off with just USB charging, and I have to use the notification bar to switch.  Every time…  Am I doing something wrong?
   Andy/
Psion 3a → Psion 5 → Psion 5mx → Gemini → Astro

petefoth

  • Newbie
  • *
  • Posts: 41
    • View Profile
Gemini MassStorage App?
« Reply #8 on: June 14, 2018, 02:39:13 am »
Quote from: gidds
Quote from: Dr. Watson
The only disadvantage is that the OS on the PC has to support MTP. But any sufficiently recent OS does ...

It does?  My Mac (with the current macOS) doesn't seem to…

I had to install Android File Transfer, but it's not very good: the window might look like a Finder window, but doesn't behave like one (sorts differently, can't see file info or move files within the drive &c).  Quite buggy, too: can't transfer files with characters like question marks, confuses ‘skip’ with ‘abort’, and freezes or crashes quite frequently.

I'm currently running sshd on the Gemini and scp on the Mac, to transfer files over wifi (which is more flexible as well as not requiring a cable) — but the Gemini sometimes can't preserve timestamps, which will cause problems.

What options might there be?


And a related question: although I've used the developer settings to tell the Gemini to connect in MTP mode, it always starts off with just USB charging, and I have to use the notification bar to switch.  Every time…  Am I doing something wrong?

On my main Android phone I use a server app on the phone called SSHelper and an app called CyberDuck on the Mac. Not got round to trying it on the Gemini yet, but it should work

HTH

Pete

Dr. Watson

  • Newbie
  • *
  • Posts: 13
    • View Profile
Gemini MassStorage App?
« Reply #9 on: June 17, 2018, 11:56:07 pm »
Quote from: gidds
Quote from: Dr. Watson
The only disadvantage is that the OS on the PC has to support MTP. But any sufficiently recent OS does ...

It does?  My Mac (with the current macOS) doesn't seem to…

I had to install Android File Transfer, but it's not very good: the window might look like a Finder window, but doesn't behave like one (sorts differently, can't see file info or move files within the drive &c).  Quite buggy, too: can't transfer files with characters like question marks, confuses ‘skip’ with ‘abort’, and freezes or crashes quite frequently.

I'm currently running sshd on the Gemini and scp on the Mac, to transfer files over wifi (which is more flexible as well as not requiring a cable) — but the Gemini sometimes can't preserve timestamps, which will cause problems.

What options might there be?


And a related question: although I've used the developer settings to tell the Gemini to connect in MTP mode, it always starts off with just USB charging, and I have to use the notification bar to switch.  Every time…  Am I doing something wrong?

Excuse my ignorance :-)    Who would ever suspect that Apple does not wish to support owners of Android phones .....

The timestamp problem might happen due to different time resolution of Linux and MAC file systems:
https://superuser.com/questions/919127/rsyn...amp-off-by-1-se
https://unix.stackexchange.com/questions/34...n-running-rsync

gidds

  • Sr. Member
  • ****
  • Posts: 324
    • View Profile
Gemini MassStorage App?
« Reply #10 on: June 18, 2018, 04:28:21 am »
Quote from: Dr. Watson
The timestamp problem might happen due to different time resolution of Linux and MAC file systems

I doubt it -- SCP (the standard file transfer program that runs over SSH) seems highly unlikely to be filesystem-specific.

And I've seen other reports of problems with file timestamps on Android (though I haven't seen a decent explanation yet).
   Andy/
Psion 3a → Psion 5 → Psion 5mx → Gemini → Astro

1668880

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Gemini MassStorage App?
« Reply #11 on: June 21, 2018, 12:36:31 pm »
Quote from: Dr. Watson
If you want to use the Gemini like a USB stick or a CD drive, I have just successfully tested DriveDroid which allows for that.
I was able to download an Ubuntu ISO, present it to the PC via DriveDroid as a virtual USB storage device and boot my PC into Ubuntu.
It's even much faster than using a CD drive.
Since I need to use different boot media regularly, I really appreciate that the Gemini supports DriveDroid. My previous phone didn't.
Saves me a lot of time creating USB boot sticks or burning DVDs from downloaded ISO images.
This is about as useful to me as a swiss army knife.

If your intention is to transfer files between the Gemini and a PC that doesn't speak MTP:
Two operating systems can normally not mount the same file system at the same time. It's like two people simultaneously writing on the same line on a piece of paper.
That means that previously the "sdcard" file system had to be unmounted on the Android side, terminating all apps that were accessing any files or folders at that point, so that the PC was able to cleanly mount the filesystem without corruption and interference. Android apps had to "wait" until the PC unmounted the sdcard before they could access the sdcard again.
This was a very unreliable and dissatisfying mechanism.
Apart from that Windows could only handle NTFS and FAT file systems. Both had limitations which made them unsuitable for the Android system. I won't even mention the licensing issues.

Current android uses a linux file system which is less prone to corruption, supports files>4G, stronger security and encryption.
MTP is the protocol that acts as an intermediary between the Android operating system/apps actively "working" on this linux file system and the PC wanting to read and write files.
Not a bad solution in my opinion. It minimizes conflicts, allows apps to keep doing what they are doing and reduces corruption to practically 0.
The only disadvantage is that the OS on the PC has to support MTP. But any sufficiently recent OS does ...

Other alternatives for transferring files:
-USB C SD adapter
-Install DroidSSH and copy files from Windows with WinSCP over WIFI. Or any sftp client.
-TotalCommander Wifi Plugin
-TotalCommander LAN Plugin to copy files from the Gemini to and from your PC over WIFI
-USB Tethering and DroidSSH + WinSCP
-Google Drive
-ADB
...

Thank you for sharing the DriveDroid app, it is just what I needed.

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
    • View Profile
Gemini MassStorage App?
« Reply #12 on: June 24, 2018, 08:02:10 am »
load up termux and scp the files between the Gemini and a Mac?
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

gidds

  • Sr. Member
  • ****
  • Posts: 324
    • View Profile
Gemini MassStorage App?
« Reply #13 on: June 25, 2018, 04:09:07 am »
Quote from: speculatrix
load up termux and scp the files between the Gemini and a Mac?

By an odd coincidence, that's exactly what I'm doing.  

One complication is that sshd is best run as root on the Gemini, to avoid issues with not being able to set timestamps or write to the external SD card.  But there's no way to set up file permissions on SSH's config files so it's happy.  (The entire Termux hierarchy is under a directory which is writable by your normal user, but to run as root SSH wants its config under a hierarchy not writable by anyone other than root.)  The only solution I've fond so far is to disable SSH's strict checking (by adding the line 'StrictModes no' to /data/data/com.termux/files/usr/etc/ssh/sshd_config -- which seems dangerous).

However, this does have several advantages: you don't need to plug in a cable, you get full access to the entire filesystem, and you can script it.

I also found a neat way to set up a shortcut on the home screen which starts sshd as root: create a ~/.shortcuts directory, write a file in there with the line 'tsu -s sshd', install Termux:Widgets, and then that script can be selected as a widget from the home screen.

(Termux has no 'sudo' command, but it has a nice wrapper around 'su' called 'tsu', and its '-s' flag takes a shell to run.  Turns out it doesn't have to be a shell!)
   Andy/
Psion 3a → Psion 5 → Psion 5mx → Gemini → Astro