Other Mobile phone access

How do I access data on my mobile phone via a USB cable?

When using a Sony Xperia connected to a laptop I get a prompt to install PC Companion software on my computer. I'm sure this won't work on FreeBSD. Is there anything that would?
 
Here is how I managed to access Samsung J7 via USB cable:

- Install simple-mtpfs
- Issue commands (for some reason thing works only as root):
# mkdir /mnt/phone (or whatever name)
# simple-mtpfs /mnt/phone
# thunar (or Your prefered file manager - as superuser) and browse for files

Be on watch for phone screen, my smartphone launch permission question to allow/deny access from PC.
 
You can install sysutils/dsbmd and sysutils/dsbmc.
Code:
echo "dsbmd_enable="YES" >> /etc/rc.conf
service dsbmd start
Then start dsbmc as regular user. It let's you mount all detected storage devices through context menu or a double click. The mounted devices can be accessed as regular user.
 
@ balanga
After trying dsbmd+dsbmc, gmtp, android-file-transfer, I just 'discovered' proper way to mount it (by simple-mtpfs):

I created folder /media/J7 , took ownership of it, and now issuing command
[B]$[/B] simple-mtpfs /mnt/J7
will mount usb-connected phone to /media/J7 , and I have r/w access + icon in file manager :)

@ mrclksr
I didn't know about dsbmd+dsbmc, I tryied it, but unfortunately I can't connect phone, only other disks. BTW, trying dsbmd+dsbmc gave me the idea to "proper way" mentioned to balanga
 
@ balanga
After trying dsbmd+dsbmc, gmtp, android-file-transfer, I just 'discovered' proper way to mount it (by simple-mtpfs):

I created folder /media/J7 , took ownership of it, and now issuing command
[B]$[/B] simple-mtpfs /mnt/J7
will mount usb-connected phone to /media/J7 , and I have r/w access + icon in file manager :)

Wow... nice and simple and it JUST WORKS!!!

BTW pkg install fusefs-simple-mtpfs if anyone wants to try it...
 
Handsome Jack ,

[FONT=Courier New]dsbmd[/FONT] uses [FONT=Courier New]fuse-simple-mtpfs[/FONT] to mount MTP device. All smartphones and tablets I have tested worked well with [FONT=Courier New]dsbmd[/FONT]. As developer I'm interested to see why your phone wasn't detected. Can you provide the output of

Code:
sh -c 'i=0; while [ $i -lt 10 ]; do usbconfig -u 4 -a 3 dump_string $i; i=`expr $i + 1`; done'
please?

Replace [FONT=Courier New]-u 4[/FONT] and [FONT=Courier New]-a 3[/FONT] according to the [FONT=Courier New]ugen[/FONT] device of your phone.
 
Trying to keep system clean as much as possible, I uninstalled all those packages. As I remember, phone was detected correctly, but I couldn't get access - there was that rotating-circle-icon, rotating forever... (even with sudo)
Also, I didn't put "dsbmd_enable="YES" in rc.conf, but did service dsbmd onestart
I will now reinstall all those packages again, and BRB
 
OK, here:

$ sh -c 'i=0; while [ $i -lt 10 ]; do usbconfig -u 4 -a 2 dump_string $i; i=`expr $i + 1`; done'

STRING_0x00 = 0x04, 0x03, 0x09, 0x04
STRING_0x01 = <SAMSUNG>
STRING_0x02 = <SAMSUNG_Android>
STRING_0x03 = <5200106afee85423>
STRING_0x04 = <read error>
STRING_0x05 = <MTP>
STRING_0x06 = <CDC Abstract Control Model (ACM)>
STRING_0x07 = <CDC ACM Data>
STRING_0x08 = <CDC Serial>
STRING_0x09 = <read error>

- There is /media/SAMSUNG_Android/ folder created, but double click on Phone Icon (or mount drive, or open) produces "Mounting failed"
- dsbmd service is running (looked by top )
- maybe this helps: I don't have hald enabled
 
Thank you, Handsome Jack .


