axmxaxr
Posts: 8
Joined: Fri Nov 30, 2012 1:53 pm

Accessing Raspberry Pi's music over internet on an iPhone

Tue Jan 15, 2013 4:28 am

Hello,

I've tried to read about this on this site and the internet in general and have not reached a satisfactory solution.

Here's what I have and want to do:

1) Raspberry pi is acting as a NAS and holds my music library
2) MiniDLNA lets me access this music within my LAN
3) I want to access this music over the internet on my iPhone securely - kind of use Raspberry Pi as an on demand music player for me

I downloaded and tried the 8player app on the iPhone but it requires me to provide an un-secure access to my Pi to access the music using DLNA - I don't want to open a port on my router and point it to the pi so anyone scanning my IP for open ports can find this and access my content without any authentication - and worse exploit it.

What are my options?

Thanks!

Partholan
Posts: 8
Joined: Fri Dec 09, 2011 3:10 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Tue Jan 15, 2013 10:04 am

It's a bit hard to determine what you want to accomplish (at least for me).

If you want the Raspberry Pi to play the music (e.g. through an amplifier connected to the audio jack) then a solution would be MPD (Music Player Daemon). You'd install MPD on your Raspberry Pi, configure it to use the music on your music library and use the audio jack as the output. You can also define HDMI out as audio output.
On your iPhone you'd then install an MPD client to control the playlist, adjust volume etc. The client would connect to the MPD via your home network and WiFi. No internet access needed.

If you want the Raspberry Pi to stream the music, e.g. to your DLNA enabled TV you'd need different software. I haven't done that yet on the Pi, though, as I don't like DLNA. Many clients are very picky about the format of the streamed media.

If you want to access your music through the internet you'd need to route a port to your streaming device (ie. the Raspberry Pi).

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: Accessing Raspberry Pi's music over internet on an iPhon

Tue Jan 15, 2013 10:08 am

DLNA is built on top of UPnP.
UPnP uses broadcasting for service discovery.
Broadcast packets are not routed between your wan and lan interfaces on your router.

I suggest installing some VPN server at home, then use the VPN client functionnalities of the iPhone.
Doing that, you will be connected to your home network as usual event when you are outside.

You can also try to find out existing UPnP service on your Pi, make a port redirection on your router, then manually set it on your iPhone.
If you use a port > 1024, you may not be detected by ip scanners, and moreover with a port > 32k

Any solution you will use will require an open port to access to your network.

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Tue Jan 15, 2013 11:44 am

axmxaxr wrote:I don't want to open a port on my router and point it to the pi so anyone scanning my IP for open ports can find this and access my content without any authentication - and worse exploit it.

What are my options?

Thanks!
I would use MPD, it can stream. You will have to open a port to the PI on your router, but you can password protect the music stream so it shouldn't cause any problems if someone tries to port scan your router.

axmxaxr
Posts: 8
Joined: Fri Nov 30, 2012 1:53 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Tue Jan 15, 2013 5:05 pm

Thanks everyone - I'll read about MPD later today, but in the mean time I found another option - set up owncloud on the pi and enable the media player and then use an Ampache compatible client on iOS - AmpacheX or iAmpache and access my music over the internet.

I'll read about both MPD and Owncloud and go with one - I'll let you know which one I chose and how it worked.

wirelessmonk
Posts: 47
Joined: Sat Sep 08, 2012 2:58 am
Location: The Colonies

Re: Accessing Raspberry Pi's music over internet on an iPhon

Tue Jan 15, 2013 5:29 pm

I'm at work, so I can't (be bothered to ) look it up in more depth,
But this is highly doable.
There are a few flavors of apps built for Android for just this, some of them even almost cooperate with iTunes.
I have been using SubSonic off and on for the last few months, and it does exactly what you're asking. I would be surprised if there aren't already some drop-in solutions for Debian. Whether they'll run on the RPi, who can say.

Hopefully this will give you some more leads, if I get home at a decent hour I will try to expand on the info.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Tue Jan 15, 2013 8:09 pm

