From: Dave H. <dhy...@gm...> - 2010-02-05 19:52:42
|
Hi Jason, On Fri, Feb 5, 2010 at 11:16 AM, Jason C. Mecham <jas...@am...> wrote: > On my Gumstix Overo I am trying to create a Webpage as the GUI for a C > program continuously running on it. > > So far I have the Cherokee Webserver installed along with PHP. I’ve verified > that I can put a php file into the website directory and it can be > interpreted with the html results displayed on the browser. > > Now I have to find some way to communicate between the webpage and a C > program. > > As a simple test I just want a button on the website that says “GO” and > clicking on that will tell a C program to do something (change GPIO pin > state, take an image with a UVC camera, etc). After that I’ll add > functionality like being able to read from temperature sensors, etc. The C > program needs to run continuously without regard to whether the someone is > at the website. The website is just to modify its behavior. > > What’s the easiest way to communicate via webpage and a C program? > > Pipes? Using a file? So - normally, the web page would invoke a cgi program. This program would then parse the incoming HTML and perform some action. That program could then talk to some other daemon, in which case you'd probably want to use something like named pipes. > Should I even being using PHP to do this or some other scripting language? PHP should work fine. If you have php running in the server then you may not need the cgi app. You could have the PHP app call out to helper programs to do things like read a sensor. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ |