I spent a while searching for a guide on how to get picoreplayer working
over a vpn and couldn't find one. After a bit of trial and error, I
managed to get a picoreplayer connecting my home network over a vpn,
meaning I can have picloreplayers outside my home network and don't need
to open up the LMS ports to the rest of the big bad internet. This post
will guide you through setting ups  vpn client on your picoreplayer and
connecting it to a VPN server on your home network. The set up needs to
be done with the picoreplayer connected to your home network directly,
once completed you can move it to the remote network on the internet.

My setup is as below:

picoreplayer on raspberry Pi running version 3.10 out on the internet
OpenVpn to connect to my home network
Asus router providing the OpenVpn server.
Mac Mini running LMS inside my home network

First thing to do is configure your VPN server. My Asus router provides
this very easily from its web interface. There's a link on the left hand
side under advanced settings called VPN:
22004

Then click the OpenVPN button and make sure you are on the VPN server
page (not VPN Client). You shouldn't need to set any advanced
parameters, just leave everything default and set Enable OpenVPN Server
to On:
22005

You'll also need to add a VPN user under the username and password
section, for example:
22006

Once thats all done, hit apply and the VPN server should be running. I'm
sure more details can be found on the OpenVPN and Asus forums...

To configure the client end of the VPN, you'll need some specific
configuration details from the VPN Server. Luckily, Asus routers will
generate all this for you. Click the big export button and you should
download an .opvn configuration file. Save this as we'll use the details
when configuring the VPN client on the picoreplayer.

Now it's time to get picoreplayer ready to run a VPN client:

On the web interface, click the advanced tab at the bottom, this allows
us to easily install some extensions we need:
22007

Then click the extensions button to take you to the extensions page. You
want to make sure the Official piCore repository is selected under the
Set extension repository section. If not, change to this and click set:
22008

You want to install two extensions:
  
- ntp.tcz
- openvpn.tcz
  

Select each in turn and click load. This will install the ntp client
(needed to make sure the time on picoreplayer is right - if it isn't the
openvpn client won't connect) and the openvpn client.

With both of these installed, it's time to switch to the command line
and configure the VPN Client.

Login on to your picloreplayer using ssh (use PuTTY on windows or just
the command prompt on Linux/MacOs). You'll need to know the IP address
of your picoreplayer on your home network.

Once logged on, create a directory in the tc user's home directoy called
openvpn"

Code:
--------------------
    cd /home/tc/
  mkdir openvpn
  cd openvpn
--------------------


In this directory you need to create 5 files:

CA.CRT
In this file, paste in all the text between the <ca> and </ca> tags from
the .ovpn file saved from the router.

CLIENT.CRT
In this file, paste in all the text between the <cert> and </cert> tags
from the .ovpn file saved from the router.

CLIENT.KEY
In this file, paste in all the text between the <key> and </key> tags
from the .ovpn file saved from the router.

UP
In this file, put the username and password created on the server
openvpn page on your router, one per line. For example:

Code:
--------------------
    exampleUser
  examplePassword
--------------------


CLIENT.CONF
In here goes all the other config you haven't yet used from the
generated .ovpn file. One change you must make is to add "up" after
auth-user-pass. My client.conf is below (your remote hostname will be
different, the port should be the same)

Code:
--------------------
    client
  dev tun
  proto udp
  remote example.hostname.com 1194
  float
  comp-lzo adaptive
  keepalive 15 60
  auth-user-pass /home/tc/openvpn/up
  ns-cert-type server
  resolv-retry infinite
  nobind
--------------------


Now we must create a backup of the files we created, otherwise they will
all be lost when picoreplayer reboots (I learnt this the hard way after
re-typing the config multiple times :-())

Code:
--------------------
    /usr/local/sbin/pcp bu
  [ INFO ] Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz|
  Done.
  [ OK ] Backup successful.
--------------------


All the command line stuff is done now so you can log out.

The last step is to have picoreplayer set the date and time through
ntpdate and then start the openvpn client at boot. This can all be done
through the web interface. On the TWEAKS page, find the section near the
end called User commands.

In the first box, type:

Code:
--------------------
    sudo ntpdate pool.ntp.org
--------------------


In the second box type:

Code:
--------------------
    sudo openvpn --ca /home/tc/openvpn/ca.crt --cert 
/home/tc/openvpn/client.crt --key /home/tc/openvpn/client.key --config 
/home/tc/openvpn/client.conf
--------------------


click save.

That's it, when your picoreplayre reboots it will set the date and time
correctly then connect to your vpn server, thus presenting itself on
your local home network and connect to your LMS.

The only additional step you might need (depending on if your vpn will
allow the discovery service used by LMS) is to manually set the IP
address of LMS in the picoreplayer web interface. This can be done on
the Squeezelite Settings page in the LMS IP field.


+-------------------------------------------------------------------+
|Filename: pcpextensions.png                                        |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=22008|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
odw199's Profile: http://forums.slimdevices.com/member.php?userid=15387
View this thread: http://forums.slimdevices.com/showthread.php?t=106895

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to