We have moved at community.getvera.com

Author Topic: Remote Access  (Read 10958 times)

Offline JCH

  • Beta Testers
  • Jr. Member
  • *****
  • Posts: 53
  • Karma: +0/-0
Remote Access
« on: February 18, 2016, 08:56:02 pm »
I have been following this for a while and its looking good!!!
Now that I am having memory issues (overloaded Vera Lite) I am thinking i am going to set this up on a Ras Pi this weekend to take some of the load.
Just a couple of questions I have
1) How do we achieve remote access?  do you use the ALT UI login? or do I need to setup a VPN?
2)To run this on a windows machine, does it need to be run in a Linux virtual machine or can I run under windows?

Offline logread

  • Full Member
  • ***
  • Posts: 214
  • Karma: +7/-1
Re: Remote Access
« Reply #1 on: February 19, 2016, 02:34:09 am »
This is my setup... Using a VPN for now... MiOS routing that AltUI (and the Vera UI as well) relies on can only target a Vera machine that is registered with MCV Vera.
I am working on a reverse bridge idea during my spare time to access the OpenLuup machine from the Vera to address this (and be able to see both machines from the remote apps like HomeWave). Need to address some circularity issues and avoid recreating plug-ins that eat memeory on the host vera...

Not sure about your question on Windows... I personnaly test my set up in a Linux VM in Virtual Box on a Windows machine... I read somewhere on the forum  that Windows can host openLuup but OS calls might create issues in certain cases
Vera Lite UI7, Fibaro FGS-221, FGS-212, FGSS-001, FGK-101, FGWPE/F-101, FGMS-001, Aeon HEM G2, GreenWave PowerNode 6,  Everspring ST-814, SE-812, Swiid SwiidInter.
Raspberry Pi2 Raspbian w/ openLuup. AltUI, SV Thermostat, Virtual Switch, Weather (openWeather), System Monitor (openSysMon), HomeWave.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Remote Access
« Reply #2 on: February 19, 2016, 02:58:47 am »
openLuup works on Windows, natively, but there may be some plugins which try to make use of OS features which aren't always there. Depends on what you need.  If it was just to run a bridge to Vera you should be OK. I don't have a definitive list, sorry (can't test everything), but ask if you need help.

For remote access, you will need VPN.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Remote Access
« Reply #3 on: February 19, 2016, 04:15:05 am »
Hi,

For Pi I installed weaved (weaved.com) and defined a connection to port 3480. It sort of works in that I have to manually add the /data_request?id=lr_ALTUI_Handler&command=home... after making the connection. Weaved does not support adding anything to the host name. I know you can do something with redirects in lighttpd, but I have not tried it yet. Anyone with experience on that?

Also the images are not coming trough as you truly have access to port 3480 only. You can also setup ssh access. But for some occasional emergencies I cannot do by phone/vpn it is a way.

Cheers Rene.

2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline cybrmage

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1104
  • Karma: +113/-43
Re: Remote Access
« Reply #4 on: February 19, 2016, 08:20:23 am »
I know you can do something with redirects in lighttpd, but I have not tried it yet. Anyone with experience on that?

Add the following html as the index.html in the lighttpd document root (should be /www/index.html)... It will redirect to the AltUI homepage.

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<meta http-equiv="refresh" content="0; URL=/port_3480/data_request?id=lr_ALTUI_Handler&command=home#" />
<title>Home</title>
<style type="text/css">
*{color:#CCC;background:#000;font-family:Verdana,Helvetica,sans-serif}
p{position:absolute;width:99%;top:50%;margin-top:-3em;line-height:3em;text-align:center}
</style>
</head>
<body>
<p>Redirecting ...<br/>
 <a href="/cmh">main page</a></p>
</body>
</html>

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Remote Access
« Reply #5 on: February 19, 2016, 04:04:28 pm »
Hi cybrmage,

Sadly this does not work on openLuup. I recall from akbooer that it needs :3480 and does not handle /port_3480 like the Vera does.

Thanks for the suggestion though. I will play with the lighttpd.conf file a bit and see what happens.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Remote Access
« Reply #6 on: February 19, 2016, 05:22:06 pm »
Rene,

Try this, I would have put this in the guide but I was trying to keep it simple. Doing so from the config caused me issues...

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL='http://{enter your IP here}:3480/data_request?id=lr_ALTUI_Handler&command=home#'" />
</head>
</html>

Hi cybrmage,

Sadly this does not work on openLuup. I recall from akbooer that it needs :3480 and does not handle /port_3480 like the Vera does.

Thanks for the suggestion though. I will play with the lighttpd.conf file a bit and see what happens.

Cheers Rene
openLuup, AltUI, Zway and HomeWave, enough said...

Offline cybrmage

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1104
  • Karma: +113/-43
Re: Remote Access
« Reply #7 on: February 19, 2016, 06:07:21 pm »
Sadly this does not work on openLuup.

Oops... I missed the configuration file for lighttpd that enables the "/port_3480/" redirect...

Create a file called "99-openluup.conf" in the lighttpd configuration directory... (should be /etc/lighttpd/conf/enabled/)... and insert the following:
Code: [Select]
$HTTP["url"] =~ "^/port_3480/" {
  $HTTP["host"] =~ ".*" {
    url.redirect = ( "^/port_3480/(.*)" => "http://%0:3480/$1" )
    url.redirect-code = 302
  }
}

That will enable openluup handling of any /port_3480/ request...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: Remote Access
« Reply #8 on: February 19, 2016, 06:11:56 pm »
I'll definitely give this a try, I never could get my config to work properly ... Thanks

Sadly this does not work on openLuup.

Oops... I missed the configuration file for lighttpd that enables the "/port_3480/" redirect...

Create a file called "99-openluup.conf" in the lighttpd configuration directory... (should be /etc/lighttpd/conf/enabled/)... and insert the following:
Code: [Select]
$HTTP["url"] =~ "^/port_3480/" {
  $HTTP["host"] =~ ".*" {
    url.redirect = ( "^/port_3480/(.*)" => "http://%0:3480/$1" )
    url.redirect-code = 302
  }
}

That will enable openluup handling of any /port_3480/ request...
openLuup, AltUI, Zway and HomeWave, enough said...

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Remote Access
« Reply #9 on: February 19, 2016, 06:20:50 pm »
HI,

After a few hours of tinkering I can get something to happen on port 80 as that is where lighttpd is running. However, on port 3480 openLuup is calling the shots. It took me most of tonight to get to that duh... moment  ::) So if any redirects are required on port 3480 I can try changing the lighttpd config till I'm blue in the face, but it is not going to happen.

The only option is to hack the server.lua and in the receive function for the GET method change an empty path
Code: [Select]
if (path == "/") then
  path = "/data_request?id=lr_ALTUI_Handler&command=home"
end
I tried that and it actually works and it does not yet like I broke anything :D.

So if you want remote access, have a look at weaved.com and setup a connection to port 3480. It is pretty simple to do. You can then add the /data_request... by hand after connecting or hack akbooer great work over and over as I am not sure he would like to add this as a default option  ;) ;). O, and images do not work as you truly only have a connection to port 3480 this way, not on 80 too.

