Page 1 of 1

Lwip + HTML CGI + LED

Posted: Sat May 04, 2013 3:14 am
by chelox
Hello

I have the demo ARMCM4-STM32F407-LWIP-FATFS-USB running on the STM32-E407 board perfectly.

I want to turn on and off an LED from a web page, so I've seen I have to use CGI.

Someone can guide me as would have to configure cgi?? or some example?

thank you!

Re: Lwip + HTML CGI + LED

Posted: Sat May 04, 2013 6:51 am
by Giovanni
Hi,

The very simple HTML server included in the demo does not allow for such complex things. You could parse the HTTP transaction "command line", the path that usually follows the domain name, and call specific functions when you decode certain patterns, this would be like implementing a CGI.

For example:
http://127.0.0.1/led=0
http://127.0.0.1/led=1

Giovanni

Re: Lwip + HTML CGI + LED

Posted: Tue May 07, 2013 10:56 am
by sam76
The httpserver_raw app included in lwip contribution is ready for cgi callback : http://ftp.igh.cnrs.fr/pub/nongnu//lwip ... -1.4.1.zip

just call the httpd_init() function in the thread.