This page last changed on Nov 19, 2015 by dmorell.

I am running Openremote professional on a Raspberry Pi server and have the application on my iPhone and iPad. I want the ability to control my home automation, (DSC security, lighting, thermostats, boiler control monitoring) outside of my local WIFI network via my iPhone. I am told I need to go through a VPN, which is fine, but I am having a hard time with the tutorials I am seeing online. I found one with readwrite, but it is confusing. Can anyone point me in the right direction/

Thanks.

Dev


Doc2.jpg (image/jpeg)

Hi Devin,

there are different options for setting up VPN possible. For iOS you have PPTP VPN and IPSec clients out of the box. Therefore, you will need to set-up PPTP or IPSec server on your LAN. What is the easiest way to do it depends on your infrastructure. Many routers have OpenVPN servers out of the box, which are more secure than PPTV VPN, but then you will need to configure OpenVPN client on you iOS device. Anyway, please describe your situation, especially where you want to run the server. For example, I have Synology NAS on my LAN, which comes with very easy to use VPN server and supports PPTP, IPSec and OpenVPN. Furthermore, you will need to set-up port forwarding on your router. Which ports to forward again depends of kind of VPN you are going to use.

If you want to start from scratch, then I would go with OpenVPN in UDP mode (default). Because it uses connectionless layer for transport (UPD) it handles all connection aspects. This way, it usually creates more robust connections that other solutions. I use it for RDP sessions, which runs for days, surviving hibernating my Mac and resuming connection without any problems when it wakes up.

Posted by aktur at Nov 20, 2015 11:21

Hi Mike,
Thanks for the reply. My infrastructure is very simple. I have my cable modem connected to the a netgear WNR2000v2 roouter. Openremote is setup on a raspberry pi which is connected (hardwired) to the WNR2000. I am not sure if the WNR2000 has a VPN built in. The overall goal is to openremote on my ios device at work or say at dinner to turn on lights, check the security system, etc.. I have never set up a vpn so I am alittle confused as to how it is setup.

Posted by dmorell at Nov 20, 2015 12:06

Hi Devin,

This is the quite old router that you have and looking at its manual shows that it does not contain the VPN server. However, luckily for you, it supports DD-WRT, which in turn has VPN server. Therefore, this is what I would do in your setup. I'll install the DD-WRT firmware on your router (see https://www.youtube.com/watch?v=bOeBfLPI4WM ) and go from there.

The other option would be to use raspberry for setting up the VPN server but I would not do this, as RP does not have hardware NIC (it uses USB to emulate NIC, therefore it needs to run software to be able to use it, therefore it is less robust than the solution with the router. Moreover, setting up the VPN server on a router is the most transparent and elegant solution).

Posted by aktur at Nov 20, 2015 13:34

Hi Mike,

Funny you mention that. After seeing your rely this morning I checked my manual on my router and noticed there was no VPN. Google showed me DD-WRT page. Do u need to rung my pi as static or dhcp? I read a tutorial from readwrite and it mentioned to go change the configuration file in /etc/network/ configuration from dhcp to static. After that I think that is what is cold using mybfeedback sensors not to work(dsc security with envisalink) on my status page in my gui. The other commands work just not feedback.

Posted by dmorell at Nov 20, 2015 14:52

Hi Devin,

I would not touch /etc/network/interface, unless you know what you are doing. Leaving DHCP is the best option, otherwise you can brick your device if you are not careful. The better option is to preassign a DHCP address in your router configuration so the Raspberry will always get the same IP.

Posted by aktur at Nov 21, 2015 11:55

Hi Mike,

I setup my router with DD-wrt with success. I used the tutorial from dd-wrt on setting up a vpn using PPTP. Now I can see to setup up a vpn on my iphone but not sure where to go from here. It seems I have a connection via wifi but 3g of lte doesnt seem to have a connection. Also how would I connect to to openremote?

Posted by dmorell at Nov 23, 2015 02:33

Hi Devin,

you are almost there. In order to log-in into your VPN server through 3g or any remote network you need to configure it to log-in through your external IP address. To check your external IP address you can go to https://www.whatismyip.com/
Please check that this is the same address as your DD-WRT shows as WAN address. Now, it depends on your ISP if this address is static or dynamic (i.e. changing with every reboot of your cable modem). If it is static then you are all set. If it is dynamic, then you need to set up dynamic DNS and use it instead. How to do it with openremote you can find on my blog http://mqlservice.net/openremote/2014/05/10/no-more-free-dyndns-time-for-ordns/

After establishing the VPN tunnel from outside you should see your local LAN devices as if you were directly connected to it through WiFi. Then you can connect to openremote controller the usual way.

Posted by aktur at Nov 23, 2015 11:05

Ok,

Ill try and work on that tonight. Are you familiar with sensors not working in openremote? All of a sudden, my sensors and commands are not working in openremote. I changed the IP address for my commands when I rebooted my router so I know the ip address' are ok. I checked the password under the configuration file.

Posted by dmorell at Nov 23, 2015 14:27

Hi Devin,

About a year ago I was in the same situation with the VPN configuration.

I document the process for my personal use, but you can use it if you want.
It's not perfect, the idea was to create a shell script to automate the process of installation and configuration of openremote and some other things that I used.

CONFIGURATION

I am currently not active with my automation projects, but I hope this helps.

I found that the remote control through VPNs with openremote is not ideal, because you must keep the vpn connection active on your mobile device and this leads to the use more data (mobile data and data transmission through vpn), Also, if you want to disable or enable the VPN connection each time you use the openremote app, the application fails or loses the panels configuration.

I created a procedure through tasker so that each time the openremote app was activated the vpn connection too, I got similar results.

Next year I'll be active with my automation projects and I will try something different for the remote control of my environments through openremote.

Cheers,
EDGI

Posted by edgi at Nov 25, 2015 14:54
Document generated by Confluence on Jun 05, 2016 09:30