|
From: | Pettinato, Jim |
Subject: | RE: [lwip-users] CGI - Porting uIP webserver app (httpd-cgi.c) tolwIP? |
Date: | Tue, 24 Feb 2009 09:19:19 -0500 |
Don't be afraid to use _javascript_ (especially in
conjunction with XML)... the more the client browser does, the better. Since
the script runs on the browser and not the server, it lightens
the load on the embedded device, and the use of _javascript_ can make a simple
mechanism to retrieve status, etc. on your lwIP server device look quite
professional.
We implemented a simple database value type server-side
include mechanism <!--DBVAL=tagID> where tag ID is the Modbus register
code, then used AJAX to provide status and diagnostic pages with quite a
bit of information, including a background image, tables, etc. The data can
then be refreshed via AJAX to maintain a dynamic remote status
display.
We also used HTTP GET with URL variables to set parameters.
That is sufficient to do quite a bit. We have implemented things like
transaction pages using combo boxes to allow selection of historic
transactions for display, all done with GET and AJAX. __
James M. Pettinato, Jr. Software Engineer E: jim.pettinato@fmcti.com | P: 814 898 5250
From: address@hidden [mailto:address@hidden On Behalf Of Ed Sutton Sent: Tuesday, February 24, 2009 8:43 AM To: Mailing list for lwIP users Subject: RE: [lwip-users] CGI - Porting uIP webserver app (httpd-cgi.c) tolwIP? Hi
Bill, Yes,
I agree using GET would be much simpler to set parameters on my embedded
device as compared to trying to implement POST. I
had visions of creating my web pages by cloning the web page source code of of a
Linksys or Netgear device and then hack it up to fit my application. I
notice that there is a lot of _javascript_ in the Netgear web pages.
However, at this point, the path of least resistance is probably a good
approach. Thank
you *very much* for the link to the GET and POST overviews. I
really needed that as I have not paid too much attention to web development and
never implemented an embedded web server. Thanks
again, -Ed From:
address@hidden
[mailto:address@hidden On Behalf Of
Bill Auerbach Hi
Ed, I
would use GET for this its much simpler as the data you want to get to is in
the HTTP headers which is easy to parse since it follows the
GET. 2
years ago Frédéric BERNON posted this: http://lists.gnu.org/archive/html/lwip-users/2007-07/msg00057.html.
Its a great short description of GET and POST. Bill From:
address@hidden
[mailto:address@hidden On Behalf Of
Ed Sutton Hi
Bill, Thank
you for the warning as I was not aware. If
I can figure out how to use it to POST updates to my embedded device, for
example to set a new static IP from a simple web page, I think I will have what
I need. So far it appears that CGI only supports GET. The SSI
includes work well enough though for displaying device status on a web
page. I
found this searching for 0x20000000:
/* If the data is being read from a buffer in RAM, we need to copy
it
* into the PCB. If it's in flash, however, we can avoid the copy
since
* the data is obviously not going to be overwritten during the
life
* of the connection.
*/
err = tcp_write(pcb, hs->file, len, (hs->file < (char
*)0x20000000) ? 0 : 1); Thanks
again, -Ed From:
address@hidden
[mailto:address@hidden On Behalf Of
Bill Auerbach Be careful of the
system dependency that is hard coded in the source
code about the location of flash and RAM. Search for 0x20000000. Bill >That looks
perfect. The Adam Dunkel version of httpd.c had been modified by
>Luminary Micro
to offer simple server-side-include (SSI) and Common Gateway
>Interface (CGI)
capability. Exactly what I needed for basic setup and status
>of my
device. Thank you very much for taking the time to send me this detailed
>information! |
[Prev in Thread] | Current Thread | [Next in Thread] |