- There is /media/SAMSUNG_Android/ folder created, but double click on Phone Icon (or mount drive, or open) produces "Mounting failed"
What's the error message regarding the [FONT=Courier New]simple-mtpfs[/FONT] command in [FONT=Courier New]/var/log/dsbmd.log[/FONT]?

- maybe this helps: I don't have hald enabled
It's better not to run [FONT=Courier New]hald[/FONT] together with [FONT=Courier New]dsbmd[/FONT]. So, that's good.
 
dsbmd: Command /usr/local/bin/simple-mtpfs -o "uid=${DSBMD_UID},gid=${DSBMD_GID},allow_other" ${DSBMD_DEVICE} "${DSBMD_MNTPT}" executed by UID 1001 failed with code 256 on Sat Dec 2 22:25:43 2017
 
Just one more test. Can you please run [FONT=Courier New]dsbmd[/FONT] in foreground, and then retry to mount your phone using [FONT=Courier New]dsbmc[/FONT]?
Code:
service dsbmd stop
/usr/local/libexec/dsbmd -f
I'm interested in the console output of the [FONT=Courier New]simple-mtpfs[/FONT] command.
 
Code:
$ sudo /usr/local/libexec/dsbmd -f
dsbmd: dsbmd started on Sat Dec  2 22:57:43 2017
dsbmd: ioctl(/dev/cd0, CDRIOCREADSPEED): Input/output error on Sat Dec  2 22:57:43 2017

