When clicking a button on my web server, I need a C script executed.
I'm using CGI but I'm getting:
[Tue Dec 10 11:17:57 2013] [error] [client 172.17.223.62] Premature end of script headers: set01.cgi, referer:
The C program is this:
#include <wiringSerial.h>
#include <stdio.h>
#include <unistd.h>
int main(){
int handle = serialOpen ("/dev/ttyAMA0", 19200) ;
if (handle == -1){
printf("Error opening TTYAMA0");
}
serialPutchar (handle, 0xC1);
usleep(100);
serialPutchar (handle, 0x7f);
return 1;
}
#!
) and interpreter.