Jump to content

HAD and having your own hosting


Recommended Posts

I am trying to get HAD working, hosted on my own web server.  Although I am a software developer by trade it's mostly non-web, non-scripting languages.  But I have played with alot of setups and configurations of web servers using php, cgi, mysql, etc.

 

Unfortunately some of the terminology is confusing me as I try to get HAD to work.

 

b.t.w. this is on Windows 10 using Aprelium Technologies web server product called "Abyss".  If anyone has not familiar with it, it is an interesting one to check out.

 

so...

 

I downloaded the latest HAD from the SDK and also have the latest firmware on my ISY994i.  

I have php in general working on my server

 

I THINK I am mostly struggling with this notion of redirecting the rest commands to the ISY (the "tranparent proxy" stuff).

 

if I look at the isyProxy.php file provided, I modify the user and password, but because it's not fully working, I'm not 100% sure on the "$isyIP" variable.  

 

Is this the ip address of my ISY994i on my network ?

Do I need to include the port number ?

Or is this the ip address of the "my.isy.io" portal ?

 

If I put the HAD files from the SDK in my <www root>/had folder,

and I have a "rest" folder with the isyProxy.php,

and I have the url rewriting rule setup,

then when I try to load HAD, I get the following:

 

<HTML>
<HEAD>
<TITLE>Not Found!</TITLE>
</HEAD>
<BODY>/had/ not found</BODY>
</HTML>
 
(this appears to be from the print($reply) statement at the end of isyProxy.php)
 
any clues ?
 
thanks, Scott
Link to comment
Share on other sites

Some additional information:

 

my ISY firmware is at 4.4.5

and the HAD version from the SDK is marked as 4.2.23 (part of SDK V 4.3.26)

I assume this is compatible ?

 

Also, slight improvement, I've now managed to see some valid content if I point my browser to:

http://<my'>http://<my intranet web server address/rest/status

 

I see the nodes returned in XML as follows:

 

<nodes>
<node id="FF 0A 03 1">
<property id="ST" value="0" formatted="Off" uom="%/on/off"/>
</node>
<node id="FF 0A 04 1">
<property id="ST" value="255" formatted="On" uom="%/on/off"/>
</node>
<node id="FF 0A 05 1">
<property id="ST" value="255" formatted="On" uom="%/on/off"/>
</node>
<node id="FF 0A 06 1">
<property id="ST" value="0" formatted="Off" uom="%/on/off"/>
</node>
<node id="FF 0A 08 1">
<property id="ST" value="255" formatted="On" uom="%/on/off"/>
</node>
<node id="FF 0A 09 1">
<property id="ST" value=" " formatted=" " uom="%/on/off"/>
</node>
<node id="FF 0A 0B 1">
<property id="ST" value="255" formatted="On" uom="%/on/off"/>
</node>
<node id="FF 0A 0C 1">
<property id="ST" value="255" formatted="On" uom="%/on/off"/>
</node>
<node id="FF 0A 10 1">
<property id="ST" value="255" formatted="On" uom="%/on/off"/>
</node>
</nodes>
 
so that should tell me the transparent proxy redirect is working correct ?
(.../rest/status is being sent to my isy ip address and returns the xml)
 
