Entries Tagged 'tech' ↓

Using the iPhone as a wireless external drive with SFTP

Some tech news websites have been singing the praises of a new iPhone app called DataCase.

It allows you to use your iPhone as a wireless storage device.  It’s a great idea because there’s a decent amount of space on the iPhone and wireless access to anything is cool.

Their Mac Demo looks great but on a Windows or Linux machine, you have to use FTP and / or HTTP to transfer files.  My first reaction was that this was great anyway, but then I remembered how annoying it can be when your “portable hard drive” doesn’t behave exactly like you’d expect.

Limitations of DataCase

You can’t easily map an FTP drive to a letter in Windows.

Under My Computer, your main hard drive is usually C.  A USB memory stick or camera may be seen as letter F when you plug it in.  This is a useful thing to be able to do because most programs can’t “see” FTP.

You can’t ’save as’ a document onto an FTP site - and as such, you won’t be able to natively integrate your iPhone as though it was a USB stick. It’s not a big deal really, DataCase still a cool app (especially since it has some inbuilt file viewers) but it’s not ideal.

Free (for jailbroken iPhones) alternative to DataCase?

My iPhone is jailbroken.  One of the cool things about jailbreaking an iPhone is that you can SSH / SFTP in and have access to the disk.  I had look around and after an unsuccessful attempt at “rolling my own” drive map through a tutorial, I spotted a program called SftpDrive which uses SSH to connect to your iPhone and map it to a local drive on Windows.

It’s not free - but there is a 6 week free trial - it costs $39 (£20ish) to buy.

Before configuring SftpDrive though, you’ll have to get your computer and your iPhone talking to each other.

My laptop connects through a wire to the internet so I have to create a wireless network so that the computer and the iPhone can see each other.  If you are already using a wireless network, you probably don’t need to do this - you only need to know your phone’s IP address.

In Windows XP, I right-clicked on my wireless network icon in the System Tray and went to “View Available Wireless Connections”  I then clicked on “Change Advanced Settings” and then clicked on the “Wireless Networks” tab.

Initially, I just wanted to get the connection working so I didn’t use encryption.  I’m going to put the encryption on soon.

The red boxes above indicate which settings were changed from the default.

After clicking OK a few times, this new network is available on the “View Available Networks” screen.

XP is kind of funny about ad-hoc (computer to computer) networks.  If there is a ‘proper’ wireless network around that you connect to usually, you can’t just click on your iPhoneConnection network and connect.  You have to disconnect first from all other networks.

Once the laptop is free of existing conections, I clicked on the new iPhoneConnection and clicked connect.

For some reason, the computer stayed in “waiting for network” mode - but this is ok because by doing so, it is sending out the name “iPhoneConnection” and your iPhone will see it.

In your Settings app, head into the wifi option.  You should see your new iPhoneConnection available.

Connect to it. then touch the wee blue circle/arrow, choose static and give your iPhone a static ip address like so.

Now you need to give your computer a similar address so that they can see each other.  Right click on the wireless connection symbol and choose ’status’, then properties to get to this screen.

Double click on “Internet Protocol (TCP / IP)” and give your computer a compatable IP address to that of the phone.

If you connect to other networks (and not just your iPhone), you may want to put the IP and Subnet numbers in the “Alternative Configuration” tab instead (so you don’t screw up your main wireless connection).

Click OK a few times and your computer and your iPhone should both report that they are connected.  Often the computer will drop the connection before you get here so go back into the “view available” screen and connect again.  And similarly, in the iPhone, get back into your WIFI settings and reconnect (if you don’t see the connection here, connect on PC first, then switch WiFi off and on again on the phone).

Now you’re ready to set up SSH and SftpDrive.  I won’t show SSH setup here - if you have Cydia on your iPhone (default option when jailbreaking), you’ll see a menu item there about setting up OpenSSH.

I’m assuming that you have OpenSSH on your iPhone.

Download and install SftpDrive.  Run it and you’ll see a screen similar to this:

Fill in the boxes as so (the default root password is “alpine” (as of 2.0.1 firmware anyway) - you should change this!

Click connect and that’s that.

If you get an error, it is likely that the connection has dropped.  Once more, reconnect your PC and iPhone to the wifi connection before clicking “connect” again.  You can test if your connection is working by pressing the Windows key and “r” to open the ‘run’ dialogue and then typing in:

ping 192.168.10.1

and pressing ok - if you see replies, then the connection is fine.  If you have frequent drop offs, change your iPhone settings so that “auto lock” is set to “never”.  I think the connection drops most often when the iPhone is in screensaver / black screen mode.

And that’s that.  So long as you have a wifi connection between the two, the drive is stable (I think!)