Abridged version - this isn't a two minute exercise. :)

Install Squeezeplug v6 on an RPi SD card (see the Media Centres section on this forum) and do the updates. Then from its setup menu, install Logitech Media Server and configure that. Point an mp3 player at the RPi's IP address:9000/stream.mp3. Point a browser at RPi's IP address:9000 to select the player and the tracks, radio station etc you wish to hear. (The player and browser can, but need not be, on the same device.)

If you want access from outside your LAN, forward port 9000 to the RPi and enable security on LMS. You'll need to enter the username and password in the browser URL.

The following is copied directly from a help page in LMS:
The Logitech Media Server was designed to stream mp3 files to a Slim Devices/Logitech network music player. However, it can also stream the same files over the Internet to an MP3 software player such as Winamp and iTunes.

For the sake of discussion, the computer running the server will be called the remote machine.

First install and start the Logitech Media Server software on this machine. Make sure it is reachable over the Internet. If not, you will need to open port 9000 on your router.

Now, use the following instructions:

Open the stream called http://localhost:9000/stream.mp3 in your MP3 software player. (Replace "localhost" with the IP address of the remote computer.) This will inform the server that the software player is ready to receive a stream.
Open the web interface of the server running on the remote computer by opening the web page http://localhost:9000 (Replace "localhost" with the IP address of the remote computer). You will notice a "player" corresponding to the IP address of the computer with the MP3 software player.
Use the left pane of the server web interface to browse and select files and playlists. When music is selected, it will appear in the right pane of the web interface.
Click on "Play" in the right pane of the server web interface to start the music.
After a couple of seconds, you will hear music playing through the MP3 software player. (The delay is due to buffering in the MP3 player software.)
To change the content playing, use the server on the remote machine.
If you are using the server's password security, you'll need to use a slightly modified URL like this: http://username:password@localhost:9000/stream.mp3
Your music can also be streamed to a Squeezebox or Transporter network music player for listening on a stereo. For more information about this product and FAQs, visit http://www.mysqueezebox.com.

If you have a question or problem, please visit http://www.mysqueezebox.com/support or visit our user forums at http://forums.slimdevices.com/

axmxaxr
Posts: 8
Joined: Fri Nov 30, 2012 1:53 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Sun Jan 20, 2013 8:57 pm

I still need to give MPD a try - didn't want to get off Raspbian yet.

So I tried Owncloud and though they talk about Ampache - the support is pretty bad and no one in their forum replied to my questions - so that's out, unless Owncloud enhances their iOS app to allow music streaming.

I tried subsonic - it sounded great, but didn't work well for me - firstly the high CPU usage, even after I fixed the time bug killing NTP. But the apps out there don't cut it and I haven't been successful in playing music via the apps over internet. I can see my playlist but cannot play.

I am tempted to try a secure way of using DLNA and might give that a shot, but if that doesn't work, I'll sit tight for a bit. I know this isn't new technology and things like tversity work seamlessly but you need windows for that.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Sun Jan 20, 2013 10:13 pm

And the problem with Squeezeplug plus LMS is what?

axmxaxr
Posts: 8
Joined: Fri Nov 30, 2012 1:53 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Fri Jan 25, 2013 2:14 pm

The problem with Squeezeplug is that I need to get rid of my Raspbian install and ensure all that I do with it today will work on Squeezeplug.

Wouldn't LMS work on Raspbian? I'm reading at some places that it might so will give it a shot.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Accessing Raspberry Pi's music over internet on an iPhon

Fri Jan 25, 2013 2:41 pm

axmxaxr wrote:Wouldn't LMS work on Raspbian? I'm reading at some places that it might so will give it a shot.
I don't see why not. The Squeezeplug distribution doesn't have a specially crafted version of LMS in the image. It downloads LMS from a server. I can't remember where but I'm sure it isn't the Squeezeplug server. And Squeezeplug v6 is based on Raspian.

Return to “Advanced users”