Home AMX User Forum AMX General Discussion

Web Status

Has anyone ever toyed with the idea of creating an HTML file on a processor for status updates? I was just thinking that it would be fairly easy to create a simple web page on the fly and update it every couple minutes with status info. (or create multiple pages ie. hvac, lighting, pool, spa, ...) Then use the web server built-in to the processor to serve the pages?

I am wondering how easy could you make it for the customer to view these pages and would they serve up quicker than the system web pages? I am not looking at providing any control, just a simple web page. (you could even use a little java script to have the client refresh the pages on a regular basis for monitoring :) )

Just a thought,
Jeff

Comments

  • ryanwwryanww Posts: 196
    Take a gander at what Vav did with AMX Mobile. He has already done most of the fancy footwork, wouldn't be too hard to modify it to be a status page. And he even has a log in system in it!

    http://amxforums.com/showthread.php?t=6462&highlight=mobile+web
  • dchristodchristo Posts: 177
    Spire_Jeff wrote: »
    Has anyone ever toyed with the idea of creating an HTML file on a processor for status updates? I was just thinking that it would be fairly easy to create a simple web page on the fly and update it every couple minutes with status info. (or create multiple pages ie. hvac, lighting, pool, spa, ...) Then use the web server built-in to the processor to serve the pages?

    I am wondering how easy could you make it for the customer to view these pages and would they serve up quicker than the system web pages? I am not looking at providing any control, just a simple web page. (you could even use a little java script to have the client refresh the pages on a regular basis for monitoring :) )

    Just a thought,
    Jeff

    Yes, I've been doing this for quite some time. I have a "template" html page on the flash disk that I read line-by-line and check for tags, such as [GARAGEDOORSTATUS]. When I find one of these tags I insert the correct value from the system, then write the line out to a new html file. This lets me change the look of the page without having to update the Netlinx code. Right now I have the file formatted to look good on my phone.

    Instead of updating the file continuously, I have a method for determining when the html file should be updated. I have a server socket open listening for web requests. When a request comes in, the html file on the flash disk is updated, and my server returns a response to the browser redirecting it to the file on the flash disk. The template file has a meta-refresh tag in it (pointing to my server), instructing it to refresh every 10 seconds.

    The socket that I have open also accepts commands as parameters, so clicking a link on the html page can be processed as a command... for example:
    http://my.domain.com:myPort/control?cmd=LTGSCENE&data=NIGHTTIME&token=someSecret
    

    I've been toying with AJAX, but the same-domain security restrictions in Javascript prevent me from using the built-in SSL server to provide the pages, and my own server taking care of the AJAX calls on a different port.

    --D
  • Spire_JeffSpire_Jeff Posts: 1,917
    Thanks for the ideas. I like the idea of the template file with tags :)

    I was contemplating allowing control, but it's really not necessary on most of our AMX jobs as we have taken to installing SSL-VPN servers and the client can just VNC into their panel to do control. It's fairly safe and it gives them complete control without extra code work on my end :)

    Jeff
Sign In or Register to comment.