UNINNOVATE / Engineering At Its Finest

MyPhone: Share your iPhone’s music collection via WiFi

Released in late 2006, the Zune mp3 player was Microsoft’s attempt to establish itself in the portable music player market. This market has been dominated by Apple’s iPod since the initial release of the iPod in 2001.

The Zune was similar to the iPod in terms of price, size and capacity. However, it offered a unique wifi-based song sharing feature. Zune owners could “squirt” a song to another Zune owner. Unfortunately, the shared song was mired in DRM and could only be played three times before being inactivated. The feature was not a hit and the Zune failed to capture a significant share of the market.

Many called the Zune’s overly-limited wifi song sharing feature a missed opportunity. Apple’s new iPhone has also wifi support but it offers no access to music via wifi. I set out to fix this.

To address this, I’ve written an application called MyPhone. It runs on the iPhone and serves up the contents of the iPhone’s music library to any web browser on the same network. Using this application, you can listen to all of the music stored on your iPhone from another computer on the same wifi network. For example, you could take your iPhone to work and listen to its music library on your desktop or you could even listen to your music collection from another nearby iPhone.

Using MyPhone is very simple to use once it is installed and running:

  • From your desktop computer or other internet-capable device, point your web browser at http://your_iphone_address:1111/ . The “your_iphone_address” part should be replaced with the current ip address of your iPhone. You can find this by clicking on the wifi settings page on the iPhone.
  • Browse the list of music available on the iPhone. Music is sorted by Artist and Album.
  • Click on any song to listen to it in your web browser.

Unfortunately, installing applications on the iPhone is still very complicated at this point. If you are not experienced with iPhone hacking, you might want to wait until better tools are created to install iPhone applications. But if you want to try, here are the basic steps:

  1. Follow instructions on the web to get ssh running on your iPhone.
  2. Install iphone-binkit and python on your iPhone.
  3. Download MyPhone and copy it to /usr/local/bin on your iPhone.
  4. Log into your iPhone via ssh and run MyPhone with this command:
      • nohup python /usr/local/bin/MyPhone.py&
      1. Test out MyPhone from your desktop or laptop!

      Warnings:

      • MyPhone is written to encourage further development of applications that allow legal use use of your personal music collection with portable devices. It is not a fully-polished application and is meant for experienced users only. It is not meant to be a piracy tool, so please don’t use it for that.
      • MyPhone is NOT secure and is meant for your own personal use and experimentation. Be careful what wifi networks you join when MyPhone is running.
      • MyPhone is released as open source under the GNU GPL 2.0 license.

      Pictures:


      Picture: Listening to the iPhone’s music collection on a desktop via a wifi connection.


      Picture: Wireless sharing of a music collection between two iPhones on the same wifi network.

