| ECS-L Home Automation and Security Archives |
| Subject: From: Date: | Re: [ECS] CGI advice needed Kent Noonan Sat, 29 Jan 2000 22:49:22 -0600 |
If you wan't to get others comments on my opions feel free to forward this back to the list... I just didn't want to sound too condascending in public.. :-) And my apologies if I sound that way to you as well.. On 29 Jan 00, at 20:08, Mark Gilmore wrote: > Hi all, > > NOTE:An embryonic ECS/LINUX is now "operational", in that it > executes Events and supports most serial-devices (less the > modem and the NAPCO). Still lacking is sound support and a > user-interface (other than scrolling status text). > > Rather than manually re-invent yet ANOTHER user-interface for > ECS/LINUX, I thought that I would be better off creating a > HTML/CGI-based interface that could be used on multiple platforms > (e.g. Win AND LINUX). BUT before diving into anything, I would > appreciate your sage guidance :-): Wow I figured you would hate that one.. But since you are persuing it I'll give you my thoughts on the matter. > > 1) Is this a good approach ? > If not, why not, and what would be a better approach ? After sending you that last email I had some thoughts again.. This may be a little more than you are barganing for, but rather than getting into writting a CGI for a web server you might consider incorporating a small minimal web server into ECS to serve ECS pages. One major reason for suggesting that is because setting up a web server on linux isn't always an easy task to accompolish. By doing it this route though the end user looses some of the ability to do some customization.. (Say I want a link on my ECS page to goto TV-guide's page) > 2) Should I use PERL, JAVA, or something else (and why) ? Perl is a wonderfully easy language to learn and very powerful. So if a user wanted to customize their interface it would be no problem to sit down and do a little programing and totally change it to their desires. Plus perl doesn't have to be utilized only for Web interfaces.. If someone were wanting to utilize a text based client it would be no problem to remove the CGI stuff and write one of their own. I don't have much experience with java as far as ease of use or the learning curve. I do know that if something is written in java, basically the code is downloaded from the server to the client and run on the client pc. With the Java model you still have to have something running back on the server for the client to talk to. I don't know the exact status, but I think sun is working on rectifing it, but Java support for linux is laking. The JDK and JRE for linux is a version behind all the other I think. However with Java you would get real-time updates without the delay of having to have the browser request an update every so often. > 3) How could the CGI best communicate with ECS ? > NOTE: The DDE interface (with some additions) would work fine under > Win (if I could interface it to the CGI), but I would prefer a method > that could be applied on all platforms. CGI is going to be a program that is goint to be running on the same machine as the webserver. As long as you spit out html compliant code and there is a browser avaliable for platform x then platform x will be able to utilize ECS. It doesn't matter what is running in the background on the webserver.. It could be perl, shell scripts or compiled c code, anything that can interface with ECS and print out HTML. Sorry for pointing out the obvious if I did, the wording of the question made it sound like that wasn't clear. > 4) Can you provide an IDIOT's description of how YOU would to it > (including a basic description of the data/control flow and what > software does what) ? > Please remember that I am VERY green on CGI/PERL/JAVA/etc. Start up netscape request URL: http://myecshost.home.net/cgi- bin/ecsstatus?monitorgroup=A Webserver executes program ecsstatus in cgi-bin directory with environment variable querystring set to monitorgroup=A program ecsstatus contacts ecs via pipe, api, ipc, whatever works gets the information it is looking for and assembles HTML ecsstatus prints html out to stdout where webserver is reading it webserver passes web page back to netscape I apologize for being too basic if I am, but is this the kind of information you are looking for?? Feel free to contact me more if I'm helping... Kent