Web Status
Spire_Jeff
Posts: 1,917
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
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
0
Comments
http://amxforums.com/showthread.php?t=6462&highlight=mobile+web
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:
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
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