DSL Tips and Tricks :: How to mount your phone as a file system with BT



I had hoped to be able to mount a mobile phone file system on DSL using fuse/obexfs but I have been unable to compile obexfs and "apt-get install obexfs" from Debian testing does not work either (perhaps not a surprise as DSL is based on Debian oldstable).

For the alternate solution to work, Network File Systems (NFS) needs to be enabled - which it is in DSL - and the NFS modules loaded.

You will need to visit http://www.koeniglich.de/p3nfs.html and download two files:

1. p3nfs-5.19.tar.gz
2. One of the *.sis files corresponding to your mobile phone

Note that I believe this solution may only work on Symbian phones. Once you have the files, p3nfs-5.19 needs to be compiled on DSL (I will post p3nfs.dsl soon) and the *.sis file needs to be copied to your phone and installed.

sdptool only reports 4 Bluetooth channels on my phone - Ch 1: serial connection, Ch 2: obexpush, Ch 3: file transfer & Ch 7: dial-up, but somehow the p3nfs application uses Bluetooth channel 13 so you will need to set rfcomm up for this. Take care not to overwrite an existing rfcomm connection for dial-up, obexftp, etc.

Make sure Bluetooth is enabled on your phone and it is paired with your DSL machine. The *.sis application needs to be started on your phone and toggled to bluetooth (there are also irda and tcp/ip options).

# rfcomm bind 1 00:0A:D9:E8:4A:65 13 [1= rfcomm1, 13=Ch 13]
# mknod -m 666 /dev/rfcomm1 c 216 1
# modprobe nfs
# modprobe nfsd
# portmap start [required for p3nfs]
# mkdir /mnt/phone
# p3nfsd -UIQ -tty /dev/rfcomm1 -dir /mnt/phone    
p3nfsd: version 5.19, using /dev/rfcomm1 (115200), mounting on /mnt/phone
p3nfsd: to stop the server do "ls /mnt/phone/exit". (pid 6897)

# ls /mnt/phone/C:/documents/                  
Agenda       Cmra         GsChess      HomeRun      Jotter       MMS          Media files  Opera        Voice        WorldMate    tube

# ls /mnt/phone/exit
ls: /mnt/phone/exit: File exists
# p3nfsd: exiting.

Once the connection is made, you can copy files from/to DSL using emelFM. Note that if the file name has a space in it, you will need to include the name in single quotes, eg '/mnt/phone/C:/documents/Media files/'

The connection is not that fast but is OK for smallish files. I will need to check if p3nfs has a way to increase the speed above 115200.

Finally, a word of warning - take care which files you delete on your phone, you could easily render it inoperable...

I must try all this stuff.  Great work Juanito.
A quick update to the how-to now that I compiled the bluetooth extension as bluez-utils.uci:

After compiling the same version of fuse as dsl appears to use (fuse-2.5.3), I finally managed to mount a bluetooth device as a file system using obexfs - using p3nfs in the post above probably has more functionality, but fuse/obexfs should work with all obex compliant devices.

Here's how:
Code Sample
$ sudo modprobe fuse
$ sudo mount -t fuse "/opt/bluez-utils/bin/obexfs#-b00:0A:D9:E8:4A:65 -B3" /mnt/P900
$ sudo ls /mnt/P900               
m_Impossible(1).mid  m_Impossible.mid

$ sudo cp /mnt/P900/m_Impossible.mid /home/dsl
[and, just to prove it worked...]
$ ls /home/dsl/m_*
/home/dsl/m_Impossible.mid

- where B3 is the bluetooth channel for file transfer on the device I used.

Quote (Juanito @ Feb. 26 2007,06:39)
Note that I believe this solution may only work on Symbian phones. Once you have the files, p3nfs-5.19 needs to be compiled on DSL (I will post p3nfs.dsl soon) and the *.sis file needs to be copied to your phone and installed.

It might be nice to have a list of supported phones.
Quote
It might be nice to have a list of supported phones

As per the web site in the first post " P3nfsd is a Symbian (Psion/Nokia/Sony-Ericsson/etc) to UNIX/Linux communication program". However, I believe obexftp and/or obexfs will work with many more phones/pda than this - see www.openobex.org

Next Page...
original here.