File transfer

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (SFTP: added root/nopassword note.)
(sshfs section)
Line 20: Line 20:
  
 
  scp -r somedirectory root@192.168.0.202:
 
  scp -r somedirectory root@192.168.0.202:
 +
 +
== SSHFS ==
 +
 +
You can use sshfs to mount directories on your Openmoko smartphone into directories on your desktop computer. You can mount sshfs as normal user if you add yourself to the "fuse" group.
 +
 +
This <tt>Makefile</tt> makes it very easy to mount and umount sshfs.
 +
 +
<pre>
 +
# Usage: set the three vars here and then type
 +
# make moko
 +
# that will create "moko" in the current dir and mount the specified path
 +
# You need sshfs installed and your user added to "fuse" group on your PC.
 +
moko_u=root
 +
moko_h=192.168.0.202
 +
moko_p=/media/card
 +
#remote_h=example.org    # host or ip
 +
#remote_u=username        # remote username
 +
#remote_p=/path/to/mount  # uses home if left empty
 +
 +
%:
 +
mkdir -p $(PWD)/$*
 +
sshfs -C -o reconnect -o idmap=user $($*_u)@$($*_h):$($*_p) $(PWD)/$* || rmdir $(PWD)/$*
 +
 +
%_:
 +
mkdir -p $(PWD)/$*
 +
sshfs -C -o reconnect -o idmap=user -o follow_symlinks $($*_u)@$($*_h):$($*_p) $(PWD)/$* || rmdir $(PWD)/$*
 +
 +
%-:
 +
-fusermount -u $(PWD)/$*
 +
rmdir $(PWD)/$*
 +
</pre>
 +
 +
Type <tt>make moko</tt> to mount and <tt>make moko-</tt> to umount, once you have [[USB_Networking]] set up.
 +
  
 
== TFTP ==
 
== TFTP ==

Revision as of 21:27, 6 October 2008

The Openmoko hardware and software offer several ways to transfer files to and from the system.

Contents

SCP

Examples use the IP address of the default USB network setup on Om 2008.8. If you use a different connection, for example Wifi, use the Wifi IP address of the phone.

copy a file from Openmoko smartphone to to PC type this on your PC:

scp root@192.168.0.202:/full/path/to/filename .

from phone's /home/root you can use shorter format:

scp root@192.168.0.202:filename .

to copy file to the SD card in phone type this on your PC:

scp filename root@192.168.0.202:/media/card/

to recursively copy a directory to the phone, use -r:

scp -r somedirectory root@192.168.0.202:

SSHFS

You can use sshfs to mount directories on your Openmoko smartphone into directories on your desktop computer. You can mount sshfs as normal user if you add yourself to the "fuse" group.

This Makefile makes it very easy to mount and umount sshfs.

# Usage: set the three vars here and then type 
# make moko
# that will create "moko" in the current dir and mount the specified path
# You need sshfs installed and your user added to "fuse" group on your PC.
moko_u=root
moko_h=192.168.0.202
moko_p=/media/card
#remote_h=example.org     # host or ip
#remote_u=username        # remote username
#remote_p=/path/to/mount  # uses home if left empty

%:
	mkdir -p $(PWD)/$*
	sshfs -C -o reconnect -o idmap=user $($*_u)@$($*_h):$($*_p) $(PWD)/$* || rmdir $(PWD)/$*

%_:
	mkdir -p $(PWD)/$*
	sshfs -C -o reconnect -o idmap=user -o follow_symlinks $($*_u)@$($*_h):$($*_p) $(PWD)/$* || rmdir $(PWD)/$*

%-:
	-fusermount -u $(PWD)/$*
	rmdir $(PWD)/$*

Type make moko to mount and make moko- to umount, once you have USB_Networking set up.


TFTP

client ('tftp')

server?

NFS

client (on Neo: 'mount -t nfs ...' or edit /etc/fstab and '/etc/init.d/mountnfs.sh start')

server?

HTTP

client (on Neo: 'wget',web browser)

MicroSD

It is possible to write data to micro SD on a desktop machine with the suitable writer and then have it accessible from inside the Openmoko after the card is inserted into that device. To get this working, the micro SD must be formatted in some filesystem that both Openmoko and host understand (ext2, for instance).

