Lwip + HTML CGI + LED

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
chelox
Posts: 17
Joined: Tue Jan 22, 2013 8:24 pm

Lwip + HTML CGI + LED

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Lwip + HTML CGI + LED

Post 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
sam76
Posts: 15
Joined: Fri May 03, 2013 8:07 am

Re: Lwip + HTML CGI + LED

Post 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.
Post Reply