O well, it was a fun night.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Remote Access
« Reply #10 on: February 19, 2016, 07:07:01 pm »
You can then add the /data_request... by hand after connecting or hack akbooer great work over and over as I am not sure he would like to add this as a default option  ;) ;).

I really don't see any down side to having that as a default.  Happy to add if it makes things easier (unless there IS a problem.)
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline JCH

  • Beta Testers
  • Jr. Member
  • *****
  • Posts: 53
  • Karma: +0/-0
Re: Remote Access
« Reply #11 on: February 19, 2016, 10:07:14 pm »
This is my setup... Using a VPN for now... MiOS routing that AltUI (and the Vera UI as well) relies on can only target a Vera machine that is registered with MCV Vera.
I am working on a reverse bridge idea during my spare time to access the OpenLuup machine from the Vera to address this (and be able to see both machines from the remote apps like HomeWave). Need to address some circularity issues and avoid recreating plug-ins that eat memeory on the host vera..


I really like the sound of the reverse bridge. I will be looking out for that!!!


I guess one other thing I am trying to get my head around is how everyone is handling there logic if PLEG is not supported?
Does ALT UI have anything different to Veras Lua?

Offline JCH

  • Beta Testers
  • Jr. Member
  • *****
  • Posts: 53
  • Karma: +0/-0
Re: Remote Access
« Reply #12 on: February 19, 2016, 10:08:35 pm »
Quote
This is my setup... Using a VPN for now... MiOS routing that AltUI (and the Vera UI as well) relies on can only target a Vera machine that is registered with MCV Vera.
I am working on a reverse bridge idea during my spare time to access the OpenLuup machine from the Vera to address this (and be able to see both machines from the remote apps like HomeWave). Need to address some circularity issues and avoid recreating plug-ins that eat memeory on the host vera...
I really like the sound of the reverse bridge. I will be looking out for that!!![/sub]

I guess one other thing I am trying to get my head around is how everyone is handling there logic if PLEG is not supported?
Does ALT UI have anything different to Veras Lua?

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: Remote Access
« Reply #13 on: February 20, 2016, 03:07:43 am »
I guess one other thing I am trying to get my head around is how everyone is handling there logic if PLEG is not supported?
Does ALT UI have anything different to Veras Lua?

Yes, it has device variable watch triggers (which, in fact, is what PLEG uses as well) and then you can use straight-forward Lua expressions or a graphical blockly user interface to define your conditional logic.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Remote Access
« Reply #14 on: February 20, 2016, 05:28:10 am »
You can then add the /data_request... by hand after connecting or hack akbooer great work over and over as I am not sure he would like to add this as a default option  ;) ;).

I really don't see any down side to having that as a default.  Happy to add if it makes things easier (unless there IS a problem.)
So my subtle winking helped  ;D. It would be brilliant if it could be something you can define in startup.lua as a top-level attribute?

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.