Code:
$ simple-mtpfs
Wrong usage! See `simple-mtpfs -h' for details
 
Thank you, but I meant the [FONT=Courier New]dsbmd [/FONT]console output after you tried to mount your phone with [FONT=Courier New]dsbmc[/FONT].
 
:D
Code:
$ sudo /usr/local/libexec/dsbmd -f
dsbmd: dsbmd started on Sat Dec  2 22:57:43 2017
dsbmd: ioctl(/dev/cd0, CDRIOCREADSPEED): Input/output error on Sat Dec  2 22:57:43 2017
dsbmd: Client with UID 1001 connected on Sat Dec  2 23:05:15 2017
mount_fusefs: /dev/fuse on /media/SAMSUNG_Android: Operation not permitted
fuse: failed to mount file system: Device busy
dsbmd: Command /usr/local/bin/simple-mtpfs -o "uid=${DSBMD_UID},gid=${DSBMD_GID},allow_other" ${DSBMD_DEVICE} "${DSBMD_MNTPT}" executed by UID 1001 failed with code 256 on Sat Dec  2 23:05:18 2017
 
Thank you! That's interesting. Do you have [FONT=Courier New]usermount[/FONT] set to [FONT=Courier New]true[/FONT] in [FONT=Courier New]/usr/local/etc/dsbmd.conf[/FONT]?
 
Code:
/etc/sysctl.conf :
vfs.usermount=1
kern.ipc.shm_allow_removed=1

Code:
/usr/local/etc/dsbmd.conf :
# usermount - Controls whether DSBMD mounts devices as user. This requires the
# sysctl variable vfs.usermount is set to 1.
usermount = true

Code:
devfs.rules:
[system=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
add path 'da*' mode 0660 group operator
add path 'ada2' mode 0660 group operator
add path 'ugen[0-9]\*'  mode 0666 group usb
add path 'usb/\*'   mode 0666 group usb
add path 'acd*' mode 0666
add path 'cd*' mode 0666
add path 'pass*' mode 0666
add path 'xpt*' mode 0666

Code:
rc.conf :
clear_tmp_enable="YES"
syslogd_flags="-ss"
sendmail_enable="NONE"
hostname="whatever"
ifconfig_igb0="DHCP"
ifconfig_igb0_ipv6="inet6 accept_rtadv"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
dbus_enable="YES"
keymap="hr"
linux_enable="YES"
kld_list="fuse"
devfs_system_ruleset="system"
cupsd_enable="YES"
dsbmd_enable="YES"
 
Please set [FONT=Courier New]usermount=false[/FONT] in [FONT=Courier New]/usr/local/etc/dsbmd.conf,[/FONT] and restart [FONT=Courier New]dsbmd[/FONT]. The new [FONT=Courier New]dsbmd-0.5[/FONT] (if you want to test it: https://github.com/mrclksr/DSBMD/releases/tag/0.5 But make sure to copy the new [FONT=Courier New]dsbmd.conf[/FONT] to [FONT=Courier New]/usr/local/etc/[/FONT]) which will be in the ports soon, supports mounting as user.
 
Whoa!
Setting usermount = false in /usr/local/etc/dsbmd.conf
Code:
$ sudo /usr/local/libexec/dsbmd -f
dsbmd: dsbmd started on Sat Dec  2 23:49:26 2017
dsbmd: ioctl(/dev/cd0, CDRIOCREADSPEED): Input/output error on Sat Dec  2 23:49:26 2017
dsbmd: Client with UID 1001 connected on Sat Dec  2 23:49:33 2017
Could not retrieve device storage.
For android phones make sure the screen is unlocked.
### Note: Here I just pressed Allow on my phone screen when notification appears ###
dsbmd: Device /dev/ugen4.2 mounted on /media/SAMSUNG_Android by UID 1001 on Sat Dec  2 23:49:44 2017
dsbmd: Device /dev/ugen4.2 mounted on /media/ugen4.2 by UID 1001 on Sat Dec  2 23:51:06 2017

Now there is /media/ugen4.2/ folder created, and I am the owner, and finally managed to access files!
About v 0.5 , I am not sure I know how to install it from source code (configure, make, make install?) (it is a FreeBSD, and I am a newbie, so a hint will be appreciated);
THANK YOU
 
Now there is /media/ugen4.2/ folder created, and I am the owner, and finally managed to access files!
Excellent!
About v 0.5 , I am not sure I know how to install it from source code (configure, make, make install?) (it is a FreeBSD, and I am a newbie, so a hint will be appreciated);
THANK YOU

Code:
% su
# service dsbmd stop
# rm /usr/local/etc/dsbmd.conf
# cd /tmp
# fetch http://freeshell.de/~mk/download/dsbmd-port.tgz
# tar xf dsbmd-port.tgz
# cd dsbmd
# make deinstall
# make install
# service dsbmd start
BTW:
If you want automount, (dsbmd-0.5 assumed) you can install sysutils/dsbmc-cli. Start [FONT=Courier New]dsbmc-cli -a[/FONT] as regular user. You will be able to unmount the devices using your filemanager.

Thank you for the feedback!
 
OK, v 0.5 installed and working;
/media/SAMSUNG_Android/ folder is created (meaning: not /media/ugen4.2) , I have file access;

Now, about that: "Start dsbmc-cli -a as regular user. You will be able to unmount the devices using your filemanager."
I am able to unmount smartphone using file manager (Thunar and/or Caja) without dsbmc-cli installed.
 
I am able to umnount smartphone using file manager (Thunar and/or Caja) without dsbmc-cli installed.

Yes, of course. I wanted to say that if you let [FONT=Courier New]dsbmd[/FONT]/[FONT=Courier New]dsbmc-cli[/FONT] automount your devices, you don't have to use [FONT=Courier New]dsbmc[/FONT] or [FONT=Courier New]dsbmc-cli[/FONT] (or umount as root) to unmount them. This was necessary before version 0.5., where you had full access to the mount point, but no permission as regular user to unmount.
 
Personally, I still prefer to mount using dsbmc when I need to access the filesystem. But many seem to prefer automount.
 
Holly shhhhhhhhh............!!!!!
I just installed dsbmc-cli, and $ dsbmc-cli -a and booooooom I have all devices mounted, including ext4@HDD, ntfs@SSD, fat32@USB3.0_stick, smartphone ...
I spent hours to achieve such things.... This is brilliant!
 
How do I access data on my mobile phone via a USB cable?
IMO, the most universal way of accessing any Android-based phone is using devel/android-tools-adb. You'll need to enable developers options in the phone though.
Then it's straight forward:
Login into shell: adb shell.
Copy files to or from:
adb push mysong.mp4 /sdcard/Music
adb pull /sdcard/Video/myvideo.mp4 /my/local/path.
Of course, when logged in the shell you want to list files to get the actual directories names.
Note, that even eMMC may be mounted/symlinked as sdcard ― depending of vendor.
 
Back
Top