 #include <ESP8266WiFi.h>
 #include "cJSON.h"
 #include <string.h>
+#include <stdarg.h>
 
-
-const char* ssid     = "Eino-Huawei-Y6";
-const char* password = "jeejeejoojoo";
+const char* ssid     = "aalto open";
+const char* password = "";
 
 
 /*

  
  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  const int httpPort = 8080;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
  
  Serial.println(String("### DEBUG: Content-Length:") + strlen(jsonData));
  
  // This will send the request to the server
  client.print(String("POST ") + "/" + " HTTP/1.1\r\n" +
               "Host: " + host + ":" + httpPort + "\r\n" + 
               "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n" +
               "Content-Length: " + strlen(jsonData) + "\r\n" +
               "Connection: close\r\n\r\n" + jsonData);

  Serial.println("----------------------------------------------------");
  
  Serial.println(String("POST ") + "/" + " HTTP/1.1\r\n" +
               "Host: " + host + ":" + httpPort + "\r\n" + 
               "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n" +
               "Content-Length: " + strlen(jsonData) + "\r\n" +
               "Connection: close\r\n\r\n" + jsonData);

  Serial.println("----------------------------------------------------");
               
  
  unsigned long timeout = millis();
  while (client.available() == 0) {
    if (millis() - timeout > 5000) {
      Serial.println(">>> Client Timeout !");
      client.stop();
      return;
    }
  }
  
  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }
  
  Serial.println();
  Serial.println("closing connection");
}


*/

const char* host = "futuwear.tunk.org";

void s_printf(char *buf, char *fmt, ... ){
        va_list args;
        va_start (args, fmt );
        vsnprintf(buf, 128, fmt, args);
        va_end (args);
}

void setup() {
  Serial.begin(115200);
