#include <Phpoc.h>
#include "dht.h"
dht DHT;
#define DHT11_PIN 7
char server_name[] = "test.proin.space";
PhpocClient client;
void setup()
{
Serial.begin(9600);
while(!Serial)
;
Phpoc.begin(PF_LOG_SPI | PF_LOG_NET);
}
void loop()
{
if(client.connect(server_name, 80))
{
Serial.println("connected to server");
client.println("GET /poly.php?temp=123&humi=321 HTTP/1.0");
client.println("Host: test.proin.space");
client.println();
}
delay(100);
while(client.available())
{
char c = client.read();
Serial.print(c);
}
Serial.println("disconnect");
client.stop();
delay(5000);
}
String Temp()
{
int chk = DHT.read11(DHT11_PIN);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
//String Result = "temp=" + (String)DHT.temperature + "&humi=" + (String)DHT.humidity;
String Result = "temp=" + (String)"123" + "&humi=" + (String)"333";
return Result;
}