however, if I try http://<my web server address>/had/index.htm  
(that's the location of the had files from the sdk) then I get:
 
<HTML>
<HEAD>
<TITLE>Not Found!</TITLE>
</HEAD>
<BODY>/had not found</BODY>
</HTML>
Link to comment
Share on other sites

 

I am trying to get HAD working, hosted on my own web server.  Although I am a software developer by trade it's mostly non-web, non-scripting languages.  But I have played with alot of setups and configurations of web servers using php, cgi, mysql, etc.

 

Unfortunately some of the terminology is confusing me as I try to get HAD to work.

 

b.t.w. this is on Windows 10 using Aprelium Technologies web server product called "Abyss".  If anyone has not familiar with it, it is an interesting one to check out.

 

so...

 

I downloaded the latest HAD from the SDK and also have the latest firmware on my ISY994i.  

I have php in general working on my server

 

I THINK I am mostly struggling with this notion of redirecting the rest commands to the ISY (the "tranparent proxy" stuff).

 

if I look at the isyProxy.php file provided, I modify the user and password, but because it's not fully working, I'm not 100% sure on the "$isyIP" variable.  

 

Is this the ip address of my ISY994i on my network ?

Do I need to include the port number ?

Or is this the ip address of the "my.isy.io" portal ?

 

If I put the HAD files from the SDK in my <www root>/had folder,

and I have a "rest" folder with the isyProxy.php,

and I have the url rewriting rule setup,

then when I try to load HAD, I get the following:

 

<HTML>
<HEAD>
<TITLE>Not Found!</TITLE>
</HEAD>
<BODY>/had/ not found</BODY>
</HTML>
 
(this appears to be from the print($reply) statement at the end of isyProxy.php)
 
any clues ?
 
thanks, Scott

 

 

 

> Is this the ip address of my ISY994i on my network ?

 

Yes

 

> Do I need to include the port number ?

 

No.

However, it is assumed that your ISY responds to port 80.

 

> Or is this the ip address of the "my.isy.io" portal ?

 

No

 

I think you are missing a file.

In your /rest folder, you need 2 files:

.htaccess

isyproxy.php

 

This is the .htaccess file that redirects request to /rest/* to isyproxy.php, which in turn makes the request to your ISY using the host, user and password supplied in isyproxy.php.

 

Once setup properly, you should be able to initiate rest requests using your web server IP address. For example, http://yourserver/rest/nodes should give you an XML. When you have this working, HAD should work as well.

 

This .htaccess file is meant to be used with an apache web server. I'm not sure if this would work with abyss. You may want to look into abyss configuration to see if there is a way to redirect a folder to a php file.

 

Benoit

Link to comment
Share on other sites

Benoit

 

thanks for looking at this

 

I do have .htaccess in my rest folder with isyproxy.php but abyss (web server) does not use .htaccess files

abyss has it's own configuration mechanism (and config file) where I set the url rewriting rules via a configuration console

(it actually has a feature to read .htaccess files and tells you how to setup the corresponding rewrite rule in abyss)

(this leads me to believe the have the rewrite rule correct (and see below) )

 

it appears I am getting an XML response back from the had, otherwise why would I get the response (above in my original post) ?

 

but the response is strange, it's XML but notice it just contains the name of my folder on my web server where I am attempting to host HAD

 

can you tell anything based on your understanding of the HAD implementation as to why it would return that specific XML ?

 

say my ISY is at 192.168.1.90

and my Web Server is at 192.168.1.91

 

so if I issue 192.168.1.90/rest/nodes I see the XML returned with the appropriate data

 

now what should be returned if I enter 192.168.1.91/had/index.htm ?

I get that it is supposed to do a redirection based on the url rewrite rule but what is that first request after the first rewrite is applied ?

it's apparently sending something to my ISY at 192.168.1.90 because xml is returned but ???

 

I understand it would be easy to say it's just a problem with abyss, but I'm not convinced

perhaps the rewrite rule works in some setups and not others ?

 

thanks, Scott

Link to comment
Share on other sites

Benoit

 

thanks for looking at this

 

I do have .htaccess in my rest folder with isyproxy.php but abyss (web server) does not use .htaccess files

abyss has it's own configuration mechanism (and config file) where I set the url rewriting rules via a configuration console

(it actually has a feature to read .htaccess files and tells you how to setup the corresponding rewrite rule in abyss)

(this leads me to believe the have the rewrite rule correct (and see below) )

 

it appears I am getting an XML response back from the had, otherwise why would I get the response (above in my original post) ?

 

but the response is strange, it's XML but notice it just contains the name of my folder on my web server where I am attempting to host HAD

 

can you tell anything based on your understanding of the HAD implementation as to why it would return that specific XML ?

 

say my ISY is at 192.168.1.90

and my Web Server is at 192.168.1.91

 

so if I issue 192.168.1.90/rest/nodes I see the XML returned with the appropriate data

 

now what should be returned if I enter 192.168.1.91/had/index.htm ?

I get that it is supposed to do a redirection based on the url rewrite rule but what is that first request after the first rewrite is applied ?

it's apparently sending something to my ISY at 192.168.1.90 because xml is returned but ???

 

I understand it would be easy to say it's just a problem with abyss, but I'm not convinced

perhaps the rewrite rule works in some setups and not others ?

 

thanks, Scott

 

Hello Scott,

 

I think you indeed have a rewrite working, but not for the right folders.

 

In your troubleshooting sequence, we need to resolve the transparent proxy stuff first.

 

If you request 192.168.1.91/rest/nodes, you should be getting the same thing as 192.168.1.90/rest/nodes

The only difference is that 192.168.1.90/rest/nodes should prompt you for a user/password (unless it is already in cache), and 192.168.1.91/rest/nodes will not.

 

If you get that working, then you can focus on HAD.

 

If you request /had/index.htm, and you get this:

<HTML>
<HEAD>
<TITLE>Not Found!</TITLE>
</HEAD>
<BODY>/had/ not found</BODY>
</HTML>

 

Then, this is your ISY which is responding. It should not. You should be getting the actual HAD html. This would mean that you are also redirecting that folder, and you should not.

 

The only relevant folders to redirect are:

/rest/ 

/file/upload/ (Used to save the camera config file)

 

Benoit.

Link to comment
Share on other sites

Excellent, thanks very much

 

having the step to verify both addresses returned the needed xml allowed me to figure it out.

 

Once I got that working I just had to tweak the expression for the rule from '$' to '.*' because of apache vs abyss

 

the basic problem was the I was redirecting /had to /rest/isyProxy.php on the web server machine,

I changed it to redirect /rest to /rest/isyProxy.php

 

I get it now, /had emits /rest requests (for example /rest/nodes)

they  get sent to res/isyProxy.php which simply forwards it to my ISY

 

btw in my original post I asked about specifying the port number for the isyProxy.php cuz originally I had it at 8080

(I prefer it that way so I don't have multiple machines servicing port 80)

I removed it so it used the default to troubleshoot but now put it back to 8080...still works !

(you have to add the port to the isy address in isyproxy.php of course)

 

awesome, thanks again

Link to comment
Share on other sites

Excellent, thanks very much

 

having the step to verify both addresses returned the needed xml allowed me to figure it out.

 

Once I got that working I just had to tweak the expression for the rule from '$' to '.*' because of apache vs abyss

 

the basic problem was the I was redirecting /had to /rest/isyProxy.php on the web server machine,

I changed it to redirect /rest to /rest/isyProxy.php

 

I get it now, /had emits /rest requests (for example /rest/nodes)

they  get sent to res/isyProxy.php which simply forwards it to my ISY

 

btw in my original post I asked about specifying the port number for the isyProxy.php cuz originally I had it at 8080

(I prefer it that way so I don't have multiple machines servicing port 80)

I removed it so it used the default to troubleshoot but now put it back to 8080...still works !

(you have to add the port to the isy address in isyproxy.php of course)

 

awesome, thanks again

 

Glad to hear this is working

 

Benoit.

Link to comment
Share on other sites

Benoit

 

I did notice one small thing, on the "Custom Other" tab the links to the admin and default web do not redirect

Is this intentional?

 

Also, what does File/Enable Internet Access actually do in the admin console (via admin.jlnp).

Mine used to enable/disable fine, but now I always get an error "failed enabling internet access"

 

thanks, Scott

Link to comment
Share on other sites

Benoit

 

I did notice one small thing, on the "Custom Other" tab the links to the admin and default web do not redirect

Is this intentional?

 

Also, what does File/Enable Internet Access actually do in the admin console (via admin.jlnp).

Mine used to enable/disable fine, but now I always get an error "failed enabling internet access"

 

thanks, Scott

 

Oh, I believe you have to redirect /web as well. That's where the default UI is.

 

File/Enable internet access, I'm not sure, I never used this.

 

Benoit.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.6k
    • Total Posts
      368.1k
×
×
  • Create New...