 void generateOKHTML(String& sResp, String& sHead)
 {
   sResp += "<FONT SIZE=-3>Andreas Niggemann " + String(versionMonth) + "/" + String(versionYear) + "<BR></body></html>";
-
   sHead = "HTTP/1.1 200 OK\r\n"
           "Content-Length: " + String(sResp.length()) + "\r\n"
           "Content-Type: text/html\r\n"
           "Connection: close\r\n"
           "\r\n";
-}
-
-String getRequest(WiFiClient webclient)
-{
-  String retVal = "";
-  if (webclient)
-  {
-    unsigned long timeout = millis() + 250;
-    while (!webclient.available() && (millis() < timeout) )
-      delay(1);
-    retVal = webclient.readStringUntil('\r'); // Read the first line of the request
-    webclient.flush();
-  }
-  return retVal;
 }
 
 bool checkPathAndGetParameters(String sReq, String& sPar)

  String sResponse, sHeader, sParam = "";

  process();

  client = server.available(); // Check if a client has connected
  String sRequest = getRequest(client);

  if (sRequest == "") // stop client, if request is empty
  {
    client.stop();
    return;
  }

  bool pathOK = checkPathAndGetParameters(sRequest, sParam); // get parameters from request, check path
  if (pathOK) // generate the html page
  {
    if (sParam != "")
    {
      extractParams(sParam);
      process_mode();
    }

    sResponse = generateHTMLPage(delayToStart, numberOfShots, delayBetweenShots);
    generateOKHTML(sResponse, sHeader);
  }
  else // 404 if error
    generateErrorHTML(sResponse, sHeader);

  client.print(sHeader); // Send the response to the client
  client.print(sResponse);
  client.stop(); // and stop the client
}

void process_mode()


void setup()
{
  if (startPin > -1)
    pinMode(startPin, INPUT_PULLUP); // Setup GPIO input for start signal
  pinMode(triggerPin, OUTPUT); // setup GPIO as camera trigger
  trigger(OFF);
  WiFi.mode(WIFI_AP); // AP mode for connections
