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 <blocked::mailto:[email protected]> @fmcti.com 
<blocked::mailto:[email protected]>  | P: 814 898 5250 


FMC Technologies Measurement Solutions Inc.
1602 Wagner Avenue | Erie PA | 16510 USA 
Phone: 814 898 5000 | Fax: 814 899-3414
www.fmctechnologies.com <blocked::http://www.fmctechnologies.com/>  

 
 

________________________________

From: [email protected] 
[mailto:[email protected]] 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 Java Script 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: [email protected] 
[mailto:[email protected]] On Behalf Of Bill 
Auerbach
Sent: Monday, February 23, 2009 3:25 PM
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] CGI - Porting uIP webserver app (httpd-cgi.c) to lwIP?

 

Hi Ed,

 

I would use GET for this - it's 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.  It's a 
great short description of GET and POST.

 

Bill

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Ed Sutton
Sent: Monday, February 23, 2009 3:56 PM
To: Mailing list for lwIP users
Subject: RE: [lwip-users] CGI - Porting uIP webserver app (httpd-cgi.c) to lwIP?

 

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: [email protected] 
[mailto:[email protected]] On Behalf Of Bill 
Auerbach
Sent: Monday, February 23, 2009 2:47 PM
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] CGI - Porting uIP webserver app (httpd-cgi.c) to lwIP?

 

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!

_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to