30 Comments so far

  1. Andy August 2nd, 2007 11:54 pm

    GUI & you will have newbie success

  2. [...] Comparte la colección de música en tu iPhone a través de WiFi. [...]

  3. Art August 7th, 2007 1:37 am

    # Log into your iPhone via ssh and run MyPhone with this command:

    * nohup python /usr/local/bin/MyPhone.py&

    ** now is this command within WinSCP within the terminal? or is this command in start run? or where because I error “Connection has been unexpectly closed: Server Sent Command Exit Status 2″ in the program terminal. help please

  4. Art August 7th, 2007 4:08 am

    /usr/bin$ nohup python /usr/local/bin/MyPhone.py
    -sh: line 134: /usr/bin/nohup: Permission denied

    HELP please…

    why do i get this error. :(

  5. Art August 7th, 2007 4:16 am

    Ok i think i’m getting closer. Someone please help me out.

    /usr/bin$ nohup python /usr/local/bin/MyPhone.py
    Traceback (most recent call last):
    File “/usr/local/bin/MyPhone.py”, line 330, in
    httpd = BaseHTTPServer.HTTPServer((”", 1111), ReqHandler)
    File “/usr/lib/python2.5/SocketServer.py”, line 330, in __init__
    self.server_bind()
    File “/usr/lib/python2.5/BaseHTTPServer.py”, line 101, in server_bind
    SocketServer.TCPServer.server_bind(self)
    File “/usr/lib/python2.5/SocketServer.py”, line 341, in server_bind
    self.socket.bind(self.server_address)
    File “”, line 1, in bind
    socket.error: (48, ‘Address already in use’)

  6. Art August 9th, 2007 3:17 am

    Sorry. I didn’t specify the problem. I use the command prompt in WinSCP to execute the /usr/local/bin/MyPhone.py command and get this error:

    /usr/bin$ nohup python /usr/local/bin/MyPhone.py
    Traceback (most recent call last):
    File “/usr/local/bin/MyPhone.py”, line 330, in
    httpd = BaseHTTPServer.HTTPServer((””, 1111), ReqHandler)
    File “/usr/lib/python2.5/SocketServer.py”, line 330, in __init__
    self.server_bind()
    File “/usr/lib/python2.5/BaseHTTPServer.py”, line 101, in server_bind
    SocketServer.TCPServer.server_bind(self)
    File “/usr/lib/python2.5/SocketServer.py”, line 341, in server_bind
    self.socket.bind(self.server_address)
    File “”, line 1, in bind
    socket.error: (48, ‘Address already in use’)

    if anyone can help, i’d really appreciate it.

    Thank You

  7. Ravi August 9th, 2007 2:00 pm

    I’m a little confused at this part: 4. Log into your iPhone via ssh and run MyPhone with this command:

    * nohup python /usr/local/bin/MyPhone.py&

    Where do I put in that command? I’m using WinSCP as my SSH client.

    Also, when you said to copy myphone.py into /usr/local/bin, did you mean /usr/bin? My phone didn’t have a /usr/local directory.

    Thanks!

  8. tieum August 11th, 2007 7:45 am

    works great!
    w/ python on the iphone possibilities are endless.. ;)

  9. Ravi August 11th, 2007 12:15 pm

    Got the same problem as Art. Can anyone pls help us out?

  10. Ravi August 11th, 2007 1:01 pm

    Just to clarify:

    Ran Jailbreak.
    Installed binkit v0.06 to /bin. Gave all files x perms.
    Installed python according to the instructions here: http://iphone.fiveforty.net/wiki/index.php/Webshell. Gave all files x perms.
    Copied MyPhone.py to usr/local/bin and gave it x perms.
    Ran nohup python /usr/local/bin/MyPhone.py& in WinSCP.

    At that last part, I get “Connection has been unexpectedly closed: Server Sent Command Exit Status 2″.

  11. Art August 12th, 2007 3:47 am

    @tieum. how did u get it installed and running. did u install python on the /bin/local file directory or to /bin ?

  12. Art August 12th, 2007 4:34 am

    When I execute the command i still get this:

    Traceback (most recent call last):
    File “/usr/local/bin/MyPhone.py”, line 330, in
    httpd = BaseHTTPServer.HTTPServer((”", 1111), ReqHandler)
    File “/usr/lib/python2.5/SocketServer.py”, line 330, in __init__
    self.server_bind()
    File “/usr/lib/python2.5/BaseHTTPServer.py”, line 101, in server_bind
    SocketServer.TCPServer.server_bind(self)
    File “/usr/lib/python2.5/SocketServer.py”, line 341, in server_bind
    self.socket.bind(self.server_address)
    File “”, line 1, in bind
    socket.error: (48, ‘Address already in use’)

  13. Art August 14th, 2007 4:39 am

    @Ravi. ANy luck yet?

  14. Sergio Parreiras August 14th, 2007 12:20 pm

    I didn’t install Myphone yet but for those who have problems with installing the pre-requisites:

    To get the python binaries:

    http://iphone.natetrue.com/python_mach-o_acorn_build6.tar.gz

    To install python follow the instructions:

    http://iphone.fiveforty.net/wiki/index.php/Webshell#Install_Python

    Things are much easier to do if you have WinSCP running
    (for that check http://www.hacktheiphone.com, section on SSH).

    Again … you have to have jailbreaked and have SSH running before all that …

  15. grimmet August 14th, 2007 7:20 pm

    hi there, very nice “app”. i installed and everything works as expected.

    but: ine question left: is there any way i can sort the files by album? to mutch compilations, sort by artists just give me one file per artist.

    iam not mutch in python and woul appreciate every hint. thanks in advance.

    regards grimmet

  16. AK August 15th, 2007 2:53 am

    Runs fine, but browser doesn’t connect. No errors in the log file.

  17. Ravi August 15th, 2007 11:24 pm

    Nope. I screwed something up on my phone while playing around with this and now even SSH doesn’t work (just “connection refused”). I may have to do a restore and start over. In any case, I’ll be busy these next few days and idk how much time I’ll have to work on this. GL to you though!

  18. redzzand August 16th, 2007 11:08 pm

    it definitely works… you can use putty as ssh client or the terminal app itself. make sure you create the /usr/local/bin directory and chmod MyPhone.py to 755. Then execute: nohup python /usr/local/bin/MyPhone.py&

    The ppl getting errors, the last line of the output states: socket.error: (48, ‘Address already in use’)

    This means your http server on port 1111 is already running. Try http://ipaddress:1111/ on your browser.

    If still doesn’t work reboot phone. If all else fails re-install…

    Happy Modding…

  19. GioTheEdge August 17th, 2007 1:38 am

    Add to .profile this two line to switch ON and OFF this great features

  20. GioTheEdge August 17th, 2007 1:38 am

    alias mypod_off=’kill -9 `ps wwx | grep “MyPhone.py” | grep -v grep | sed -e s/\?.*//`’
    alias mypod_on=’nohup python /usr/local/bin/MyPhone.py&’

  21. Art August 17th, 2007 6:12 am

    I got it :D

    nohup python /usr/bin/MyPhone.py

    (set permissions to everything)

    Then you’re good :D

  22. Ravi August 17th, 2007 8:22 am

    Set perms to everything on what file? MyPhone.py? I’ll try it, thanks!!! What method did you use to install Python? This one? http://iphone.fiveforty.net/wiki/index.php/Webshell

  23. Art August 17th, 2007 1:24 pm

    No. I used these instructions.. Just download python and install it in the instructed folder that it’s designated to go which i believe is /usr/bin or somethin like that. ignore local. cause local is just the home directory of the iphone.

    also when you connect it’ll say ABOUT - close screen error but that FINE! that’s what you want, when you see that error, open up the browser and point it to the iphone address http://(Iphone_Address):1111/

    and wait like 10-20 seconds and boom you see the list :D

  24. Ravi August 22nd, 2007 4:20 pm

    Got it! Thanks for the help!!!

  25. Art August 22nd, 2007 8:27 pm

    Great.. Glad I could help. :D

  26. Jon August 23rd, 2007 10:06 am

    OK - seems to be working, but when I click to open one of the songs, none of the browsers (OSX safari, OSX firefox, IPHONE safari) know what to do with the content type and either download the file or give a ‘content too large’ error… any suggestions?

  27. Appleman October 3rd, 2007 11:17 am

    Is this supposed to work with iTunes purchased music?

  28. Greg October 16th, 2007 7:22 pm

    I am unable to get this to work.

    I have the MyPhone.py file in the right place and am able to ssh and run the listed command. When I do I get a response from Terminal: “sending output to nohup.out”

    When I go the IP address however, it says - cannot find server. I am running Apache on the iPhone as well and can access the webserver so it is connecting, but not to MyPhone.

    Any ideas?

    Thanks

  29. [...] Een webserver op de iPhone draaien is niet nieuw, want dat kan dankzij Apache al via de Installer. Maar wie het zelf werkend wil krijgen en wel eens bewijs wil zien dat het daadwerkelijk werkt, kan terecht op docpool.org/iphone. Dit is een blog die rechtstreeks vanaf een iPhone draait, aangevuld met tips hoe je zoiets ook zelf voorelkaar kunt krijgen. De maker van docpool.org/iphone gebruikt daarvoor: iPhone firmware 1.0.2 (hoewel het ook onder 1.1.1 moet werken), Terminal, BSD-subsystem, Apache, PHP en MobileTextEdit. Als je nog steeds neit gelooft dat deze weblog vanaf een iPhone draait, kun je hier nog meer bewijs zien. Op de weblog vind je ook voldoende uitleg. Zoek je nog naar een zinvolle andere toepassing van een iPhone als webserver, dan kun je ook zorgen dat de webserver je muziekcollectie draadloos op de iPhone aanbiedt. [...]

  30. adam December 9th, 2007 1:49 pm

    I got it to work but every time i want to use it i have to reenter the command
    nohup python /usr/local/bin/MyPhone.py&

    is it supposed to be that way or should it only need to be run once? please help

Leave a reply