The problem with this approach is that micro SD is difficult to access in the Neo. Both battery and even SIM card must be removed to reach it.

SFTP

SFTP can be an excellent way to transfer files as it is supported by many possible clients on the desktop machine. After USB network is set up, it is possible to try to open sftp connection by entering sftp://192.168.0.202 or sftp://{username}:{password}@192.168.0.202 into the address bar of the browser that supports sftp.

You can also use the sftp console client under Linux or something like psftp.exe, the sftp client that goes with PuTTY for Windows.

Name and password is the same as for normal logins (root and no password by default).

FTP

FTP is currently considered insecure. There is no any reason to use FTP, SFTP should be used instead.

USB Mass Storage

The Freerunner can be configured to appear as a USB mass storage device to the desktop. see Using the Neo as a Mass storage device.

Common methods not supported

  • Bluetooth (except via other network methods)
Personal tools

The Openmoko hardware and software offer several ways to transfer files to and from the system.

SCP

Examples use the IP address of the default USB network setup on Om 2008.8. If you use a different connection, for example Wifi, use the Wifi IP address of the phone.

copy a file from Openmoko smartphone to to PC type this on your PC:

scp root@192.168.0.202:/full/path/to/filename .

from phone's /home/root you can use shorter format:

scp root@192.168.0.202:filename .

to copy file to the SD card in phone type this on your PC:

scp filename root@192.168.0.202:/media/card/

to recursively copy a directory to the phone, use -r:

scp -r somedirectory root@192.168.0.202:

SSHFS

You can use sshfs to mount directories on your Openmoko smartphone into directories on your desktop computer. You can mount sshfs as normal user if you add yourself to the "fuse" group.

This Makefile makes it very easy to mount and umount sshfs.

# Usage: set the three vars here and then type 
# make moko
# that will create "moko" in the current dir and mount the specified path
# You need sshfs installed and your user added to "fuse" group on your PC.
moko_u=root
moko_h=192.168.0.202
moko_p=/media/card
#remote_h=example.org     # host or ip
#remote_u=username        # remote username
#remote_p=/path/to/mount  # uses home if left empty

%:
	mkdir -p $(PWD)/$*
	sshfs -C -o reconnect -o idmap=user $($*_u)@$($*_h):$($*_p) $(PWD)/$* || rmdir $(PWD)/$*

%_:
	mkdir -p $(PWD)/$*
	sshfs -C -o reconnect -o idmap=user -o follow_symlinks $($*_u)@$($*_h):$($*_p) $(PWD)/$* || rmdir $(PWD)/$*

%-:
	-fusermount -u $(PWD)/$*
	rmdir $(PWD)/$*

Type make moko to mount and make moko- to umount, once you have USB_Networking set up.


TFTP

client ('tftp')

server?

NFS

client (on Neo: 'mount -t nfs ...' or edit /etc/fstab and '/etc/init.d/mountnfs.sh start')

server?

HTTP

client (on Neo: 'wget',web browser)

MicroSD

It is possible to write data to micro SD on a desktop machine with the suitable writer and then have it accessible from inside the Openmoko after the card is inserted into that device. To get this working, the micro SD must be formatted in some filesystem that both Openmoko and host understand (ext2, for instance).

The problem with this approach is that micro SD is difficult to access in the Neo. Both battery and even SIM card must be removed to reach it.

SFTP

SFTP can be an excellent way to transfer files as it is supported by many possible clients on the desktop machine. After USB network is set up, it is possible to try to open sftp connection by entering sftp://192.168.0.202 or sftp://{username}:{password}@192.168.0.202 into the address bar of the browser that supports sftp.

You can also use the sftp console client under Linux or something like psftp.exe, the sftp client that goes with PuTTY for Windows.

Name and password is the same as for normal logins (root and no password by default).

FTP

FTP is currently considered insecure. There is no any reason to use FTP, SFTP should be used instead.

USB Mass Storage

The Freerunner can be configured to appear as a USB mass storage device to the desktop. see Using the Neo as a Mass storage device.

Common methods not supported

  • Bluetooth (except via other network methods)