[uClinux-dev] Controlling a Device with a web-browser

Patrick Adamo padamo at optonline.net
Thu Feb 8 18:27:04 EST 2001

Take a look at the Go Ahead web server.  It embeds javascript and can be extended to call
YOUR api functions..... It should do exactly what you want....


JR wrote:

> OK, I hooked up a little green led to P0, and got the led toggle program from
> the book to compile and work.....that was all pretty easy.
> Next part was to control the led with a web-browser.  So I:
>      - leveraged a little javascript button-toggler code
>      - Found a couple of appropriate on/off .gif buttons
>      - hacked up the uClinux httpd
>      - Put together a little-bitty web page that displays the button toggle switch
> And so what I have is a hacked solution for providing a toggle switch,
> within my web browser, which controls the led.
> on,off,on,off,on,off......... (how much fun is a guy allowed to have !!)
> How I did this was to code up a led_on() function and a
> led_off() function right in httpd.c, and then whenever the
> appropriate .gif name was retrieved - I called the appropriate
> on or off function.  Button toggles / Led toggles.   Certainly a funny way
> to do it.......
> .......but ultimately not the way it's meant to be implemented.
> So I'd appreciate a general discussion,   ***or especially some pointers to good
> references on web-based control*****.  What's the in thing?  CGI, java, shell
> scripts, perl scripts, all of the above??
> Can lightweight servers like uClinux's httpd - when hacked sufficiently - provide a good
> device control
> solution??
> And some discussion along these lines:
>     - how to prevent a device's web-page from being accessed by more than one
>        browser at-a-time?  How do I control exclusivity??  Do I use a timeout/inactivity
>        mechanism for forcing the resource to be given up.
>     - And then on the other hand, what about sharing?  I'm thinking of something like a
> push
>        model here, and this is my example:  Six people - all at different computers -
> have their
>        web browser opened to the led control page.  The led toggle switch properly shows
>        on or off to represent the state of the led.  When any one of the 6 people hits
> the toggle
>        switch - the change is reflected on the other 5 connected browsers.
> As a side note - thanks to all those who made ucsimm possible.  I've had my system for
> about 1 week now, and it's been a lot of fun!!
> JR
> This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/

This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/

More information about the uClinux-dev mailing list